From c11b8fa9388b987f786c8a8057546e1e677745ee Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Wed, 18 Apr 2007 18:32:12 +0000 Subject: [PATCH] Ansify parameter declarations and fix minor style issues. --- games/adventure/crc.c | 10 ++--- games/adventure/done.c | 14 ++++--- games/adventure/init.c | 22 +++++----- games/adventure/io.c | 66 ++++++++++++++++------------- games/adventure/save.c | 10 ++--- games/adventure/subr.c | 89 ++++++++++++++++++++++------------------ games/adventure/vocab.c | 28 +++++-------- games/adventure/wizard.c | 17 ++++---- games/bs/bs.c | 6 ++- games/grdc/grdc.c | 5 ++- games/hangman/prword.c | 4 +- games/worms/worms.c | 8 ++-- games/wump/wump.c | 51 +++++++++++------------ 13 files changed, 170 insertions(+), 160 deletions(-) diff --git a/games/adventure/crc.c b/games/adventure/crc.c index ad457e70ae..1eab8c4d52 100644 --- a/games/adventure/crc.c +++ b/games/adventure/crc.c @@ -36,7 +36,7 @@ * @(#)crc.c 5.2 (Berkeley) 4/4/91 * @(#)crc.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/adventure/crc.c,v 1.6 1999/12/19 00:21:50 billf Exp $ - * $DragonFly: src/games/adventure/crc.c,v 1.2 2003/06/17 04:25:22 dillon Exp $ + * $DragonFly: src/games/adventure/crc.c,v 1.3 2007/04/18 18:32:12 swildner Exp $ */ #include @@ -109,14 +109,14 @@ u_long crcval; u_int step; void -crc_start() +crc_start(void) { crcval = step = 0; } -u_long crc(ptr, nr) /* Process nr bytes at a time; ptr points to them */ -const char *ptr; -int nr; +/* Process nr bytes at a time; ptr points to them */ +u_long +crc(const char *ptr, int nr) { int i; const char *p; diff --git a/games/adventure/done.c b/games/adventure/done.c index 9285f9005a..212bff3f23 100644 --- a/games/adventure/done.c +++ b/games/adventure/done.c @@ -37,7 +37,7 @@ * * @(#)done.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/adventure/done.c,v 1.7 1999/12/19 00:21:50 billf Exp $ - * $DragonFly: src/games/adventure/done.c,v 1.3 2005/03/25 12:56:48 liamfoy Exp $ + * $DragonFly: src/games/adventure/done.c,v 1.4 2007/04/18 18:32:12 swildner Exp $ */ /* Re-coding of advent in C: termination routines */ @@ -46,8 +46,9 @@ #include #include "hdr.h" +/* sort of like 20000 */ int -score() /* sort of like 20000 */ +score(void) { int scor,i; mxscor=scor=0; for (i=50; i<=maxtrs; i++) @@ -83,9 +84,10 @@ score() /* sort of like 20000 */ return(scor); } +/* entry=1 means goto 13000 */ /* game is over */ +/* entry=2 means goto 20000 */ /* 3=19000 */ void -done(entry) /* entry=1 means goto 13000 */ /* game is over */ -int entry; /* entry=2 means goto 20000 */ /* 3=19000 */ +done(int entry) { int i,sc; if (entry==1) mspeak(1); if (entry==3) rspeak(136); @@ -112,9 +114,9 @@ int entry; /* entry=2 means goto 20000 */ /* 3=19000 */ } +/* label 90 */ void -die(entry) /* label 90 */ -int entry; +die(int entry) { int i; if (entry != 99) { rspeak(23); diff --git a/games/adventure/init.c b/games/adventure/init.c index 516a77be44..1b4e88db74 100644 --- a/games/adventure/init.c +++ b/games/adventure/init.c @@ -37,7 +37,7 @@ * * @(#)init.c 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/games/adventure/init.c,v 1.9.2.1 2001/03/05 11:43:11 kris Exp $ - * $DragonFly: src/games/adventure/init.c,v 1.3 2004/09/12 17:19:58 dillon Exp $ + * $DragonFly: src/games/adventure/init.c,v 1.4 2007/04/18 18:32:12 swildner Exp $ */ /* Re-coding of advent in C: data initialization */ @@ -55,16 +55,17 @@ int setbit[16] = {1,2,4,010,020,040,0100,0200,0400,01000,02000,04000, static void linkdata (void); +/* everything for 1st time run */ void -init() /* everything for 1st time run */ +init(void) { rdata(); /* read data from orig. file */ linkdata(); poof(); } -char *decr(a,b,c,d,e) -const char *a,*b,*c,*d,*e; +char * +decr(const char *a, const char *b, const char *c, const char *d, const char *e) { static char buf[6]; @@ -77,8 +78,9 @@ const char *a,*b,*c,*d,*e; return buf; } +/* secondary data manipulation */ static void -linkdata() /* secondary data manipulation */ +linkdata(void) { int i,j; /* array linkages */ @@ -197,20 +199,16 @@ linkdata() /* secondary data manipulation */ closng=panic=closed=scorng=FALSE; } - - +/* come here if he hits a del */ void -trapdel(sig) /* come here if he hits a del */ -int sig; +trapdel(int sig __unused) { - sig = 0; delhit = 1; /* main checks, treats as QUIT */ signal(2,trapdel); /* catch subsequent DELs */ } - void -startup() +startup(void) { demo=Start(); srandomdev(); diff --git a/games/adventure/io.c b/games/adventure/io.c index 6f921dc800..d5bb247a7a 100644 --- a/games/adventure/io.c +++ b/games/adventure/io.c @@ -37,7 +37,7 @@ * * @(#)io.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/adventure/io.c,v 1.8.2.1 2001/03/05 11:43:11 kris Exp $ - * $DragonFly: src/games/adventure/io.c,v 1.2 2003/06/17 04:25:22 dillon Exp $ + * $DragonFly: src/games/adventure/io.c,v 1.3 2007/04/18 18:32:12 swildner Exp $ */ /* Re-coding of advent in C: file i/o and user i/o */ @@ -61,9 +61,10 @@ static void rvoc (void); static void twrite (int); #endif +/* get command from user */ +/* no prompt, usually */ void -getin(wrd1,wrd2) /* get command from user */ -char **wrd1,**wrd2; /* no prompt, usually */ +getin(char **wrd1, char **wrd2) { char *s; static char wd1buf[MAXSTR],wd2buf[MAXSTR]; int first, numch; @@ -107,9 +108,9 @@ char **wrd1,**wrd2; /* no prompt, usually */ } } +/* confirm with rspeak */ int -yes(x,y,z) /* confirm with rspeak */ -int x,y,z; +yes(int x, int y, int z) { int result; int ch; @@ -132,9 +133,9 @@ int x,y,z; return(result); } +/* confirm with mspeak */ int -yesm(x,y,z) /* confirm with mspeak */ -int x,y,z; +yesm(int x, int y, int z) { int result; int ch; @@ -166,8 +167,9 @@ int outsw = 0; /* putting stuff to data file? */ const char iotape[] = "Ax3F'\003tt$8h\315qer*h\017nGKrX\207:!l"; const char *tape = iotape; /* pointer to encryption tape */ +/* next virtual char, bump adr */ static int -next() /* next virtual char, bump adr */ +next(void) { int ch; @@ -182,8 +184,9 @@ next() /* next virtual char, bump adr */ char breakch; /* tell which char ended rnum */ +/* "read" data from virtual file*/ void -rdata() /* "read" data from virtual file*/ +rdata(void) { int sect; char ch; @@ -253,8 +256,9 @@ rdata() /* "read" data from virtual file*/ char nbf[12]; +/* read initial location num */ static int -rnum() /* read initial location num */ +rnum(void) { char *s; tape = iotape; /* restart encryption tape */ for (s=nbf,*s=0;; s++) @@ -268,9 +272,9 @@ rnum() /* read initial location num */ char *seekhere; +/* read description-format msgs */ static void -rdesc(sect) /* read description-format msgs */ -int sect; +rdesc(int sect) { int locc; char *seekstart, *maystart; @@ -333,8 +337,9 @@ int sect; } +/* read travel table */ static void -rtrav() /* read travel table */ +rtrav(void) { int locc; struct travlist *t; char *s; @@ -392,9 +397,9 @@ rtrav() /* read travel table */ #ifdef DEBUG +/* travel options from this loc */ static void -twrite(loq) /* travel options from this loc */ -int loq; +twrite(int loq) { struct travlist *t; printf("If"); speak(<ext[loq]); @@ -414,7 +419,7 @@ int loq; #endif /* DEBUG */ static void -rvoc() +rvoc(void) { char *s; /* read the vocabulary */ int rv_index; char buf[6]; @@ -433,8 +438,9 @@ rvoc() } +/* initial object locations */ static void -rlocs() /* initial object locations */ +rlocs(void) { for (;;) { if ((obj=rnum())<0) break; plac[obj]=rnum(); /* initial loc for this obj */ @@ -444,16 +450,18 @@ rlocs() /* initial object locations */ } } +/* default verb messages */ static void -rdflt() /* default verb messages */ +rdflt(void) { for (;;) { if ((verb=rnum())<0) break; actspk[verb]=rnum(); } } +/* liquid assets &c: cond bits */ static void -rliq() /* liquid assets &c: cond bits */ +rliq(void) { int bitnum; for (;;) /* read new bit list */ { if ((bitnum=rnum())<0) break; @@ -465,7 +473,7 @@ rliq() /* liquid assets &c: cond bits */ } static void -rhints() +rhints(void) { int hintnum,i; hntmax=0; for (;;) @@ -478,22 +486,21 @@ rhints() void -rspeak(msg) -int msg; +rspeak(int msg) { if (msg!=0) speak(&rtext[msg]); } void -mspeak(msg) -int msg; +mspeak(int msg) { if (msg!=0) speak(&mtext[msg]); } +/* read, decrypt, and print a message (not ptext) */ +/* msg is a pointer to seek address and length of mess */ void -speak(msg) /* read, decrypt, and print a message (not ptext) */ -const struct text *msg;/* msg is a pointer to seek address and length of mess */ +speak(const struct text *msg) { char *s, nonfirst; @@ -516,10 +523,11 @@ const struct text *msg;/* msg is a pointer to seek address and length of mess */ } +/* read, decrypt an print a ptext message */ +/* msg is the number of all the p msgs for this place */ +/* assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c*/ void -pspeak(m,skip) /* read, decrypt an print a ptext message */ -int m; /* msg is the number of all the p msgs for this place */ -int skip; /* assumes object 1 doesn't have prop 1, obj 2 no prop 2 &c*/ +pspeak(int m, int skip) { char *s,nonfirst; char *numst, ps_save; diff --git a/games/adventure/save.c b/games/adventure/save.c index 93cefe2890..a6a48a4705 100644 --- a/games/adventure/save.c +++ b/games/adventure/save.c @@ -37,7 +37,7 @@ * * @(#)save.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/adventure/save.c,v 1.8 1999/12/19 00:21:51 billf Exp $ - * $DragonFly: src/games/adventure/save.c,v 1.2 2003/06/17 04:25:22 dillon Exp $ + * $DragonFly: src/games/adventure/save.c,v 1.3 2007/04/18 18:32:12 swildner Exp $ */ #include @@ -117,9 +117,10 @@ struct savestruct save_array[] = {NULL, 0} }; +/* Two passes on data: first to get checksum, second */ +/* to output the data using checksum to start random #s */ int -save(outfile) /* Two passes on data: first to get checksum, second */ -const char *outfile; /* to output the data using checksum to start random #s */ +save(const char *outfile) { FILE *out; struct savestruct *p; @@ -152,8 +153,7 @@ const char *outfile; /* to output the data using checksum to start random #s */ } int -restore(infile) -const char *infile; +restore(const char *infile) { FILE *in; struct savestruct *p; diff --git a/games/adventure/subr.c b/games/adventure/subr.c index d67d73e33c..a4276d9f6d 100644 --- a/games/adventure/subr.c +++ b/games/adventure/subr.c @@ -37,7 +37,7 @@ * * @(#)subr.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/adventure/subr.c,v 1.7.2.1 2001/03/05 11:43:11 kris Exp $ - * $DragonFly: src/games/adventure/subr.c,v 1.3 2005/03/25 12:56:48 liamfoy Exp $ + * $DragonFly: src/games/adventure/subr.c,v 1.4 2007/04/18 18:32:12 swildner Exp $ */ /* Re-coding of advent in C: subroutines from main */ @@ -57,43 +57,39 @@ static int trbridge (void); /* Statement functions */ int -toting(objj) -int objj; +toting(int objj) { if (place[objj] == -1) return(TRUE); else return(FALSE); } int -here(objj) -int objj; +here(int objj) { if (place[objj]==loc || toting(objj)) return(TRUE); else return(FALSE); } int -at(objj) -int objj; +at(int objj) { if (place[objj]==loc || fixed[objj]==loc) return(TRUE); else return (FALSE); } static int -liq2(pbotl) -int pbotl; +liq2(int pbotl) { return((1-pbotl)*water+(pbotl/2)*(water+oil)); } int -liq() +liq(void) { int i; i=prop[bottle]; if (i>-1-i) return(liq2(i)); else return(liq2(-1-i)); } +/* may want to clean this one up a bit */ int -liqloc(locc) /* may want to clean this one up a bit */ -int locc; +liqloc(int locc) { int i,j,l; i=cond[locc]/2; j=((i*2)%8)-5; @@ -103,36 +99,34 @@ int locc; } static int -bitset(l,n) -int l,n; +bitset(int l, int n) { if (cond[l] & setbit[n]) return(TRUE); return(FALSE); } int -forced(locc) -int locc; +forced(int locc) { if (cond[locc]==2) return(TRUE); return(FALSE); } int -dark() +dark(void) { if ((cond[loc]%2)==0 && (prop[lamp]==0 || !here(lamp))) return(TRUE); return(FALSE); } int -pct(n) -int n; +pct(int n) { if (ran(100)=43 && k<=50) spk=9; if (k==29||k==30) spk=9; @@ -414,15 +412,15 @@ badmove() /* 20 */ } int -bug(n) -int n; +bug(int n) { printf("Please tell jim@rand.org that fatal bug %d happened.\n",n); exit(1); } +/* 2600 &c */ void -checkhints() /* 2600 &c */ +checkhints(void) { int hint; for (hint=4; hint<=hntmax; hint++) { if (hinted[hint]) continue; @@ -460,8 +458,9 @@ checkhints() /* 2600 &c */ } +/* 9030 */ int -trsay() /* 9030 */ +trsay(void) { int i; if (*wd2!=0) strcpy(wd1,wd2); i=vocab(wd1,-1,0); @@ -475,8 +474,9 @@ trsay() /* 9030 */ } +/* 9010 */ int -trtake() /* 9010 */ +trtake(void) { if (toting(obj)) return(2011); /* 9010 */ spk=25; @@ -521,8 +521,9 @@ l9014: if ((obj==bird||obj==cage)&&prop[bird]!=0) } +/* 9021 */ static int -dropper() /* 9021 */ +dropper(void) { k=liq(); if (k==obj) obj=bottle; if (obj==bottle&&k!=0) place[k]=0; @@ -532,8 +533,9 @@ dropper() /* 9021 */ return(2012); } +/* 9020 */ int -trdrop() /* 9020 */ +trdrop(void) { if (toting(rod2)&&obj==rod&&!toting(rod)) obj=rod2; if (!toting(obj)) return(2011); @@ -579,8 +581,9 @@ trdrop() /* 9020 */ } +/* 9040 */ int -tropen() /* 9040 */ +tropen(void) { if (obj==clam||obj==oyster) { k=0; /* 9046 */ if (obj==oyster) k=1; @@ -635,8 +638,9 @@ tropen() /* 9040 */ } +/* 9120 */ int -trkill() /* 9120 */ +trkill(void) { int i; for (i=1; i<=5; i++) if (dloc[i]==loc&&dflag>=2) break; @@ -693,8 +697,9 @@ trkill() /* 9120 */ } +/* 9170: throw */ int -trtoss() /* 9170: throw */ +trtoss(void) { int i; if (toting(rod2)&&obj==rod&&!toting(rod)) obj=rod2; if (!toting(obj)) return(2011); @@ -748,8 +753,9 @@ trtoss() /* 9170: throw */ } +/* 9210 */ int -trfeed() /* 9210 */ +trfeed(void) { if (obj==bird) { spk=100; return(2011); @@ -787,8 +793,9 @@ trfeed() /* 9210 */ } +/* 9220 */ int -trfill() /* 9220 */ +trfill(void) { if (obj==vase) { spk=29; if (liqloc(loc)==0) spk=144; @@ -812,8 +819,9 @@ trfill() /* 9220 */ } +/* 10000 */ void -closing() /* 10000 */ +closing(void) { int i; prop[grate]=prop[fissur]=0; @@ -837,8 +845,9 @@ closing() /* 10000 */ } +/* 11000 */ void -caveclose() /* 11000 */ +caveclose(void) { int i; prop[bottle]=put(bottle,115,1); prop[plant]=put(plant,115,0); diff --git a/games/adventure/vocab.c b/games/adventure/vocab.c index 59978aa16b..66813f220f 100644 --- a/games/adventure/vocab.c +++ b/games/adventure/vocab.c @@ -37,7 +37,7 @@ * * @(#)vocab.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/adventure/vocab.c,v 1.9 1999/12/19 00:21:51 billf Exp $ - * $DragonFly: src/games/adventure/vocab.c,v 1.3 2005/03/25 12:56:48 liamfoy Exp $ + * $DragonFly: src/games/adventure/vocab.c,v 1.4 2007/04/18 18:32:12 swildner Exp $ */ /* Re-coding of advent in C: data structure routines */ @@ -49,14 +49,12 @@ #include "hdr.h" void -dstroy(object) -int object; +dstroy(int object) { move(object,0); } void -juggle(object) -int object; +juggle(int object) { int i,j; i=place[object]; @@ -67,8 +65,7 @@ int object; void -move(object,where) -int object,where; +move(int object, int where) { int from; if (object<=100) @@ -81,15 +78,13 @@ int object,where; int -put(object,where,pval) -int object,where,pval; +put(int object, int where, int pval) { move(object,where); return(-1-pval); } void -carry(object,where) -int object,where; +carry(int object, int where) { int temp; if (object<=100) @@ -107,8 +102,7 @@ int object,where; void -drop(object,where) -int object,where; +drop(int object, int where) { if (object>100) fixed[object-100]=where; else { if (place[object]== -1) holdng--; @@ -120,11 +114,11 @@ int object,where; } +/* look up or store a word */ +/* type is -2 for store, -1 for user word, >=0 for canned lookup*/ +/* value is used for storing only */ int -vocab(word,type,value) /* look up or store a word */ -const char *word; -int type; /* -2 for store, -1 for user word, >=0 for canned lookup*/ -int value; /* used for storing only */ +vocab(const char *word, int type, int value) { int adr; const char *s; char *t; diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c index 85d8aa92c2..7843992001 100644 --- a/games/adventure/wizard.c +++ b/games/adventure/wizard.c @@ -37,7 +37,7 @@ * * @(#)wizard.c 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/games/adventure/wizard.c,v 1.10.2.1 2001/03/05 11:43:11 kris Exp $ - * $DragonFly: src/games/adventure/wizard.c,v 1.2 2003/06/17 04:25:22 dillon Exp $ + * $DragonFly: src/games/adventure/wizard.c,v 1.3 2007/04/18 18:32:12 swildner Exp $ */ /* Re-coding of advent in C: privileged operations */ @@ -53,8 +53,7 @@ static int wizard (void); void -datime(d,t) -int *d,*t; +datime(int *d, int *t) { struct tm *tptr; time_t tvec; @@ -74,14 +73,14 @@ int *d,*t; char magic[6]; void -poof() +poof(void) { strcpy(magic, DECR(d,w,a,r,f)); latncy = 45; } int -Start() +Start(void) { int d,t,delay; datime(&d,&t); @@ -106,8 +105,9 @@ Start() return(FALSE); } +/* not as complex as advent/10 (for now) */ static int -wizard() /* not as complex as advent/10 (for now) */ +wizard(void) { char *word,*x; if (!yesm(16,0,7)) return(FALSE); @@ -122,7 +122,7 @@ wizard() /* not as complex as advent/10 (for now) */ } void -ciao() +ciao(void) { char *c; char fname[80]; @@ -144,8 +144,7 @@ ciao() int -ran(range) -int range; +ran(int range) { int i; diff --git a/games/bs/bs.c b/games/bs/bs.c index 1059739a30..7d10c038a2 100644 --- a/games/bs/bs.c +++ b/games/bs/bs.c @@ -7,7 +7,7 @@ * v2.0 featuring strict ANSI/POSIX conformance, November 1993. * * $FreeBSD: src/games/bs/bs.c,v 1.9 2000/02/21 03:07:31 billf Exp $ - * $DragonFly: src/games/bs/bs.c,v 1.6 2005/06/15 20:59:13 swildner Exp $ + * $DragonFly: src/games/bs/bs.c,v 1.7 2007/04/18 18:32:12 swildner Exp $ */ #include @@ -146,7 +146,9 @@ static int getcoord (int); int playagain (void); /* end the game, either normally or due to signal */ -static void uninitgame(void) { +static void +uninitgame(void) +{ clear(); refresh(); resetterm(); diff --git a/games/grdc/grdc.c b/games/grdc/grdc.c index 0250b682cc..ac37a340f8 100644 --- a/games/grdc/grdc.c +++ b/games/grdc/grdc.c @@ -9,7 +9,7 @@ * 03-23-04 added centering, scroll delay (cap) * * $FreeBSD: src/games/grdc/grdc.c,v 1.8.2.1 2001/10/02 11:51:49 ru Exp $ - * $DragonFly: src/games/grdc/grdc.c,v 1.5 2005/03/15 20:53:39 dillon Exp $ + * $DragonFly: src/games/grdc/grdc.c,v 1.6 2007/04/18 18:32:12 swildner Exp $ */ #include @@ -47,7 +47,8 @@ static void usage(void); static void draw_row(int, int); static void snooze(long int); -void sighndl(int signo) +void +sighndl(int signo) { sigtermed = signo; } diff --git a/games/hangman/prword.c b/games/hangman/prword.c index d0538d7be5..676385c34c 100644 --- a/games/hangman/prword.c +++ b/games/hangman/prword.c @@ -32,7 +32,7 @@ * * @(#)prword.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/hangman/prword.c,v 1.3 1999/12/10 03:23:00 billf Exp $ - * $DragonFly: src/games/hangman/prword.c,v 1.3 2005/02/13 18:57:30 cpressey Exp $ + * $DragonFly: src/games/hangman/prword.c,v 1.4 2007/04/18 18:32:12 swildner Exp $ */ #include "hangman.h" @@ -42,7 +42,7 @@ * Print out the current state of the word */ void -prword() +prword(void) { move(KNOWNY, KNOWNX + sizeof("Word: ")); addstr(Known); diff --git a/games/worms/worms.c b/games/worms/worms.c index 7a2b041c1e..4f5815427b 100644 --- a/games/worms/worms.c +++ b/games/worms/worms.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1980, 1993 The Regents of the University of California. All rights reserved. * @(#)worms.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/worms/worms.c,v 1.8.2.1 2000/12/04 10:36:17 alex Exp $ - * $DragonFly: src/games/worms/worms.c,v 1.4 2005/03/15 20:53:42 dillon Exp $ + * $DragonFly: src/games/worms/worms.c,v 1.5 2007/04/18 18:32:12 swildner Exp $ */ /* @@ -322,12 +322,14 @@ main(int argc, char **argv) } } -void onsig(__unused int signo) { +void +onsig(__unused int signo) +{ sig_caught = 1; } void -nomem() +nomem(void) { errx(1, "not enough memory."); } diff --git a/games/wump/wump.c b/games/wump/wump.c index 57317289e8..6285697a00 100644 --- a/games/wump/wump.c +++ b/games/wump/wump.c @@ -37,7 +37,7 @@ * @(#) Copyright (c) 1989, 1993 The Regents of the University of California. All rights reserved. * @(#)wump.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/wump/wump.c,v 1.13.2.1 2000/08/17 06:24:54 jhb Exp $ - * $DragonFly: src/games/wump/wump.c,v 1.5 2006/09/09 02:21:49 pavalos Exp $ + * $DragonFly: src/games/wump/wump.c,v 1.6 2007/04/18 18:32:12 swildner Exp $ */ /* @@ -242,7 +242,7 @@ quiver holds %d custom super anti-evil Wumpus arrows. Good luck.\n", } void -display_room_stats() +display_room_stats(void) { int i; @@ -272,7 +272,7 @@ display_room_stats() } int -take_action() +take_action(void) { /* * Do the action specified by the player, either 'm'ove, 's'hoot @@ -301,8 +301,7 @@ take_action() } int -move_to(room_number) - char *room_number; +move_to(char *room_number) { int i, just_moved_by_bats, next_room, tunnel_available; @@ -393,8 +392,7 @@ move_to(room_number) } int -shoot(room_list) - char *room_list; +shoot(char *room_list) { int chance, next, roomcnt; int j, arrow_location, wumplink, ok; @@ -506,7 +504,7 @@ The arrow is weakly shot and can go no further!\n"); } void -cave_init() +cave_init(void) { int i, j, k, wumplink; int delta; @@ -580,7 +578,7 @@ try_again: wumplink = (random() % room_num) + 1; } void -clear_things_in_cave() +clear_things_in_cave(void) { int i; @@ -593,7 +591,7 @@ clear_things_in_cave() } void -initialize_things_in_cave() +initialize_things_in_cave(void) { int i, loc; @@ -633,8 +631,7 @@ initialize_things_in_cave() } int -getans(prompt) - const char *prompt; +getans(const char *prompt) { char buf[20]; @@ -659,7 +656,7 @@ getans(prompt) } int -bats_nearby() +bats_nearby(void) { int i; @@ -671,7 +668,7 @@ bats_nearby() } int -pit_nearby() +pit_nearby(void) { int i; @@ -683,7 +680,7 @@ pit_nearby() } int -wump_nearby() +wump_nearby(void) { int i, j; @@ -700,14 +697,13 @@ wump_nearby() } void -move_wump() +move_wump(void) { wumpus_loc = cave[wumpus_loc].tunnel[random() % link_num]; } int -int_compare(va, vb) - const void *va, *vb; +int_compare(const void *va, const void *vb) { const int *a, *b; @@ -718,7 +714,7 @@ int_compare(va, vb) } void -instructions() +instructions(void) { const char *pager; pid_t pid; @@ -762,7 +758,7 @@ puff of greasy black smoke! (poof)\n"); } void -usage() +usage(void) { (void)fprintf(stderr, "usage: wump [-h] [-a arrows] [-b bats] [-p pits] [-r rooms] [-t tunnels]\n"); @@ -772,7 +768,7 @@ usage() /* messages */ void -wump_kill() +wump_kill(void) { (void)printf( "*ROAR* *chomp* *snurfle* *chomp*!\n\ @@ -784,7 +780,7 @@ passed out from the stench!\n"); } void -kill_wump() +kill_wump(void) { (void)printf( "*thwock!* *groan* *crash*\n\n\ @@ -796,7 +792,7 @@ mightiest adventurer at a single whiff!!\n"); } void -no_arrows() +no_arrows(void) { (void)printf( "\nYou turn and look at your quiver, and realize with a sinking feeling\n\ @@ -806,7 +802,7 @@ you, and with a mighty *ROAR* eats you alive!\n"); } void -shoot_self() +shoot_self(void) { (void)printf( "\n*Thwack!* A sudden piercing feeling informs you that the ricochet\n\ @@ -817,8 +813,7 @@ and immediately rushes to your side, not to help, alas, but to EAT YOU!\n\ } void -jump(where) - int where; +jump(int where) { (void)printf( "\nWith a jaunty step you enter the magic tunnel. As you do, you\n\ @@ -827,7 +822,7 @@ a very curious, warm sensation and find yourself in room %d!!\n", where); } void -pit_kill() +pit_kill(void) { (void)printf( "*AAAUUUUGGGGGHHHHHhhhhhhhhhh...*\n\ @@ -839,7 +834,7 @@ you can at least find out if Jules Verne was right...\n"); } void -pit_survive() +pit_survive(void) { (void)printf( "Without conscious thought you grab for the side of the cave and manage\n\ -- 2.41.0