diff options
47 files changed, 391 insertions, 628 deletions
diff --git a/games/battlestar/battlestar.c b/games/battlestar/battlestar.c index 83b7915d64f..cd94a6d14d9 100644 --- a/games/battlestar/battlestar.c +++ b/games/battlestar/battlestar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: battlestar.c,v 1.13 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: battlestar.c,v 1.14 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: battlestar.c,v 1.3 1995/03/21 15:06:47 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)battlestar.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: battlestar.c,v 1.13 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: battlestar.c,v 1.14 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -57,9 +57,7 @@ static char rcsid[] = "$OpenBSD: battlestar.c,v 1.13 2003/06/03 03:01:38 millert int main(int, char *[]); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { char mainbuf[LINELENGTH]; char *next; diff --git a/games/battlestar/com1.c b/games/battlestar/com1.c index ad7d9b41b2e..85b1970462a 100644 --- a/games/battlestar/com1.c +++ b/games/battlestar/com1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com1.c,v 1.12 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: com1.c,v 1.13 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: com1.c,v 1.3 1995/03/21 15:06:51 cgd Exp $ */ /* @@ -34,15 +34,14 @@ #if 0 static char sccsid[] = "@(#)com1.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: com1.c,v 1.12 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: com1.c,v 1.13 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" int -moveplayer(thataway, token) - int thataway, token; +moveplayer(int thataway, int token) { wordnumber++; if ((!notes[CANTMOVE] && !notes[LAUNCHED]) || @@ -66,10 +65,14 @@ moveplayer(thataway, token) return (1); } +/* + * Converts day to night and vice versa. + * Day objects are permanent. Night objects + * are added at dusk, and subtracted at dawn. + */ void -convert(tothis) /* Converts day to night and vice versa. */ - int tothis; /* Day objects are permanent. Night objects */ -{ /* are added at dusk, and subtracted at dawn.*/ +convert(int tothis) +{ const struct objs *p; unsigned int i, j; @@ -91,7 +94,7 @@ convert(tothis) /* Converts day to night and vice versa. */ } void -news() +news(void) { int n; int hurt; @@ -232,7 +235,7 @@ news() } void -crash() +crash(void) { int hurt1, hurt2; @@ -267,7 +270,7 @@ crash() } void -newlocation() +newlocation(void) { news(); if (beenthere[position] <= ROOMDESC) diff --git a/games/battlestar/com2.c b/games/battlestar/com2.c index f273292de82..b869e25c26c 100644 --- a/games/battlestar/com2.c +++ b/games/battlestar/com2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com2.c,v 1.14 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: com2.c,v 1.15 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: com2.c,v 1.3 1995/03/21 15:06:55 cgd Exp $ */ /* @@ -34,14 +34,14 @@ #if 0 static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: com2.c,v 1.14 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: com2.c,v 1.15 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" int -wearit() +wearit(void) { /* synonyms = {sheathe, sheath} */ int firstnumber, value; @@ -109,7 +109,7 @@ wearit() } int -put() +put(void) { /* synonyms = {buckle, strap, tie} */ if (inc_wordnumber(words[wordnumber], "what")) return(-1); @@ -128,13 +128,13 @@ put() } int -draw() +draw(void) { /* synonyms = {pull, carry} */ return (take(wear)); } int -use() +use(void) { if (inc_wordnumber(words[wordnumber], "what")) return(-1); @@ -178,7 +178,7 @@ use() } void -murder() +murder(void) { int n; @@ -278,7 +278,7 @@ murder() } void -ravage() +ravage(void) { if (inc_wordnumber(words[wordnumber], "whom")) return; @@ -335,7 +335,7 @@ ravage() } int -follow() +follow(void) { if (followfight == ourtime) { puts("The Dark Lord leaps away and runs down secret tunnels and corridors."); @@ -360,7 +360,7 @@ follow() } void -undress() +undress(void) { if (inc_wordnumber(words[wordnumber], "whom")) return; diff --git a/games/battlestar/com3.c b/games/battlestar/com3.c index a42a0ab667d..ea5e8c56141 100644 --- a/games/battlestar/com3.c +++ b/games/battlestar/com3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com3.c,v 1.11 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: com3.c,v 1.12 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: com3.c,v 1.3 1995/03/21 15:07:00 cgd Exp $ */ /* @@ -34,14 +34,14 @@ #if 0 static char sccsid[] = "@(#)com3.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: com3.c,v 1.11 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: com3.c,v 1.12 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" void -dig() +dig(void) { if (TestBit(inven, SHOVEL)) { puts("OK"); @@ -65,7 +65,7 @@ dig() } int -jump() +jump(void) { int n; @@ -105,7 +105,7 @@ jump() } void -bury() +bury(void) { int value; @@ -168,7 +168,7 @@ bury() } void -drink() +drink(void) { int n; @@ -188,7 +188,7 @@ drink() } int -shoot() +shoot(void) { int firstnumber, value; diff --git a/games/battlestar/com4.c b/games/battlestar/com4.c index d375dce3d83..18d489f4341 100644 --- a/games/battlestar/com4.c +++ b/games/battlestar/com4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com4.c,v 1.12 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: com4.c,v 1.13 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: com4.c,v 1.3 1995/03/21 15:07:04 cgd Exp $ */ /* @@ -34,15 +34,14 @@ #if 0 static char sccsid[] = "@(#)com4.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: com4.c,v 1.12 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: com4.c,v 1.13 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" int -take(from) - unsigned int from[]; +take(unsigned int from[]) { int firstnumber, heavy, bulky, value; @@ -187,8 +186,7 @@ take(from) } int -throw(name) - const char *name; +throw(const char *name) { unsigned int n; int deposit = 0; @@ -267,8 +265,7 @@ throw(name) } int -drop(name) - const char *name; +drop(const char *name) { int firstnumber, value; @@ -346,21 +343,21 @@ drop(name) } int -takeoff() +takeoff(void) { wordnumber = take(wear); return (drop("Dropped")); } int -puton() +puton(void) { wordnumber = take(location[position].objects); return (wearit()); } int -eat() +eat(void) { int firstnumber, value; diff --git a/games/battlestar/com5.c b/games/battlestar/com5.c index e754e1a93a4..d78cead9523 100644 --- a/games/battlestar/com5.c +++ b/games/battlestar/com5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com5.c,v 1.10 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: com5.c,v 1.11 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: com5.c,v 1.3 1995/03/21 15:07:07 cgd Exp $ */ /* @@ -34,14 +34,14 @@ #if 0 static char sccsid[] = "@(#)com5.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: com5.c,v 1.10 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: com5.c,v 1.11 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" void -kiss() +kiss(void) { if (inc_wordnumber(words[wordnumber], "whom")) return; @@ -93,7 +93,7 @@ kiss() } void -love() +love(void) { int n; @@ -159,7 +159,7 @@ love() } int -zzz() +zzz(void) { int oldtime; int n; @@ -213,7 +213,7 @@ zzz() } void -chime() +chime(void) { if ((ourtime / CYCLE + 1) % 2 && OUTSIDE) switch ((ourtime % CYCLE) / (CYCLE / 7)) { @@ -268,7 +268,7 @@ chime() } int -give() +give(void) { int obj = -1, result = -1, person = 0, firstnumber, last1, last2; diff --git a/games/battlestar/com6.c b/games/battlestar/com6.c index 7b06058c100..6e834acd488 100644 --- a/games/battlestar/com6.c +++ b/games/battlestar/com6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com6.c,v 1.17 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: com6.c,v 1.18 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: com6.c,v 1.5 1995/04/27 21:30:23 mycroft Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)com6.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: com6.c,v 1.17 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: com6.c,v 1.18 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -42,7 +42,7 @@ static char rcsid[] = "$OpenBSD: com6.c,v 1.17 2003/06/03 03:01:38 millert Exp $ #include "pathnames.h" int -launch() +launch(void) { if (TestBit(location[position].objects, VIPER) && !notes[CANTLAUNCH]) { if (fuel > 4) { @@ -62,7 +62,7 @@ launch() } int -land() +land(void) { if (notes[LAUNCHED] && TestBit(location[position].objects, LAND) && location[position].down) { @@ -78,17 +78,17 @@ land() return (0); } +/* endgame */ void -die(sigraised) - int sigraised; -{ /* endgame */ +die(int sigraised) +{ printf("bye.\nYour rating was %s.\n", rate()); post(' '); exit(0); } void -live() +live(void) { puts("\nYou win!"); post('!'); @@ -98,15 +98,14 @@ live() static FILE *score_fp; void -open_score_file() +open_score_file(void) { if ((score_fp = fopen(_PATH_SCORE, "a")) == NULL) warn("can't append to high scores file (%s)", _PATH_SCORE); } void -post(ch) - char ch; +post(char ch) { time_t tv; char *date; @@ -133,7 +132,7 @@ post(ch) } const char * -rate() +rate(void) { int score; @@ -172,7 +171,7 @@ rate() } int -drive() +drive(void) { if (TestBit(location[position].objects, CAR)) { puts("You hop in the car and turn the key. There is a perceptible grating noise,"); @@ -189,7 +188,7 @@ drive() } int -ride() +ride(void) { if (TestBit(location[position].objects, HORSE)) { puts("You climb onto the stallion and kick it in the guts. The stupid steed launches"); @@ -213,7 +212,7 @@ ride() } void -light() +light(void) { /* synonyms = {strike, smoke} */ if (TestBit(inven, MATCHES) && matchcount) { puts("Your match splutters to life."); @@ -229,7 +228,7 @@ light() } void -dooropen() +dooropen(void) { /* synonyms = {open, unlock} */ wordnumber++; if (wordnumber <= wordcount && wordtype[wordnumber] == NOUNS diff --git a/games/battlestar/com7.c b/games/battlestar/com7.c index f39cebd1191..fab9bcb5fbb 100644 --- a/games/battlestar/com7.c +++ b/games/battlestar/com7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com7.c,v 1.10 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: com7.c,v 1.11 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: com7.c,v 1.3 1995/03/21 15:07:12 cgd Exp $ */ /* @@ -34,15 +34,14 @@ #if 0 static char sccsid[] = "@(#)com7.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: com7.c,v 1.10 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: com7.c,v 1.11 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" int -fight(enemy, strength) - int enemy, strength; +fight(int enemy, int strength) { int lifeline = 0; int hurt; diff --git a/games/battlestar/cypher.c b/games/battlestar/cypher.c index f4fa2c5086a..18c35401b71 100644 --- a/games/battlestar/cypher.c +++ b/games/battlestar/cypher.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cypher.c,v 1.14 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: cypher.c,v 1.15 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: cypher.c,v 1.3 1995/03/21 15:07:15 cgd Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)cypher.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: cypher.c,v 1.14 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: cypher.c,v 1.15 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -47,7 +47,7 @@ static void verb_with_all(unsigned int *, int, int (*)(void), const char *); * 1 if there are more commands remaining on the current input line */ int -cypher() +cypher(void) { int n; int junk; @@ -469,8 +469,7 @@ cypher() } int -inc_wordnumber(v, adv) - const char *v, *adv; +inc_wordnumber(const char *v, const char *adv) { wordnumber++; if (wordnumber >= wordcount) { @@ -481,11 +480,8 @@ inc_wordnumber(v, adv) } static void -verb_with_all(testarray, objflg, verbfunc, verbname) - unsigned int *testarray; - int objflg; - int (*verbfunc)(void); - const char *verbname; +verb_with_all(unsigned int *testarray, int objflg, int (*verbfunc)(void), + const char *verbname) { int things, n; diff --git a/games/battlestar/fly.c b/games/battlestar/fly.c index 2a0d83b4b78..96d1e4aba51 100644 --- a/games/battlestar/fly.c +++ b/games/battlestar/fly.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fly.c,v 1.11 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: fly.c,v 1.12 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: fly.c,v 1.3 1995/03/21 15:07:28 cgd Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)fly.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: fly.c,v 1.11 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: fly.c,v 1.12 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -62,8 +62,7 @@ static void succumb(int); static void target(void); static void -succumb(sigraised) - int sigraised; +succumb(int sigraised) { if (oldsig == SIG_DFL) { endfly(); @@ -76,7 +75,7 @@ succumb(sigraised) } int -visual() +visual(void) { destroyed = 0; if (initscr() == NULL) { @@ -183,7 +182,7 @@ visual() } static void -screen() +screen(void) { int r, c, n; int i; @@ -200,7 +199,7 @@ screen() } static void -target() +target(void) { int n; @@ -213,7 +212,7 @@ target() } static void -notarget() +notarget(void) { int n; @@ -226,7 +225,7 @@ notarget() } static void -blast() +blast(void) { int n; @@ -248,8 +247,7 @@ blast() } static void -moveenemy(sigraised) - int sigraised; +moveenemy(int sigraised) { double d; int oldr, oldc; @@ -288,7 +286,7 @@ moveenemy(sigraised) } static void -endfly() +endfly(void) { alarm(0); signal(SIGALRM, SIG_DFL); diff --git a/games/battlestar/getcom.c b/games/battlestar/getcom.c index e46ff8c7375..e7bfb98e2b4 100644 --- a/games/battlestar/getcom.c +++ b/games/battlestar/getcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: getcom.c,v 1.11 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: getcom.c,v 1.12 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: getcom.c,v 1.3 1995/03/21 15:07:30 cgd Exp $ */ /* @@ -34,17 +34,14 @@ #if 0 static char sccsid[] = "@(#)getcom.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: getcom.c,v 1.11 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: getcom.c,v 1.12 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" char * -getcom(buf, size, prompt, error) - char *buf; - int size; - const char *prompt, *error; +getcom(char *buf, int size, const char *prompt, const char *error) { for (;;) { fputs(prompt, stdout); @@ -76,9 +73,7 @@ getcom(buf, size, prompt, error) * and leaves it unchanged if flag = 0 */ char * -getword(buf1, buf2, flag) - char *buf1, *buf2; - int flag; +getword(char *buf1, char *buf2, int flag) { int cnt; diff --git a/games/battlestar/init.c b/games/battlestar/init.c index 588295a2d17..9e8c073adcc 100644 --- a/games/battlestar/init.c +++ b/games/battlestar/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.11 2003/09/26 18:58:01 tedu Exp $ */ +/* $OpenBSD: init.c,v 1.12 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: init.c,v 1.4 1995/03/21 15:07:35 cgd Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)init.c 8.4 (Berkeley) 4/30/95"; #else -static char rcsid[] = "$OpenBSD: init.c,v 1.11 2003/09/26 18:58:01 tedu Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.12 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -45,8 +45,7 @@ static const char *getutmp(void); static int wizard(const char *); void -initialize(filename) - const char *filename; +initialize(const char *filename) { const struct objs *p; char *savefile; @@ -80,7 +79,7 @@ initialize(filename) } static const char * -getutmp() +getutmp(void) { struct passwd *ptr; @@ -111,8 +110,7 @@ static const char *const badguys[] = { }; static int -wizard(username) - const char *username; +wizard(const char *username) { int flag; @@ -122,8 +120,7 @@ wizard(username) } static int -checkout(username) - const char *username; +checkout(const char *username) { const char *const *ptr; diff --git a/games/battlestar/misc.c b/games/battlestar/misc.c index 24c30a8d3aa..2f9eb4a6f38 100644 --- a/games/battlestar/misc.c +++ b/games/battlestar/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.6 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: misc.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: misc.c,v 1.3 1995/03/21 15:07:37 cgd Exp $ */ /* @@ -34,16 +34,15 @@ #if 0 static char sccsid[] = "@(#)misc.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: misc.c,v 1.6 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: misc.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" +/* for beenthere, injuries */ int -card(array, size) /* for beenthere, injuries */ - const char *array; - int size; +card(const char *array, int size) { const char *end = array + size; int i = 0; @@ -55,8 +54,7 @@ card(array, size) /* for beenthere, injuries */ } int -ucard(array) - const unsigned int *array; +ucard(const unsigned int *array) { int j = 0, n; diff --git a/games/battlestar/parse.c b/games/battlestar/parse.c index f12aa299aae..399216e24b1 100644 --- a/games/battlestar/parse.c +++ b/games/battlestar/parse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.c,v 1.12 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: parse.c,v 1.13 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: parse.c,v 1.3 1995/03/21 15:07:48 cgd Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)parse.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: parse.c,v 1.12 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: parse.c,v 1.13 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -51,7 +51,7 @@ static struct wlist *lookup(const char *); struct wlist *hashtab[HASHSIZE]; void -wordinit() +wordinit(void) { struct wlist *w; @@ -60,8 +60,7 @@ wordinit() } static int -hash(s) - const char *s; +hash(const char *s) { int hashval = 0; @@ -74,8 +73,7 @@ hash(s) } static struct wlist * -lookup(s) - const char *s; +lookup(const char *s) { struct wlist *wp; @@ -86,8 +84,7 @@ lookup(s) } static void -install(wp) - struct wlist *wp; +install(struct wlist *wp) { int hashval; @@ -100,7 +97,7 @@ install(wp) } void -parse() +parse(void) { struct wlist *wp; int n; diff --git a/games/battlestar/room.c b/games/battlestar/room.c index ec04e2752ff..961a043f503 100644 --- a/games/battlestar/room.c +++ b/games/battlestar/room.c @@ -1,4 +1,4 @@ -/* $OpenBSD: room.c,v 1.7 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: room.c,v 1.8 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: room.c,v 1.3 1995/03/21 15:07:54 cgd Exp $ */ /* @@ -34,14 +34,14 @@ #if 0 static char sccsid[] = "@(#)room.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: room.c,v 1.7 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: room.c,v 1.8 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" void -writedes() +writedes(void) { int compass; const char *p; @@ -65,7 +65,7 @@ writedes() } void -printobjs() +printobjs(void) { unsigned int *p = location[position].objects; int n; @@ -77,8 +77,7 @@ printobjs() } void -whichway(here) - struct room here; +whichway(struct room here) { switch (direction) { @@ -114,9 +113,7 @@ whichway(here) } const char * -truedirec(way, option) - int way; - char option; +truedirec(int way, char option) { switch (way) { @@ -175,8 +172,7 @@ truedirec(way, option) } void -newway(thisway) - int thisway; +newway(int thisway) { switch (direction) { diff --git a/games/battlestar/save.c b/games/battlestar/save.c index 6b77b48158f..e2f49ed413c 100644 --- a/games/battlestar/save.c +++ b/games/battlestar/save.c @@ -1,4 +1,4 @@ -/* $OpenBSD: save.c,v 1.9 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: save.c,v 1.10 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: save.c,v 1.3 1995/03/21 15:07:57 cgd Exp $ */ /* @@ -34,15 +34,14 @@ #if 0 static char sccsid[] = "@(#)save.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: save.c,v 1.9 2003/06/03 03:01:38 millert Exp $"; +static char rcsid[] = "$OpenBSD: save.c,v 1.10 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ #include "extern.h" void -restore(filename) - const char *filename; +restore(const char *filename) { int n; int tmp; @@ -93,8 +92,7 @@ restore(filename) } void -save(filename) - const char *filename; +save(const char *filename) { int n; int tmp; @@ -156,9 +154,7 @@ save(filename) * with malloc(3). */ char * -save_file_name(filename, len) - const char *filename; - size_t len; +save_file_name(const char *filename, size_t len) { char *home; char *newname; diff --git a/games/boggle/boggle/bog.c b/games/boggle/boggle/bog.c index e522f05e097..24ca7ff76c1 100644 --- a/games/boggle/boggle/bog.c +++ b/games/boggle/boggle/bog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bog.c,v 1.13 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: bog.c,v 1.14 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: bog.c,v 1.5 1995/04/24 12:22:32 cgd Exp $ */ /*- @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)bog.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: bog.c,v 1.13 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: bog.c,v 1.14 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -121,9 +121,7 @@ int selfuse; int tlimit; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch, done, i; char *bspec, *p, *seed; @@ -255,8 +253,7 @@ main(argc, argv) * Return a pointer to a legal word or a null pointer when EOF is reached */ char * -batchword(fp) - FILE *fp; +batchword(FILE *fp) { int *p, *q; char *w; @@ -284,7 +281,7 @@ batchword(fp) * Keep track of the running stats */ void -playgame() +playgame(void) { int i, *p, *q; time_t t; @@ -406,9 +403,7 @@ timesup: ; * Return 1 on success, -1 on failure */ int -checkword(word, prev, path) - char *word; - int prev, *path; +checkword(char *word, int prev, int *path) { char *p, *q; int i, *lm; @@ -489,8 +484,7 @@ checkword(word, prev, path) * the current board */ int -validword(word) - char *word; +validword(char *word) { int j; char *q, *w; @@ -524,7 +518,7 @@ validword(word) * Assume both the dictionary and the player's words are already sorted */ void -checkdict() +checkdict(void) { char *p, **pw, *w; int i; @@ -602,8 +596,7 @@ checkdict() * in ascending cube order, oth. make a random board */ void -newgame(b) - char *b; +newgame(char *b) { int i, p, q; char *tmp; @@ -672,14 +665,13 @@ newgame(b) } int -compar(p, q) - const void *p, *q; +compar(const void *p, const void *q) { return (strcmp(*(char **)p, *(char **)q)); } void -usage() +usage(void) { (void) fprintf(stderr, "usage: bog [-bd] [-s#] [-t#] [-w#] [+[+]] [boardspec]\n"); diff --git a/games/boggle/boggle/help.c b/games/boggle/boggle/help.c index 490496fd31a..9b11fc0d502 100644 --- a/games/boggle/boggle/help.c +++ b/games/boggle/boggle/help.c @@ -1,4 +1,4 @@ -/* $OpenBSD: help.c,v 1.3 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: help.c,v 1.4 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: help.c,v 1.2 1995/03/21 12:14:38 cgd Exp $ */ /*- @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)help.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: help.c,v 1.3 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: help.c,v 1.4 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -48,7 +48,7 @@ static char rcsid[] = "$OpenBSD: help.c,v 1.3 2003/06/03 03:01:39 millert Exp $" #include "extern.h" int -help() +help(void) { extern int nlines; int eof, i; diff --git a/games/boggle/boggle/mach.c b/games/boggle/boggle/mach.c index 6431fc6501a..dd4f59e75a8 100644 --- a/games/boggle/boggle/mach.c +++ b/games/boggle/boggle/mach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mach.c,v 1.7 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: mach.c,v 1.8 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: mach.c,v 1.5 1995/04/28 22:28:48 mycroft Exp $ */ /*- @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)mach.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: mach.c,v 1.7 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: mach.c,v 1.8 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -83,8 +83,7 @@ static void winch_catcher(int); * This is called once, when the program starts */ int -setup(seed) - char *seed; +setup(char *seed) { if (tty_setup() < 0) return(-1); @@ -101,7 +100,7 @@ setup(seed) * This is called once, just before the program terminates */ void -cleanup() +cleanup(void) { tty_cleanup(); } @@ -111,7 +110,7 @@ cleanup() * stats */ void -results() +results(void) { int col, row; int denom1, denom2; @@ -141,17 +140,13 @@ results() } static void -prword(base, indx) - char *base[]; - int indx; +prword(char *base[], int indx) { printw("%s", base[indx]); } static int -prwidth(base, indx) - char *base[]; - int indx; +prwidth(char *base[], int indx) { return (strlen(base[indx])); } @@ -162,8 +157,7 @@ prwidth(base, indx) * - doesn't accept words longer than MAXWORDLEN or containing caps */ char * -getline(q) - char *q; +getline(char *q) { int ch, done; char *p; @@ -257,21 +251,20 @@ getline(q) } int -inputch() +inputch(void) { return (getch() & 0177); } void -redraw() +redraw(void) { clearok(stdscr, 1); refresh(); } void -flushin(fp) - FILE *fp; +flushin(FILE *fp) { (void) tcflush(fileno(fp), TCIFLUSH); @@ -283,7 +276,7 @@ static int gone; * Stop the game timer */ void -stoptime() +stoptime(void) { extern time_t start_t; time_t t; @@ -296,7 +289,7 @@ stoptime() * Restart the game timer */ void -starttime() +starttime(void) { extern time_t start_t; time_t t; @@ -313,7 +306,7 @@ starttime() * There is no check for exceeding COLS */ void -startwords() +startwords(void) { crow = LIST_LINE; ccol = LIST_COL; @@ -330,8 +323,7 @@ startwords() * to start the next column */ void -addword(w) - char *w; +addword(char *w) { int n; @@ -354,7 +346,7 @@ addword(w) * The current word is unacceptable so erase it */ void -badword() +badword(void) { move(crow, ccol); @@ -367,8 +359,7 @@ badword() * No check for wild arg */ void -showword(n) - int n; +showword(int n) { int col, row; @@ -396,7 +387,7 @@ showword(n) * Note: this function knows about the format of the board */ void -findword() +findword(void) { int c, col, found, i, r, row; char buf[MAXWORDLEN + 1]; @@ -471,9 +462,7 @@ findword() * Display a string at the current cursor position for the given number of secs */ void -showstr(str, delaysecs) - char *str; - int delaysecs; +showstr(char *str, int delaysecs) { addstr(str); refresh(); @@ -484,8 +473,7 @@ showstr(str, delaysecs) } void -putstr(s) - char *s; +putstr(char *s) { addstr(s); } @@ -494,8 +482,7 @@ putstr(s) * Get a valid word and put it in the buffer */ void -getword(q) - char *q; +getword(char *q) { int ch, col, done, i, row; char *p; @@ -552,15 +539,13 @@ getword(q) } void -showboard(b) - char *b; +showboard(char *b) { tty_showboard(b); } void -prompt(mesg) - char *mesg; +prompt(char *mesg) { move(PROMPT_LINE, PROMPT_COL); printw("%s", mesg); @@ -569,7 +554,7 @@ prompt(mesg) } static int -tty_setup() +tty_setup(void) { initscr(); raw(); @@ -590,8 +575,7 @@ tty_setup() } static void -stop_catcher(signo) - int signo; +stop_catcher(int signo) { sigset_t sigset, osigset; @@ -611,8 +595,7 @@ stop_catcher(signo) } static void -cont_catcher(signo) - int signo; +cont_catcher(int signo) { noecho(); raw(); @@ -627,8 +610,7 @@ cont_catcher(signo) * It would mean reformatting the entire display */ static void -winch_catcher(signo) - int signo; +winch_catcher(int signo) { struct winsize win; @@ -641,7 +623,7 @@ winch_catcher(signo) } static void -tty_cleanup() +tty_cleanup(void) { move(nlines - 1, 0); refresh(); @@ -651,8 +633,7 @@ tty_cleanup() } static void -tty_showboard(b) - char *b; +tty_showboard(char *b) { int i, line; diff --git a/games/boggle/boggle/prtable.c b/games/boggle/boggle/prtable.c index 15de656dcc3..a0bcd4279c4 100644 --- a/games/boggle/boggle/prtable.c +++ b/games/boggle/boggle/prtable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prtable.c,v 1.8 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: prtable.c,v 1.9 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: prtable.c,v 1.2 1995/03/21 12:14:42 cgd Exp $ */ /*- @@ -59,11 +59,8 @@ static int get_maxlen(char *[], int, int (*)(char **, int)); * an index */ void -prtable(base, num, d_cols, width, prentry, length) - char *base[]; - int num, d_cols, width; - void (*prentry)(char *[], int); - int (*length)(char *[], int); +prtable(char *base[], int num, int d_cols, int width, + void (*prentry)(char *[], int), int (*length)(char *[], int)) { int c, j; int a, b, cols, loc, maxlen, nrows, z; @@ -110,10 +107,7 @@ prtable(base, num, d_cols, width, prentry, length) } static int -get_maxlen(base, num, length) - char *base[]; - int num; - int (*length)(char **, int); +get_maxlen(char *base[], int num, int (*length)(char **, int)) { int i, len, max; diff --git a/games/boggle/boggle/timer.c b/games/boggle/boggle/timer.c index 4452ee73ca1..185ecec1cc3 100644 --- a/games/boggle/boggle/timer.c +++ b/games/boggle/boggle/timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timer.c,v 1.6 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: timer.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: timer.c,v 1.3 1995/04/24 12:22:45 cgd Exp $ */ /*- @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)timer.c 8.2 (Berkeley) 2/22/94"; #else -static char rcsid[] = "$OpenBSD: timer.c,v 1.6 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: timer.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -62,7 +62,7 @@ static int waitch(long); * Leave the cursor where it was initially */ int -timerch() +timerch(void) { extern int tlimit; extern time_t start_t; @@ -97,8 +97,7 @@ timerch() * Returns 1 if input is ready, 0 oth. */ static int -waitch(delay) - long delay; +waitch(long delay) { fd_set fdbits; struct timeval duration; @@ -111,8 +110,7 @@ waitch(delay) } void -delay(tenths) - int tenths; +delay(int tenths) { struct timeval duration; diff --git a/games/boggle/boggle/word.c b/games/boggle/boggle/word.c index 8762f415166..9ab9627dca8 100644 --- a/games/boggle/boggle/word.c +++ b/games/boggle/boggle/word.c @@ -1,4 +1,4 @@ -/* $OpenBSD: word.c,v 1.4 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: word.c,v 1.5 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: word.c,v 1.2 1995/03/21 12:14:45 cgd Exp $ */ /*- @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)word.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: word.c,v 1.4 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: word.c,v 1.5 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -62,8 +62,7 @@ static int first = 1, lastch = 0; * NULL on end-of-file */ char * -nextword(fp) - FILE *fp; +nextword(FILE *fp) { extern int wordlen; int ch, pcount; @@ -106,10 +105,7 @@ nextword(fp) * Reset the state of nextword() and do the fseek() */ long -dictseek(fp, offset, ptrname) - FILE *fp; - long offset; - int ptrname; +dictseek(FILE *fp, long offset, int ptrname) { if (fp == NULL) { if ((sp = dictspace + offset) >= dictend) @@ -122,8 +118,7 @@ dictseek(fp, offset, ptrname) } FILE * -opendict(dict) - char *dict; +opendict(char *dict) { FILE *fp; @@ -136,8 +131,7 @@ opendict(dict) * Load the given dictionary and initialize the pointers */ int -loaddict(fp) - FILE *fp; +loaddict(FILE *fp) { struct stat statb; long n; @@ -183,8 +177,7 @@ loaddict(fp) * is made for lines that are too long */ int -loadindex(indexfile) - char *indexfile; +loadindex(char *indexfile) { int i, j; char buf[BUFSIZ]; diff --git a/games/boggle/mkdict/mkdict.c b/games/boggle/mkdict/mkdict.c index ed42b53dd23..d3e2a9c94e2 100644 --- a/games/boggle/mkdict/mkdict.c +++ b/games/boggle/mkdict/mkdict.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkdict.c,v 1.5 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: mkdict.c,v 1.6 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: mkdict.c,v 1.2 1995/03/21 12:14:49 cgd Exp $ */ /*- @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mkdict.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: mkdict.c,v 1.5 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: mkdict.c,v 1.6 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -64,9 +64,7 @@ static char rcsid[] = "$OpenBSD: mkdict.c,v 1.5 2003/06/03 03:01:39 millert Exp #include "bog.h" int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { char *p, *q; int ch, common, n, nwords; diff --git a/games/boggle/mkindex/mkindex.c b/games/boggle/mkindex/mkindex.c index f88a6faa5d6..bc1c66819a6 100644 --- a/games/boggle/mkindex/mkindex.c +++ b/games/boggle/mkindex/mkindex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkindex.c,v 1.6 2003/07/10 00:03:01 david Exp $ */ +/* $OpenBSD: mkindex.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: mkindex.c,v 1.2 1995/03/21 12:14:52 cgd Exp $ */ /*- @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mkindex.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: mkindex.c,v 1.6 2003/07/10 00:03:01 david Exp $"; +static char rcsid[] = "$OpenBSD: mkindex.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -55,9 +55,7 @@ static char rcsid[] = "$OpenBSD: mkindex.c,v 1.6 2003/07/10 00:03:01 david Exp $ char *nextword(FILE *, char *, int *, int *); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int clen, rlen, prev; long off, start; @@ -85,10 +83,7 @@ main(argc, argv) * rlen to the strlen() of the real word */ char * -nextword(fp, buffer, clen, rlen) - FILE *fp; - char *buffer; - int *clen, *rlen; +nextword(FILE *fp, char *buffer, int *clen, int *rlen) { int ch, pcount; char *p, *q; diff --git a/games/cribbage/cards.c b/games/cribbage/cards.c index c79f1be53d5..ac59b222332 100644 --- a/games/cribbage/cards.c +++ b/games/cribbage/cards.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cards.c,v 1.3 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: cards.c,v 1.4 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: cards.c,v 1.3 1995/03/21 15:08:41 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: cards.c,v 1.3 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: cards.c,v 1.4 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -51,8 +51,7 @@ static char rcsid[] = "$OpenBSD: cards.c,v 1.3 2003/06/03 03:01:39 millert Exp $ * Initialize a deck of cards to contain one of each type. */ void -makedeck(d) - CARD d[]; +makedeck(CARD d[]) { int i, j, k; @@ -72,8 +71,7 @@ makedeck(d) * see Knuth, vol. 2, page 125. */ void -shuffle(d) - CARD d[]; +shuffle(CARD d[]) { int j, k; CARD c; @@ -90,8 +88,7 @@ shuffle(d) * return true if the two cards are equal... */ int -eq(a, b) - CARD a, b; +eq(CARD a, CARD b) { return ((a.rank == b.rank) && (a.suit == b.suit)); } @@ -100,9 +97,7 @@ eq(a, b) * isone returns TRUE if a is in the set of cards b */ int -isone(a, b, n) - CARD a, b[]; - int n; +isone(CARD a, CARD b[], int n) { int i; @@ -116,9 +111,7 @@ isone(a, b, n) * remove the card a from the deck d of n cards */ void -cremove(a, d, n) - CARD a, d[]; - int n; +cremove(CARD a, CARD d[], int n) { int i, j; @@ -134,9 +127,7 @@ cremove(a, d, n) * Sort a hand of n cards */ void -sorthand(h, n) - CARD h[]; - int n; +sorthand(CARD h[], int n) { CARD *cp, *endp; CARD c; diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c index 4653165aa4d..5a41a47bc6b 100644 --- a/games/cribbage/crib.c +++ b/games/cribbage/crib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crib.c,v 1.12 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: crib.c,v 1.13 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: crib.c,v 1.7 1997/07/10 06:47:29 mikel Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)crib.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: crib.c,v 1.12 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: crib.c,v 1.13 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -58,9 +58,7 @@ static char rcsid[] = "$OpenBSD: crib.c,v 1.12 2003/06/03 03:01:39 millert Exp $ #include "pathnames.h" int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { bool playing; int ch; @@ -159,7 +157,7 @@ main(argc, argv) * Print out the initial board on the screen */ void -makeboard() +makeboard(void) { mvaddstr(SCORE_Y + 0, SCORE_X, "+---------------------------------------+"); @@ -187,7 +185,7 @@ makeboard() * Print out the current game score */ void -gamescore() +gamescore(void) { if (pgames || cgames) { mvprintw(SCORE_Y + 1, SCORE_X + 28, "Games: %3d", pgames); @@ -203,7 +201,7 @@ gamescore() * player what card to turn. We do a random one, anyway. */ void -game() +game(void) { int i, j; bool flag; @@ -307,8 +305,7 @@ game() * Do up one hand of the game */ int -playhand(mycrib) - bool mycrib; +playhand(bool mycrib) { int deckpos; @@ -339,8 +336,7 @@ playhand(mycrib) * deal cards to both players from deck */ int -deal(mycrib) - bool mycrib; +deal(bool mycrib) { int i, j; @@ -362,8 +358,7 @@ deal(mycrib) * Note: we call cdiscard() after prining first message so player doesn't wait */ void -discard(mycrib) - bool mycrib; +discard(bool mycrib) { char *prompt; CARD crd; @@ -392,9 +387,7 @@ discard(mycrib) * player what card to turn. We do a random one, anyway. */ int -cut(mycrib, pos) - bool mycrib; - int pos; +cut(bool mycrib, int pos) { int i; bool win; @@ -448,8 +441,7 @@ cut(mycrib, pos) * Print out the turnover card with crib indicator */ void -prcrib(mycrib, blank) - bool mycrib, blank; +prcrib(bool mycrib, bool blank) { int y, cardx; @@ -479,8 +471,7 @@ static CARD Table[14]; static int Tcnt; int -peg(mycrib) - bool mycrib; +peg(bool mycrib) { static CARD ch[CINHAND], ph[CINHAND]; int i, j, k; @@ -648,8 +639,7 @@ peg(mycrib) * Print out the table with the current score */ void -prtable(score) - int score; +prtable(int score) { prhand(Table, Tcnt, Tablewin, FALSE); mvwprintw(Tablewin, (Tcnt + 2) * 2, Tcnt + 1, "%2d", score); @@ -661,8 +651,7 @@ prtable(score) * Handle the scoring of the hands */ int -score(mycrib) - bool mycrib; +score(bool mycrib) { sorthand(crib, CINHAND); if (mycrib) { diff --git a/games/cribbage/cribbage.h b/games/cribbage/cribbage.h index 88eb40f63ff..ec62a409afd 100644 --- a/games/cribbage/cribbage.h +++ b/games/cribbage/cribbage.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cribbage.h,v 1.7 2004/01/16 00:13:18 espie Exp $ */ +/* $OpenBSD: cribbage.h,v 1.8 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: cribbage.h,v 1.3 1995/03/21 15:08:46 cgd Exp $ */ /* @@ -70,7 +70,7 @@ int chkscr(int *, int); int comphand(CARD [], char *); void cremove(CARD, CARD [], int); int cut(bool, int); -int deal(int); +int deal(bool); void discard(bool); void do_wait(void); void endmsg(void); diff --git a/games/cribbage/instr.c b/games/cribbage/instr.c index 04c650fabc7..b6e2bf0691f 100644 --- a/games/cribbage/instr.c +++ b/games/cribbage/instr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: instr.c,v 1.9 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: instr.c,v 1.10 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: instr.c,v 1.5 1997/07/10 06:47:30 mikel Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)instr.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: instr.c,v 1.9 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: instr.c,v 1.10 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -57,7 +57,7 @@ static char rcsid[] = "$OpenBSD: instr.c,v 1.9 2003/06/03 03:01:39 millert Exp $ #include "pathnames.h" void -instructions() +instructions(void) { int pstat; int fd; diff --git a/games/cribbage/io.c b/games/cribbage/io.c index cc124a5ea60..983acb0c8ac 100644 --- a/games/cribbage/io.c +++ b/games/cribbage/io.c @@ -1,4 +1,4 @@ -/* $OpenBSD: io.c,v 1.9 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: io.c,v 1.10 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: io.c,v 1.9 1997/07/09 06:25:47 phil Exp $ */ /*- @@ -78,9 +78,7 @@ char *suitchar[SUITS] = {"S", "H", "D", "C"}; * Call msgcrd in one of two forms */ int -msgcard(c, brief) - CARD c; - bool brief; +msgcard(CARD c, bool brief) { if (brief) return (msgcrd(c, TRUE, NULL, TRUE)); @@ -93,10 +91,7 @@ msgcard(c, brief) * Print the value of a card in ascii */ int -msgcrd(c, brfrank, mid, brfsuit) - CARD c; - bool brfrank, brfsuit; - char *mid; +msgcrd(CARD c, bool brfrank, char *mid, bool brfsuit) { if (c.rank == EMPTY || c.suit == EMPTY) return (FALSE); @@ -118,11 +113,7 @@ msgcrd(c, brfrank, mid, brfsuit) * Print out a card. */ void -printcard(win, cardno, c, blank) - WINDOW *win; - int cardno; - CARD c; - bool blank; +printcard(WINDOW *win, int cardno, CARD c, bool blank) { prcard(win, cardno * 2, cardno, c, blank); } @@ -132,11 +123,7 @@ printcard(win, cardno, c, blank) * Print out a card on the window at the specified location */ void -prcard(win, y, x, c, blank) - WINDOW *win; - int y, x; - CARD c; - bool blank; +prcard(WINDOW *win, int y, int x, CARD c, bool blank) { if (c.rank == EMPTY) return; @@ -159,11 +146,7 @@ prcard(win, y, x, c, blank) * Print a hand of n cards */ void -prhand(h, n, win, blank) - CARD h[]; - int n; - WINDOW *win; - bool blank; +prhand(CARD h[], int n, WINDOW *win, bool blank) { int i; @@ -179,10 +162,7 @@ prhand(h, n, win, blank) * input, returns the index of the card found... */ int -infrom(hand, n, prompt) - CARD hand[]; - int n; - char *prompt; +infrom(CARD hand[], int n, char *prompt) { int i, j; CARD crd; @@ -235,8 +215,7 @@ infrom(hand, n, prompt) * and then parses it. */ int -incard(crd) - CARD *crd; +incard(CARD *crd) { int i; int rnk, sut; @@ -320,7 +299,7 @@ gotit: * Reads and converts to upper case */ int -getuchar() +getuchar(void) { int c; @@ -337,9 +316,7 @@ getuchar() * "hi" inclusive. */ int -number(lo, hi, prompt) - int lo, hi; - char *prompt; +number(int lo, int hi, char *prompt) { char *p; int sum, tmp; @@ -425,7 +402,7 @@ addmsg(const char *fmt, ...) int Lineno = 0; void -endmsg() +endmsg(void) { static int lastline = 0; int len; @@ -474,7 +451,7 @@ endmsg() * Wait for the user to type ' ' before doing anything else */ void -do_wait() +do_wait(void) { static char prompt[] = {'-', '-', 'M', 'o', 'r', 'e', '-', '-', '\0'}; @@ -496,8 +473,7 @@ do_wait() * Sit around until the guy types the right key */ void -wait_for(ch) - int ch; +wait_for(int ch) { char c; @@ -514,7 +490,7 @@ wait_for(ch) * Reads and returns a character, checking for gross input errors */ int -readchar() +readchar(void) { int cnt; char c; @@ -542,7 +518,7 @@ over: * compressed to one space; a space is inserted before a ',' */ char * -getline() +getline(void) { char *sp; int c, oy, ox; @@ -591,8 +567,7 @@ getline() } void -rint(signo) - int signo; +rint(int signo) { bye(); exit(1); @@ -603,7 +578,7 @@ rint(signo) * Leave the program, cleaning things up as we go. */ void -bye() +bye(void) { signal(SIGINT, SIG_IGN); mvcur(0, COLS - 1, LINES - 1, 0); diff --git a/games/cribbage/score.c b/games/cribbage/score.c index cb10f19533b..91ca9b7292c 100644 --- a/games/cribbage/score.c +++ b/games/cribbage/score.c @@ -1,4 +1,4 @@ -/* $OpenBSD: score.c,v 1.7 2004/01/16 00:13:18 espie Exp $ */ +/* $OpenBSD: score.c,v 1.8 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: score.c,v 1.3 1995/03/21 15:08:57 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: score.c,v 1.7 2004/01/16 00:13:18 espie Exp $"; +static char rcsid[] = "$OpenBSD: score.c,v 1.8 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -103,14 +103,11 @@ static int pairpoints, runpoints; /* Globals from pairuns. */ * scorehand: * Score the given hand of n cards and the starter card. * n must be <= 4 + * crb : true if scoring crib + * do_explain: true if must explain this hand */ int -scorehand(hand, starter, n, crb, do_explain) - CARD hand[]; - CARD starter; - int n; - bool crb; /* true if scoring crib */ - bool do_explain; /* true if must explain this hand */ +scorehand(CARD hand[], CARD starter, int n, bool crb, bool do_explain) { int i, k; int score; @@ -182,9 +179,7 @@ scorehand(hand, starter, n, crb, do_explain) * Return number of fifteens in hand of n cards */ int -fifteens(hand, n) - CARD hand[]; - int n; +fifteens(CARD hand[], int n) { int *sp, *np; int i; @@ -225,9 +220,7 @@ fifteens(hand, n) * sets the globals pairpoints and runpoints appropriately */ int -pairuns(h, n) - CARD h[]; - int n; +pairuns(CARD h[], int n) { int i; int runlength, runmult, lastmult, curmult; @@ -294,9 +287,7 @@ pairuns(h, n) * the n cards in tbl during pegging */ int -pegscore(crd, tbl, n, sum) - CARD crd, tbl[]; - int n, sum; +pegscore(CARD crd, CARD tbl[], int n, int sum) { bool got[RANKS]; int i, j, scr; @@ -349,8 +340,7 @@ pegscore(crd, tbl, n, sum) * points such a crib will get. */ int -adjust(cb, tnv) - CARD cb[], tnv; +adjust(CARD cb[], CARD tnv) { long scr; int i, c0, c1; diff --git a/games/cribbage/support.c b/games/cribbage/support.c index 30e977c9365..80db1399b47 100644 --- a/games/cribbage/support.c +++ b/games/cribbage/support.c @@ -1,4 +1,4 @@ -/* $OpenBSD: support.c,v 1.8 2004/01/16 00:13:18 espie Exp $ */ +/* $OpenBSD: support.c,v 1.9 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: support.c,v 1.3 1995/03/21 15:08:59 cgd Exp $ */ /*- @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)support.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: support.c,v 1.8 2004/01/16 00:13:18 espie Exp $"; +static char rcsid[] = "$OpenBSD: support.c,v 1.9 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -55,9 +55,7 @@ int tv[NTV] = {8, 7, 9, 6, 11, 12, 13, 14, 10, 5}; * only called if no playable card will score points */ int -cchose(h, n, s) - CARD h[]; - int n, s; +cchose(CARD h[], int n, int s) { int i, j, l; @@ -124,9 +122,7 @@ cchose(h, n, s) * Evaluate and score a player hand or crib */ int -plyrhand(hand, s) - CARD hand[]; - char *s; +plyrhand(CARD hand[], char *s) { static char prompt[BUFSIZ]; int i, j; @@ -166,9 +162,7 @@ plyrhand(hand, s) * Handle scoring and displaying the computers hand */ int -comphand(h, s) - CARD h[]; - char *s; +comphand(CARD h[], char *s) { int j; @@ -186,8 +180,7 @@ comphand(h, s) int Lastscore[2] = {-1, -1}; int -chkscr(scr, inc) - int *scr, inc; +chkscr(int *scr, int inc) { bool myturn; @@ -208,10 +201,7 @@ chkscr(scr, inc) * score up on the board. */ void -prpeg(score, peg, myturn) - int score; - int peg; - bool myturn; +prpeg(int score, int peg, bool myturn) { int y, x; @@ -247,8 +237,7 @@ prpeg(score, peg, myturn) * the crib and puts the best two cards at the end */ void -cdiscard(mycrib) - bool mycrib; +cdiscard(bool mycrib) { CARD d[CARDS], h[FULLHAND], cb[2]; int i, j, k; @@ -300,9 +289,7 @@ cdiscard(mycrib) * returns true if some card in hand can be played without exceeding 31 */ int -anymove(hand, n, sum) - CARD hand[]; - int n, sum; +anymove(CARD hand[], int n, int sum) { int i, j; @@ -321,9 +308,7 @@ anymove(hand, n, sum) * the s up to t, or -1 if there is none */ int -anysumto(hand, n, s, t) - CARD hand[]; - int n, s, t; +anysumto(CARD hand[], int n, int s, int t) { int i; @@ -338,9 +323,7 @@ anysumto(hand, n, s, t) * return the number of cards in h having the given rank value */ int -numofval(h, n, v) - CARD h[]; - int n, v; +numofval(CARD h[], int n, int v) { int i, j; @@ -356,9 +339,7 @@ numofval(h, n, v) * makeknown remembers all n cards in h for future recall */ void -makeknown(h, n) - CARD h[]; - int n; +makeknown(CARD h[], int n) { int i; diff --git a/games/morse/morse.c b/games/morse/morse.c index c371fc63c6c..b1ec0b08682 100644 --- a/games/morse/morse.c +++ b/games/morse/morse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: morse.c,v 1.11 2003/07/10 00:03:01 david Exp $ */ +/* $OpenBSD: morse.c,v 1.12 2004/07/10 07:26:23 deraadt Exp $ */ /* * Copyright (c) 1988, 1993 @@ -39,7 +39,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: morse.c,v 1.11 2003/07/10 00:03:01 david Exp $"; +static char rcsid[] = "$OpenBSD: morse.c,v 1.12 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -121,9 +121,7 @@ static int sflag = 0; static int dflag = 0; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { int ch; char *p; @@ -199,8 +197,7 @@ main(argc, argv) } void -morse(c) - int c; +morse(int c) { int i; @@ -223,8 +220,7 @@ morse(c) } void -decode(s) - char *s; +decode(char *s) { int i; @@ -253,8 +249,7 @@ decode(s) void -show(s) - char *s; +show(char *s) { if (sflag) printf(" %s", s); diff --git a/games/number/number.c b/games/number/number.c index 7cb02070ba6..be668e5cb7c 100644 --- a/games/number/number.c +++ b/games/number/number.c @@ -1,4 +1,4 @@ -/* $OpenBSD: number.c,v 1.10 2003/06/03 03:01:40 millert Exp $ */ +/* $OpenBSD: number.c,v 1.11 2004/07/10 07:26:23 deraadt Exp $ */ /* * Copyright (c) 1988, 1993, 1994 @@ -39,7 +39,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95"; #else -static char rcsid[] = "$OpenBSD: number.c,v 1.10 2003/06/03 03:01:40 millert Exp $"; +static char rcsid[] = "$OpenBSD: number.c,v 1.11 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -88,9 +88,7 @@ void usage(void); int lflag; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch, first; char line[LINELEN]; @@ -132,8 +130,7 @@ main(argc, argv) } void -convert(line) - char *line; +convert(char *line) { int flen, len, rval; char *p, *fraction; @@ -209,8 +206,7 @@ badnum: errx(1, "illegal number: %s", line); } void -convertexp(line) - char *line; +convertexp(char *line) { char locline[LINELEN]; char *part1, *part2, *part3, *part4; @@ -253,9 +249,7 @@ convertexp(line) } int -unit(len, p) - int len; - const char *p; +unit(int len, const char *p) { int off, rval; @@ -289,9 +283,7 @@ unit(len, p) } int -number(p, len) - const char *p; - int len; +number(const char *p, int len) { int val, rval; @@ -329,8 +321,7 @@ number(p, len) } void -pfract(len) - int len; +pfract(int len) { static const char *const pref[] = { "", "ten-", "hundred-" }; @@ -348,7 +339,7 @@ pfract(len) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: number [-l] [--] [# ...]\n"); exit(1); diff --git a/games/pig/pig.c b/games/pig/pig.c index 9794e787828..cc8e2b80455 100644 --- a/games/pig/pig.c +++ b/games/pig/pig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pig.c,v 1.9 2003/06/03 03:01:40 millert Exp $ */ +/* $OpenBSD: pig.c,v 1.10 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: pig.c,v 1.2 1995/03/23 08:41:40 cgd Exp $ */ /*- @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)pig.c 8.2 (Berkeley) 5/4/95"; #else -static char rcsid[] = "$OpenBSD: pig.c,v 1.9 2003/06/03 03:01:40 millert Exp $"; +static char rcsid[] = "$OpenBSD: pig.c,v 1.10 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -57,9 +57,7 @@ void pigout(char *, int); void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int len; int ch; @@ -91,9 +89,7 @@ main(argc, argv) } void -pigout(buf, len) - char *buf; - int len; +pigout(char *buf, int len) { int ch, start, i; int olen, allupper, firstupper; @@ -132,7 +128,7 @@ pigout(buf, len) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: pig\n"); exit(1); diff --git a/games/pom/pom.c b/games/pom/pom.c index 185b71f2cbe..8cd921e045d 100644 --- a/games/pom/pom.c +++ b/games/pom/pom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pom.c,v 1.10 2003/07/10 00:03:01 david Exp $ */ +/* $OpenBSD: pom.c,v 1.11 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: pom.c,v 1.6 1996/02/06 22:47:29 jtc Exp $ */ /* @@ -42,7 +42,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: pom.c,v 1.10 2003/07/10 00:03:01 david Exp $"; +static char rcsid[] = "$OpenBSD: pom.c,v 1.11 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -88,9 +88,7 @@ time_t parsetime(char *); void badformat(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct timeval tp; struct timezone tzp; @@ -152,8 +150,7 @@ main(argc, argv) * return phase of the moon */ double -potm(days) - double days; +potm(double days) { double N, Msol, Ec, LambdaSol, l, Mm, Ev, Ac, A3, Mmprime; double A4, lprime, V, ldprime, D, Nm; @@ -189,8 +186,7 @@ potm(days) * convert degrees to radians */ double -dtor(deg) - double deg; +dtor(double deg) { return(deg * M_PI / 180); } @@ -200,8 +196,7 @@ dtor(deg) * adjust value so 0 <= deg <= 360 */ void -adj360(deg) - double *deg; +adj360(double *deg) { for (;;) if (*deg < 0.0) @@ -214,8 +209,7 @@ adj360(deg) #define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2; time_t -parsetime(p) - char *p; +parsetime(char *p) { struct tm *lt; int bigyear; @@ -276,7 +270,7 @@ parsetime(p) } void -badformat() +badformat(void) { warnx("illegal time format"); (void)fprintf(stderr, "usage: pom [[[[[cc]yy]mm]dd]HH]\n"); diff --git a/games/quiz/quiz.c b/games/quiz/quiz.c index 3bd7d79ae72..665e93bc59b 100644 --- a/games/quiz/quiz.c +++ b/games/quiz/quiz.c @@ -1,4 +1,4 @@ -/* $OpenBSD: quiz.c,v 1.15 2003/07/06 02:04:03 avsm Exp $ */ +/* $OpenBSD: quiz.c,v 1.16 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: quiz.c,v 1.9 1995/04/22 10:16:58 cgd Exp $ */ /*- @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)quiz.c 8.3 (Berkeley) 5/4/95"; #else -static char rcsid[] = "$OpenBSD: quiz.c,v 1.15 2003/07/06 02:04:03 avsm Exp $"; +static char rcsid[] = "$OpenBSD: quiz.c,v 1.16 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -75,9 +75,7 @@ void show_index(void); void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch; const char *indexfile; @@ -115,8 +113,7 @@ main(argc, argv) } void -get_file(file) - const char *file; +get_file(const char *file) { FILE *fp; QE *qp; @@ -156,7 +153,7 @@ get_file(file) } void -show_index() +show_index(void) { QE *qp; const char *p, *s; @@ -187,8 +184,7 @@ show_index() } void -get_cats(cat1, cat2) - char *cat1, *cat2; +get_cats(char *cat1, char *cat2) { QE *qp; int i; @@ -220,7 +216,7 @@ get_cats(cat1, cat2) } void -quiz() +quiz(void) { QE *qp; int i; @@ -306,8 +302,7 @@ quiz() } const char * -next_cat(s) - const char * s; +next_cat(const char *s) { int esc; @@ -332,10 +327,7 @@ next_cat(s) } char * -appdstr(s, tp, len) - char *s; - const char *tp; - size_t len; +appdstr(char *s, const char *tp, size_t len) { char *mp; const char *sp; @@ -359,8 +351,7 @@ appdstr(s, tp, len) } void -score(r, w, g) - u_int r, w, g; +score(u_int r, u_int w, u_int g) { (void)printf("Rights %d, wrongs %d,", r, w); if (g) @@ -369,8 +360,7 @@ score(r, w, g) } void -downcase(p) - char *p; +downcase(char *p) { int ch; @@ -380,7 +370,7 @@ downcase(p) } void -usage() +usage(void) { (void)fprintf(stderr, "quiz [-t] [-i file] category1 category2\n"); exit(1); diff --git a/games/quiz/rxp.c b/games/quiz/rxp.c index 68c4884e589..f3ae83bbfc3 100644 --- a/games/quiz/rxp.c +++ b/games/quiz/rxp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rxp.c,v 1.6 2003/06/03 03:01:40 millert Exp $ */ +/* $OpenBSD: rxp.c,v 1.7 2004/07/10 07:26:23 deraadt Exp $ */ /* $NetBSD: rxp.c,v 1.5 1995/04/22 10:17:00 cgd Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)rxp.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: rxp.c,v 1.6 2003/06/03 03:01:40 millert Exp $"; +static char rcsid[] = "$OpenBSD: rxp.c,v 1.7 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -86,16 +86,13 @@ static char *rxp__expand(int); static int rxp__match(const char *, int, Rxp_t *, Rxp_t *, const char *); int -rxp_compile(s) - const char * s; +rxp_compile(const char *s) { return (rxp__compile(s, TRUE)); } static int -rxp__compile(s, first) - const char *s; - int first; +rxp__compile(const char *s, int first) { static Rxp_t *rp; static const char *sp; @@ -196,19 +193,19 @@ rxp__compile(s, first) * match string against compiled regular expression */ int -rxp_match(s) - const char *s; +rxp_match(const char *s) { return (rxp__match(s, TRUE, NULL, NULL, NULL)); } +/* + * j_succ : jump here on successful alt match + * j_fail : jump here on failed match + * sp_fail: reset sp to here on failed match + */ static int -rxp__match(s, first, j_succ, j_fail, sp_fail) - const char *s; - int first; - Rxp_t *j_succ; /* jump here on successful alt match */ - Rxp_t *j_fail; /* jump here on failed match */ - const char *sp_fail; /* reset sp to here on failed match */ +rxp__match(const char *s, int first, Rxp_t *j_succ, Rxp_t *j_fail, + const char *sp_fail) { static Rxp_t *rp; static const char *sp; @@ -266,14 +263,13 @@ rxp__match(s, first, j_succ, j_fail, sp_fail) * Reverse engineer the regular expression, by picking first of all alternates. */ char * -rxp_expand() +rxp_expand(void) { return (rxp__expand(TRUE)); } static char * -rxp__expand(first) - int first; +rxp__expand(int first) { static char buf[RXP_LINE_SZ/2]; static Rxp_t *rp; diff --git a/games/rain/rain.c b/games/rain/rain.c index dcdb9393abf..31cb0138854 100644 --- a/games/rain/rain.c +++ b/games/rain/rain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rain.c,v 1.13 2003/06/03 03:01:40 millert Exp $ */ +/* $OpenBSD: rain.c,v 1.14 2004/07/10 07:26:23 deraadt Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)rain.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: rain.c,v 1.13 2003/06/03 03:01:40 millert Exp $"; +static char rcsid[] = "$OpenBSD: rain.c,v 1.14 2004/07/10 07:26:23 deraadt Exp $"; #endif #endif /* not lint */ @@ -62,9 +62,7 @@ static void onsig(int); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { int x, y, j; long tcols, tlines; @@ -142,8 +140,7 @@ main(argc, argv) } static void -onsig(dummy) - int dummy; +onsig(int dummy) { sig_caught = 1; } diff --git a/games/random/random.c b/games/random/random.c index 305f8a2d58d..e534b46e7cb 100644 --- a/games/random/random.c +++ b/games/random/random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: random.c,v 1.9 2003/06/03 03:01:40 millert Exp $ */ +/* $OpenBSD: random.c,v 1.10 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: random.c,v 1.3 1995/04/22 07:44:05 cgd Exp $ */ /* @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)random.c 8.5 (Berkeley) 4/5/94"; #else -static char rcsid[] = "$OpenBSD: random.c,v 1.9 2003/06/03 03:01:40 millert Exp $"; +static char rcsid[] = "$OpenBSD: random.c,v 1.10 2004/07/10 07:26:24 deraadt Exp $"; #endif #endif /* not lint */ @@ -62,9 +62,7 @@ static char rcsid[] = "$OpenBSD: random.c,v 1.9 2003/06/03 03:01:40 millert Exp void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { double denom; int ch, random_exit, selected, unbuffer_output; @@ -141,7 +139,7 @@ main(argc, argv) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: random [-er] [denominator]\n"); diff --git a/games/snake/snake.c b/games/snake/snake.c index 482756a4ee8..32d9c4a7b5f 100644 --- a/games/snake/snake.c +++ b/games/snake/snake.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snake.c,v 1.8 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: snake.c,v 1.9 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: snake.c,v 1.8 1995/04/29 00:06:41 mycroft Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94"; #else -static char rcsid[] = "$OpenBSD: snake.c,v 1.8 2003/06/03 03:01:41 millert Exp $"; +static char rcsid[] = "$OpenBSD: snake.c,v 1.9 2004/07/10 07:26:24 deraadt Exp $"; #endif #endif /* not lint */ @@ -145,9 +145,7 @@ void logit(char *); int wantstop; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char *argv[]) { int ch, i; char *p, **av; @@ -260,7 +258,7 @@ main(argc, argv) /* Main command loop */ void -mainloop() +mainloop(void) { int k; int c, lastc = 0; @@ -458,7 +456,7 @@ mainloop() /* set up the board */ void -setup() +setup(void) { int i; @@ -475,7 +473,7 @@ setup() } void -drawbox() +drawbox(void) { int i; @@ -490,8 +488,7 @@ drawbox() } void -snrand(sp) - struct point *sp; +snrand(struct point *sp) { struct point p; int i; @@ -520,8 +517,7 @@ snrand(sp) } int -post(iscore, flag) - int iscore, flag; +post(int iscore, int flag) { short score = iscore; short oldbest = 0; @@ -571,8 +567,7 @@ const float absv[8] = {1, 1.4, 1, 1.4, 1, 1.4, 1, 1.4}; int oldw = 0; void -chase(np, sp) - struct point *sp, *np; +chase(struct point *np, struct point *sp) { /* this algorithm has bugs; otherwise the snake would get too good */ struct point d; @@ -635,8 +630,7 @@ chase(np, sp) } void -spacewarp(w) - int w; +spacewarp(int w) { struct point p; int j; @@ -670,7 +664,7 @@ spacewarp(w) } void -snap() +snap(void) { /* I don't see the graphical purpose of the next block of code. @@ -717,8 +711,7 @@ snap() } int -stretch(ps) - struct point *ps; +stretch(struct point *ps) { struct point p; @@ -764,8 +757,7 @@ stretch(ps) } void -surround(ps) - struct point *ps; +surround(struct point *ps) { int j; @@ -808,8 +800,7 @@ surround(ps) } void -win(ps) - struct point *ps; +win(struct point *ps) { struct point x; int j, k; @@ -842,7 +833,7 @@ win(ps) } int -pushsnake() +pushsnake(void) { int i, bonus; int issame = 0; @@ -903,8 +894,7 @@ pushsnake() } int -chk(sp) - struct point *sp; +chk(struct point *sp) { int j; @@ -941,22 +931,20 @@ chk(sp) } void -winnings(won) - int won; +winnings(int won) { if (won > 0) mvprintw(1, 1, "$%d ", won); } void -stop(dummy) - int dummy; +stop(int dummy) { wantstop = 1; } void -suspend() +suspend(void) { endwin(); kill(getpid(), SIGTSTP); @@ -965,16 +953,14 @@ suspend() } void -length(num) - int num; +length(int num) { printf("You made %d moves.\n", num); } #ifdef LOGGING void -logit(msg) - char *msg; +logit(char *msg) { time_t t; diff --git a/games/snake/snscore.c b/games/snake/snscore.c index 544b22d42f4..1dff641784f 100644 --- a/games/snake/snscore.c +++ b/games/snake/snscore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snscore.c,v 1.4 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: snscore.c,v 1.5 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: snscore.c,v 1.5 1995/04/24 12:25:43 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)snscore.c 8.1 (Berkeley) 7/19/93"; #else -static char rcsid[] = "$OpenBSD: snscore.c,v 1.4 2003/06/03 03:01:41 millert Exp $"; +static char rcsid[] = "$OpenBSD: snscore.c,v 1.5 2004/07/10 07:26:24 deraadt Exp $"; #endif #endif /* not lint */ @@ -64,8 +64,7 @@ struct player { } players[MAXPLAYERS], temp; void -snscore(fd, topn) - int fd, topn; +snscore(int fd, int topn) { uid_t uid; short score; diff --git a/games/tetris/input.c b/games/tetris/input.c index 6fef4732e4a..2bdd0686d46 100644 --- a/games/tetris/input.c +++ b/games/tetris/input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: input.c,v 1.10 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: input.c,v 1.11 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: input.c,v 1.3 1996/02/06 22:47:33 jtc Exp $ */ /*- @@ -73,8 +73,7 @@ * Return 0 => no input, 1 => can read() from stdin */ int -rwait(tvp) - struct timeval *tvp; +rwait(struct timeval *tvp) { struct timeval starttv, endtv, *s; fd_set fds; @@ -124,7 +123,7 @@ again: * Eat any input that might be available. */ void -tsleep() +tsleep(void) { struct timeval tv; char c; @@ -140,7 +139,7 @@ tsleep() * getchar with timeout. */ int -tgetchar() +tgetchar(void) { static struct timeval timeleft; char c; diff --git a/games/tetris/scores.c b/games/tetris/scores.c index ac7c16f011e..3442e2cda53 100644 --- a/games/tetris/scores.c +++ b/games/tetris/scores.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scores.c,v 1.9 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: scores.c,v 1.10 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: scores.c,v 1.2 1995/04/22 07:42:38 cgd Exp $ */ /*- @@ -93,8 +93,7 @@ static char *thisuser(void); * Note, we assume closing the stdio file releases the lock. */ static void -getscores(fpp) - FILE **fpp; +getscores(FILE **fpp) { int sd, mint, lck, mask, i; char *mstr, *human; @@ -150,8 +149,7 @@ getscores(fpp) } void -savescore(level) - int level; +savescore(int level) { struct highscore *sp; int i; @@ -217,7 +215,7 @@ savescore(level) * The result is always trimmed to fit in a score. */ static char * -thisuser() +thisuser(void) { const char *p; struct passwd *pw; @@ -244,8 +242,7 @@ thisuser() * listed first in the highscore file. */ static int -cmpscores(x, y) - const void *x, *y; +cmpscores(const void *x, const void *y) { const struct highscore *a, *b; long l; @@ -274,9 +271,7 @@ cmpscores(x, y) * Caveat: the highest score on each level is always kept. */ static int -checkscores(hs, num) - struct highscore *hs; - int num; +checkscores(struct highscore *hs, int num) { struct highscore *sp; int i, j, k, numnames; @@ -348,8 +343,7 @@ checkscores(hs, num) * before it can be shown anyway. */ void -showscores(level) - int level; +showscores(int level) { struct highscore *sp; int i, n, c; @@ -404,11 +398,7 @@ showscores(level) } static void -printem(level, offset, hs, n, me) - int level, offset; - struct highscore *hs; - int n; - const char *me; +printem(int level, int offset, struct highscore *hs, int n, const char *me) { struct highscore *sp; int row, highlight, i; diff --git a/games/tetris/screen.c b/games/tetris/screen.c index 6c1b882ffc5..dc647fb00d1 100644 --- a/games/tetris/screen.c +++ b/games/tetris/screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: screen.c,v 1.11 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: screen.c,v 1.12 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: screen.c,v 1.4 1995/04/29 01:11:36 mycroft Exp $ */ /*- @@ -120,8 +120,7 @@ static char combuf[1024], tbuf[1024]; * Routine used by tputs(). */ int -put(c) - int c; +put(int c) { return (putchar(c)); @@ -139,7 +138,7 @@ put(c) * Set up from termcap. */ void -scr_init() +scr_init(void) { static int bsflag, xsflag, sgnum; #ifdef unneeded @@ -208,8 +207,7 @@ scr_init() static jmp_buf scr_onstop; static void -stopset(sig) - int sig; +stopset(int sig) { sigset_t sigset; @@ -222,8 +220,7 @@ stopset(sig) } static void -scr_stop(sig) - int sig; +scr_stop(int sig) { sigset_t sigset; @@ -240,7 +237,7 @@ scr_stop(sig) * Set up screen mode. */ void -scr_set() +scr_set(void) { struct winsize ws; struct termios newtt; @@ -308,7 +305,7 @@ scr_set() * End screen mode. */ void -scr_end() +scr_end(void) { sigset_t sigset, osigset; @@ -333,8 +330,7 @@ scr_end() } void -stop(why) - char *why; +stop(char *why) { if (isset) @@ -346,7 +342,7 @@ stop(why) * Clear the screen, forgetting the current contents in the process. */ void -scr_clear() +scr_clear(void) { putpad(CLstr); @@ -364,7 +360,7 @@ typedef cell regcell; * Update the screen. */ void -scr_update() +scr_update(void) { cell *bp, *sp; regcell so, cur_so = 0; @@ -478,9 +474,7 @@ scr_update() * (We need its length in case we have to overwrite with blanks.) */ void -scr_msg(s, set) - char *s; - int set; +scr_msg(char *s, int set) { if (set || CEstr == NULL) { diff --git a/games/tetris/shapes.c b/games/tetris/shapes.c index fe59deed073..05ea602f06b 100644 --- a/games/tetris/shapes.c +++ b/games/tetris/shapes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shapes.c,v 1.7 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: shapes.c,v 1.8 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: shapes.c,v 1.2 1995/04/22 07:42:44 cgd Exp $ */ /*- @@ -80,9 +80,7 @@ const struct shape shapes[] = { * taking the current board into account. */ int -fits_in(shape, pos) - const struct shape *shape; - int pos; +fits_in(const struct shape *shape, int pos) { int *o = shape->off; @@ -97,9 +95,7 @@ fits_in(shape, pos) * if `onoff' is 1, and off if `onoff' is 0. */ void -place(shape, pos, onoff) - const struct shape *shape; - int pos, onoff; +place(const struct shape *shape, int pos, int onoff) { int *o = shape->off; diff --git a/games/tetris/tetris.c b/games/tetris/tetris.c index 778a5f3e72b..65db7ddf0f6 100644 --- a/games/tetris/tetris.c +++ b/games/tetris/tetris.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tetris.c,v 1.19 2004/01/10 01:23:20 tedu Exp $ */ +/* $OpenBSD: tetris.c,v 1.20 2004/07/10 07:26:24 deraadt Exp $ */ /* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */ /*- @@ -83,7 +83,7 @@ void usage(void); * right edges are set. */ static void -setup_board() +setup_board(void) { int i; cell *p; @@ -97,7 +97,7 @@ setup_board() * Elide any full active rows. */ static void -elide() +elide(void) { int rows = 0; int i, j, base; @@ -140,7 +140,7 @@ elide() } const struct shape * -randshape() +randshape(void) { const struct shape *tmp; int i, j; @@ -154,9 +154,7 @@ randshape() int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int pos, c; char *keys; @@ -360,8 +358,7 @@ main(argc, argv) } void -onintr(signo) - int signo; +onintr(int signo) { scr_clear(); /* XXX signal race */ scr_end(); /* XXX signal race */ @@ -369,7 +366,7 @@ onintr(signo) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: tetris [-ps] [-k keys] [-l level]\n"); exit(1); diff --git a/games/wump/wump.c b/games/wump/wump.c index c4b0cca72cc..84cd55b31ba 100644 --- a/games/wump/wump.c +++ b/games/wump/wump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wump.c,v 1.22 2003/06/03 03:01:42 millert Exp $ */ +/* $OpenBSD: wump.c,v 1.23 2004/07/10 07:26:24 deraadt Exp $ */ /* * Copyright (c) 1989, 1993 @@ -43,7 +43,7 @@ static const char copyright[] = #if 0 static char sccsid[] = "@(#)wump.c 8.1 (Berkeley) 5/31/93"; #else -static const char rcsid[] = "$OpenBSD: wump.c,v 1.22 2003/06/03 03:01:42 millert Exp $"; +static const char rcsid[] = "$OpenBSD: wump.c,v 1.23 2004/07/10 07:26:24 deraadt Exp $"; #endif #endif /* not lint */ @@ -145,7 +145,7 @@ int wump_nearby(void); int -main(int argc, char **argv) +main(int argc, char *argv[]) { int c; @@ -277,7 +277,7 @@ quiver holds %d custom super anti-evil Wumpus arrows. Good luck.\n", } void -display_room_stats() +display_room_stats(void) { int i; @@ -307,7 +307,7 @@ display_room_stats() } int -take_action() +take_action(void) { /* * Do the action specified by the player, either 'm'ove, 's'hoot @@ -336,8 +336,7 @@ take_action() } int -move_to(room_number) - const char *room_number; +move_to(const char *room_number) { int i, just_moved_by_bats, next_room, tunnel_available; @@ -569,7 +568,7 @@ gcd(int a, int b) } void -cave_init() +cave_init(void) { int i, j, k, link; int delta; @@ -661,7 +660,7 @@ try_again: link = (random() % room_num) + 1; } void -dodecahedral_cave_init() +dodecahedral_cave_init(void) { int vert[20][3] = { {1, 4, 7}, @@ -726,7 +725,7 @@ dodecahedral_cave_init() } void -clear_things_in_cave() +clear_things_in_cave(void) { int i; @@ -739,7 +738,7 @@ clear_things_in_cave() } void -initialize_things_in_cave() +initialize_things_in_cave(void) { int i, loc; @@ -811,7 +810,7 @@ getans(const char *prompt) } int -bats_nearby() +bats_nearby(void) { int i; @@ -823,7 +822,7 @@ bats_nearby() } int -pit_nearby() +pit_nearby(void) { int i; @@ -835,7 +834,7 @@ pit_nearby() } int -wump_nearby() +wump_nearby(void) { int i, j; @@ -852,7 +851,7 @@ wump_nearby() } void -move_wump() +move_wump(void) { wumpus_loc = cave[wumpus_loc].tunnel[random() % link_num]; #ifdef DEBUG @@ -868,7 +867,7 @@ int_compare(const void *a, const void *b) } void -instructions() +instructions(void) { const char *pager; pid_t pid; @@ -913,7 +912,7 @@ puff of greasy black smoke! (poof)\n"); } void -usage() +usage(void) { (void)fprintf(stderr, "usage: wump [-ho] [-a arrows] [-b bats] [-p pits] [-r rooms] [-t tunnels]\n"); @@ -922,7 +921,7 @@ usage() /* messages */ void -wump_kill() +wump_kill(void) { (void)printf( "*ROAR* *chomp* *snurfle* *chomp*!\n\ @@ -934,7 +933,7 @@ pass out from the stench!\n"); } void -wump_walk_kill() +wump_walk_kill(void) { (void)printf( "Oh dear. All the commotion has managed to awaken the evil Wumpus, who\n\ @@ -945,7 +944,7 @@ also opens wide as the evil beast beholds dinner.\n\ } void -wump_bat_kill() +wump_bat_kill(void) { (void)printf( "Flap, flap. The bats fly you right into the room with the evil Wumpus!\n\ @@ -958,7 +957,7 @@ It does.\n"); } void -kill_wump() +kill_wump(void) { (void)printf( "*thwock!* *groan* *crash*\n\n\ @@ -970,7 +969,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\ @@ -980,7 +979,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 your wild arrow\n\ @@ -1002,7 +1001,7 @@ to your side, not to help, alas, but to EAT YOU!\n\ */ void -pit_kill() +pit_kill(void) { (void)printf( "*AAAUUUUGGGGGHHHHHhhhhhhhhhh...*\n\ @@ -1014,7 +1013,7 @@ you can at least find out if Jules Verne was right...\n"); } void -pit_kill_bat() +pit_kill_bat(void) { (void)printf( "*AAAUUUUGGGGGHHHHHhhhhhhhhhh...*\n\ @@ -1024,7 +1023,7 @@ the bright side; 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\ |