From 59a1b2e1425834dcc8f7d2b99c931f3c6f6bc28c Mon Sep 17 00:00:00 2001 From: dholland Date: Tue, 19 Jun 2012 05:46:08 +0000 Subject: WARNS=5, and make WARNS=5 the default for src/games. --- Makefile.inc | 4 +-- arithmetic/arithmetic.c | 23 +++++++---------- battlestar/command1.c | 6 ++--- battlestar/command5.c | 6 ++--- fortune/fortune/fortune.c | 7 +++--- fortune/unstr/unstr.c | 14 ++++------- hack/hack.shk.c | 7 +++--- hack/hack.shknam.c | 13 ++++++---- morse/morse.c | 17 +++++-------- number/number.c | 24 ++++++------------ pig/pig.c | 14 ++++------- snake/snake/snake.c | 64 +++++++++++++++++------------------------------ snake/snscore/snscore.c | 6 ++--- worms/worms.c | 13 ++++------ wump/wump.c | 60 +++++++++++++++++++------------------------- 15 files changed, 112 insertions(+), 166 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index cdd7bc30..5566c295 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.14 2009/01/18 20:22:45 dholland Exp $ +# $NetBSD: Makefile.inc,v 1.15 2012/06/19 05:46:08 dholland Exp $ # @(#)Makefile.inc 8.1 (Berkeley) 5/31/93 MKHIDEGAME?= no @@ -20,4 +20,4 @@ BINGRP= games BINMODE= 2555 .endif .endif -WARNS?= 4 +WARNS?= 5 diff --git a/arithmetic/arithmetic.c b/arithmetic/arithmetic.c index bd6c8141..743948e6 100644 --- a/arithmetic/arithmetic.c +++ b/arithmetic/arithmetic.c @@ -1,4 +1,4 @@ -/* $NetBSD: arithmetic.c,v 1.26 2011/08/31 16:24:55 plunky Exp $ */ +/* $NetBSD: arithmetic.c,v 1.27 2012/06/19 05:46:08 dholland Exp $ */ /* * Copyright (c) 1989, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\ #if 0 static char sccsid[] = "@(#)arithmetic.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: arithmetic.c,v 1.26 2011/08/31 16:24:55 plunky Exp $"); +__RCSID("$NetBSD: arithmetic.c,v 1.27 2012/06/19 05:46:08 dholland Exp $"); #endif #endif /* not lint */ @@ -155,8 +155,7 @@ main(int argc, char **argv) /* Handle interrupt character. Print score and exit. */ static void -intr(dummy) - int dummy __unused; +intr(int dummy __unused) { showstats(1); exit(0); @@ -164,8 +163,7 @@ intr(dummy) /* Print score. Original `arithmetic' had a delay after printing it. */ static void -showstats(bool_sigint) - int bool_sigint; +showstats(int bool_sigint) { if (nright + nwrong > 0) { (void)printf("\n\nRights %d; Wrongs %d; Score %d%%", @@ -190,7 +188,7 @@ showstats(bool_sigint) * more likely to appear in subsequent problems. */ static int -problem() +problem(void) { char *p; time_t start, finish; @@ -303,8 +301,7 @@ static struct penalty { * forget about the penalty (how likely is this, anyway?). */ static void -penalise(value, op, operand) - int value, op, operand; +penalise(int value, int op, int operand) { struct penalty *p; @@ -324,8 +321,7 @@ penalise(value, op, operand) * we find the corresponding value and return that, decreasing its penalty. */ static int -getrandom(maxval, op, operand) - int maxval, op, operand; +getrandom(int maxval, int op, int operand) { int value; struct penalty **pp, *p; @@ -369,8 +365,7 @@ getrandom(maxval, op, operand) /* Return an index for the character op, which is one of [+-x/]. */ static int -opnum(op) - int op; +opnum(int op) { char *p; @@ -382,7 +377,7 @@ opnum(op) /* Print usage message and quit. */ static void -usage() +usage(void) { (void)fprintf(stderr, "Usage: %s [-o +-x/] [-r range]\n", getprogname()); diff --git a/battlestar/command1.c b/battlestar/command1.c index 70441531..c69dff69 100644 --- a/battlestar/command1.c +++ b/battlestar/command1.c @@ -1,4 +1,4 @@ -/* $NetBSD: command1.c,v 1.4 2009/08/12 05:20:38 dholland Exp $ */ +/* $NetBSD: command1.c,v 1.5 2012/06/19 05:46:08 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)com1.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: command1.c,v 1.4 2009/08/12 05:20:38 dholland Exp $"); +__RCSID("$NetBSD: command1.c,v 1.5 2012/06/19 05:46:08 dholland Exp $"); #endif #endif /* not lint */ @@ -96,7 +96,7 @@ convert(int tothis) } void -news() +news(void) { int n; int hurt; diff --git a/battlestar/command5.c b/battlestar/command5.c index 0ad91e24..e5fc3a37 100644 --- a/battlestar/command5.c +++ b/battlestar/command5.c @@ -1,4 +1,4 @@ -/* $NetBSD: command5.c,v 1.3 2005/07/01 06:04:54 jmc Exp $ */ +/* $NetBSD: command5.c,v 1.4 2012/06/19 05:46:08 dholland Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,14 +34,14 @@ #if 0 static char sccsid[] = "@(#)com5.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: command5.c,v 1.3 2005/07/01 06:04:54 jmc Exp $"); +__RCSID("$NetBSD: command5.c,v 1.4 2012/06/19 05:46:08 dholland Exp $"); #endif #endif /* not lint */ #include "extern.h" void -kiss() +kiss(void) { while (wordtype[++wordnumber] != NOUNS && wordnumber <= wordcount) continue; diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c index f9c8bdc8..d5dd74f4 100644 --- a/fortune/fortune/fortune.c +++ b/fortune/fortune/fortune.c @@ -1,4 +1,4 @@ -/* $NetBSD: fortune.c,v 1.63 2010/01/17 22:52:00 wiz Exp $ */ +/* $NetBSD: fortune.c,v 1.64 2012/06/19 05:46:08 dholland Exp $ */ /*- * Copyright (c) 1986, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\ #if 0 static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: fortune.c,v 1.63 2010/01/17 22:52:00 wiz Exp $"); +__RCSID("$NetBSD: fortune.c,v 1.64 2012/06/19 05:46:08 dholland Exp $"); #endif #endif /* not lint */ @@ -1061,8 +1061,7 @@ open_fp(FILEDESC *fp) * Open up the dat file if we need to. */ static void -open_dat(fp) - FILEDESC *fp; +open_dat(FILEDESC *fp) { if (fp->datfd < 0 && (fp->datfd = open(fp->datfile, O_RDONLY)) < 0) err(1, "Cannot open `%s'", fp->datfile); diff --git a/fortune/unstr/unstr.c b/fortune/unstr/unstr.c index 65207960..6f5e8241 100644 --- a/fortune/unstr/unstr.c +++ b/fortune/unstr/unstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: unstr.c,v 1.13 2008/07/20 01:03:21 lukem Exp $ */ +/* $NetBSD: unstr.c,v 1.14 2012/06/19 05:46:08 dholland Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\ #if 0 static char sccsid[] = "@(#)unstr.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: unstr.c,v 1.13 2008/07/20 01:03:21 lukem Exp $"); +__RCSID("$NetBSD: unstr.c,v 1.14 2012/06/19 05:46:08 dholland Exp $"); #endif #endif /* not lint */ @@ -85,9 +85,7 @@ void order_unstr(STRFILE *); /* ARGSUSED */ int -main(ac, av) - int ac __unused; - char **av; +main(int ac __unused, char **av) { static STRFILE tbl; /* description table */ @@ -114,8 +112,7 @@ main(ac, av) } void -getargs(av) - char *av[]; +getargs(char *av[]) { if (!*++av) { (void) fprintf(stderr, "usage: unstr datafile\n"); @@ -127,8 +124,7 @@ getargs(av) } void -order_unstr(tbl) - STRFILE *tbl; +order_unstr(STRFILE *tbl) { unsigned int i; char *sp; diff --git a/hack/hack.shk.c b/hack/hack.shk.c index 3c6f962f..7fa85b74 100644 --- a/hack/hack.shk.c +++ b/hack/hack.shk.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.shk.c,v 1.13 2011/08/07 06:03:45 dholland Exp $ */ +/* $NetBSD: hack.shk.c,v 1.14 2012/06/19 05:46:08 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.shk.c,v 1.13 2011/08/07 06:03:45 dholland Exp $"); +__RCSID("$NetBSD: hack.shk.c,v 1.14 2012/06/19 05:46:08 dholland Exp $"); #endif /* not lint */ #include @@ -1103,8 +1103,7 @@ notonl_ok: /* He is digging in the shop. */ void -shopdig(fall) - int fall; +shopdig(int fall) { if (!fall) { if (u.utraptype == TT_PIT) diff --git a/hack/hack.shknam.c b/hack/hack.shknam.c index e503d449..ef17c94e 100644 --- a/hack/hack.shknam.c +++ b/hack/hack.shknam.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.shknam.c,v 1.7 2009/08/12 07:28:41 dholland Exp $ */ +/* $NetBSD: hack.shknam.c,v 1.8 2012/06/19 05:46:08 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.shknam.c,v 1.7 2009/08/12 07:28:41 dholland Exp $"); +__RCSID("$NetBSD: hack.shknam.c,v 1.8 2012/06/19 05:46:08 dholland Exp $"); #endif /* not lint */ #include "hack.h" @@ -206,13 +206,16 @@ static const struct shk_nx { }; void -findname(nampt, let) - char *nampt; - char let; +findname(char *nampt, int let_i) { const struct shk_nx *p = shk_nx; const char *const *q; int i; + char let; + + /* truncate to "char" width */ + let = let_i; + while (p->x && p->x != let) p++; q = p->xn; diff --git a/morse/morse.c b/morse/morse.c index 70cbe4d1..d5ba3284 100644 --- a/morse/morse.c +++ b/morse/morse.c @@ -1,4 +1,4 @@ -/* $NetBSD: morse.c,v 1.16 2009/08/12 08:11:37 dholland Exp $ */ +/* $NetBSD: morse.c,v 1.17 2012/06/19 05:46:08 dholland Exp $ */ /* * Copyright (c) 1988, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\ #if 0 static char sccsid[] = "@(#)morse.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: morse.c,v 1.16 2009/08/12 08:11:37 dholland Exp $"); +__RCSID("$NetBSD: morse.c,v 1.17 2012/06/19 05:46:08 dholland Exp $"); #endif #endif /* not lint */ @@ -119,9 +119,7 @@ static int sflag; static int dflag; int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch; char *p; @@ -201,8 +199,7 @@ main(argc, argv) } void -decode(s) - const char *s; +decode(const char *s) { int i; @@ -231,8 +228,7 @@ decode(s) } void -morse(c) - int c; +morse(int c) { int i; @@ -255,8 +251,7 @@ morse(c) } void -show(s) - const char *s; +show(const char *s) { if (sflag) printf(" %s", s); diff --git a/number/number.c b/number/number.c index 3d28455c..5cf41705 100644 --- a/number/number.c +++ b/number/number.c @@ -1,4 +1,4 @@ -/* $NetBSD: number.c,v 1.14 2010/05/13 17:52:11 tnozaki Exp $ */ +/* $NetBSD: number.c,v 1.15 2012/06/19 05:46:09 dholland Exp $ */ /* * Copyright (c) 1988, 1993, 1994 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\ #if 0 static char sccsid[] = "@(#)number.c 8.3 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: number.c,v 1.14 2010/05/13 17:52:11 tnozaki Exp $"); +__RCSID("$NetBSD: number.c,v 1.15 2012/06/19 05:46:09 dholland Exp $"); #endif #endif /* not lint */ @@ -86,9 +86,7 @@ static void usage(void) __dead; static int lflag; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch, first; char line[256]; @@ -125,8 +123,7 @@ main(argc, argv) } void -convert(line) - char *line; +convert(char *line) { int flen, len, rval; char *p, *fraction; @@ -194,9 +191,7 @@ badnum: errx(1, "illegal number: %s", line); } int -unit(len, p) - int len; - const char *p; +unit(int len, const char *p) { int off, rval; @@ -230,9 +225,7 @@ unit(len, p) } int -number(p, len) - const char *p; - int len; +number(const char *p, int len) { int val, rval; @@ -270,8 +263,7 @@ number(p, len) } void -pfract(len) - int len; +pfract(int len) { static const char *const pref[] = { "", "ten-", "hundred-" }; @@ -289,7 +281,7 @@ pfract(len) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: number [# ...]\n"); exit(1); diff --git a/pig/pig.c b/pig/pig.c index e716efa8..a127ac74 100644 --- a/pig/pig.c +++ b/pig/pig.c @@ -1,4 +1,4 @@ -/* $NetBSD: pig.c,v 1.14 2009/08/12 08:22:24 dholland Exp $ */ +/* $NetBSD: pig.c,v 1.15 2012/06/19 05:46:09 dholland Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1992, 1993\ #if 0 static char sccsid[] = "@(#)pig.c 8.2 (Berkeley) 5/4/95"; #else -__RCSID("$NetBSD: pig.c,v 1.14 2009/08/12 08:22:24 dholland Exp $"); +__RCSID("$NetBSD: pig.c,v 1.15 2012/06/19 05:46:09 dholland Exp $"); #endif #endif /* not lint */ @@ -57,9 +57,7 @@ static void pigout(char *, int); static void usage(void) __dead; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int len; int ch; @@ -91,9 +89,7 @@ main(argc, argv) } static 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) } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: pig\n"); exit(1); diff --git a/snake/snake/snake.c b/snake/snake/snake.c index 7fedf522..2223c931 100644 --- a/snake/snake/snake.c +++ b/snake/snake/snake.c @@ -1,4 +1,4 @@ -/* $NetBSD: snake.c,v 1.27 2010/12/05 04:34:22 pgoyette Exp $ */ +/* $NetBSD: snake.c,v 1.28 2012/06/19 05:46:09 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #if 0 static char sccsid[] = "@(#)snake.c 8.2 (Berkeley) 1/7/94"; #else -__RCSID("$NetBSD: snake.c,v 1.27 2010/12/05 04:34:22 pgoyette Exp $"); +__RCSID("$NetBSD: snake.c,v 1.28 2012/06/19 05:46:09 dholland Exp $"); #endif #endif /* not lint */ @@ -135,12 +135,8 @@ static void suspend(void); static void win(const struct point *); static void winnings(int); -int main(int, char **); - int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int ch, i; time_t tv; @@ -251,9 +247,7 @@ main(argc, argv) } static struct point * -point(ps, x, y) - struct point *ps; - int x, y; +point(struct point *ps, int x, int y) { ps->col = x; ps->line = y; @@ -262,7 +256,7 @@ point(ps, x, y) /* Main command loop */ static void -mainloop() +mainloop(void) { int k; int repeat = 1; @@ -451,7 +445,7 @@ mainloop() * setup the board */ static void -setup() +setup(void) { int i; @@ -468,7 +462,7 @@ setup() } static void -drawbox() +drawbox(void) { int i; @@ -483,8 +477,7 @@ drawbox() } static void -snrand(sp) - struct point *sp; +snrand(struct point *sp) { struct point p; int i; @@ -513,8 +506,7 @@ snrand(sp) } static int -post(iscore, flag) - int iscore, flag; +post(int iscore, int flag) { short score = iscore; short uid; @@ -588,7 +580,7 @@ post(iscore, flag) * if the terminal gets behind. */ static void -flushi() +flushi(void) { tcflush(0, TCIFLUSH); } @@ -605,8 +597,7 @@ static const float absv[8] = { static int oldw = 0; static 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; @@ -667,8 +658,7 @@ chase(np, sp) } static void -spacewarp(w) - int w; +spacewarp(int w) { struct point p; int j; @@ -701,7 +691,7 @@ spacewarp(w) } static void -snap() +snap(void) { #if 0 /* This code doesn't really make sense. */ struct point p; @@ -748,8 +738,7 @@ snap() } static int -stretch(ps) - const struct point *ps; +stretch(const struct point *ps) { struct point p; @@ -796,8 +785,7 @@ stretch(ps) } static void -surround(ps) - struct point *ps; +surround(struct point *ps) { int j; @@ -840,8 +828,7 @@ surround(ps) } static void -win(ps) - const struct point *ps; +win(const struct point *ps) { struct point x; int j, k; @@ -873,7 +860,7 @@ win(ps) } static int -pushsnake() +pushsnake(void) { int i, bonus; int issame = 0; @@ -930,8 +917,7 @@ pushsnake() } static int -chk(sp) - const struct point *sp; +chk(const struct point *sp) { int j; @@ -968,8 +954,7 @@ chk(sp) } static void -winnings(won) - int won; +winnings(int won) { if (won > 0) { mvprintw(1, 1, "$%d", won); @@ -977,8 +962,7 @@ winnings(won) } static void -stop(dummy) - int dummy __unused; +stop(int dummy __unused) { signal(SIGINT, SIG_IGN); endwin(); @@ -987,7 +971,7 @@ stop(dummy) } static void -suspend() +suspend(void) { endwin(); kill(getpid(), SIGTSTP); @@ -996,15 +980,13 @@ suspend() } static void -length(num) - int num; +length(int num) { printf("You made %d moves.\n", num); } static void -logit(msg) - const char *msg; +logit(const char *msg) { time_t t; diff --git a/snake/snscore/snscore.c b/snake/snscore/snscore.c index 74c840db..ee8cd2f4 100644 --- a/snake/snscore/snscore.c +++ b/snake/snscore/snscore.c @@ -1,4 +1,4 @@ -/* $NetBSD: snscore.c,v 1.18 2009/08/12 08:48:56 dholland Exp $ */ +/* $NetBSD: snscore.c,v 1.19 2012/06/19 05:46:09 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #if 0 static char sccsid[] = "@(#)snscore.c 8.1 (Berkeley) 7/19/93"; #else -__RCSID("$NetBSD: snscore.c,v 1.18 2009/08/12 08:48:56 dholland Exp $"); +__RCSID("$NetBSD: snscore.c,v 1.19 2012/06/19 05:46:09 dholland Exp $"); #endif #endif /* not lint */ @@ -66,7 +66,7 @@ static struct player players[MAXPLAYERS], temp; int main(void); int -main() +main(void) { short uid, score; FILE *fd; diff --git a/worms/worms.c b/worms/worms.c index 03c26f3b..b69ec125 100644 --- a/worms/worms.c +++ b/worms/worms.c @@ -1,4 +1,4 @@ -/* $NetBSD: worms.c,v 1.21 2011/08/31 16:24:56 plunky Exp $ */ +/* $NetBSD: worms.c,v 1.22 2012/06/19 05:46:09 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\ #if 0 static char sccsid[] = "@(#)worms.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: worms.c,v 1.21 2011/08/31 16:24:56 plunky Exp $"); +__RCSID("$NetBSD: worms.c,v 1.22 2012/06/19 05:46:09 dholland Exp $"); #endif #endif /* not lint */ @@ -184,9 +184,7 @@ static void nomem(void) __dead; static void onsig(int); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int x, y, h, n; struct worm *w; @@ -340,14 +338,13 @@ main(argc, argv) } static void -onsig(signo) - int signo __unused; +onsig(int signo __unused) { sig_caught = 1; } static void -nomem() +nomem(void) { errx(1, "not enough memory."); } diff --git a/wump/wump.c b/wump/wump.c index 559ebc9b..0175bb05 100644 --- a/wump/wump.c +++ b/wump/wump.c @@ -1,4 +1,4 @@ -/* $NetBSD: wump.c,v 1.29 2011/09/01 07:18:51 plunky Exp $ */ +/* $NetBSD: wump.c,v 1.30 2012/06/19 05:46:09 dholland Exp $ */ /* * Copyright (c) 1989, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\ #if 0 static char sccsid[] = "@(#)wump.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: wump.c,v 1.29 2011/09/01 07:18:51 plunky Exp $"); +__RCSID("$NetBSD: wump.c,v 1.30 2012/06/19 05:46:09 dholland Exp $"); #endif #endif /* not lint */ @@ -138,9 +138,7 @@ static void wump_kill(void); static int wump_nearby(void); int -main(argc, argv) - int argc; - char **argv; +main(int argc, char **argv) { int c, e=0; @@ -255,7 +253,7 @@ quiver holds %d custom super anti-evil Wumpus arrows. Good luck.\n", } static void -display_room_stats() +display_room_stats(void) { int i; @@ -285,7 +283,7 @@ display_room_stats() } static int -take_action() +take_action(void) { /* * Do the action specified by the player, either 'm'ove, 's'hoot @@ -314,8 +312,7 @@ take_action() } static 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; @@ -406,8 +403,7 @@ move_to(room_number) } static int -shoot(room_list) - char *room_list; +shoot(char *room_list) { int chance, next, roomcnt; int j, arrow_location, lnk, ok; @@ -519,8 +515,7 @@ The arrow is weakly shot and can go no further!\n"); } static int -gcd(a, b) - int a, b; +gcd(int a, int b) { int r; @@ -531,7 +526,7 @@ gcd(a, b) } static void -cave_init() +cave_init(void) { int i, j, k, lnk; int delta; @@ -611,7 +606,7 @@ try_again: lnk = (random() % room_num) + 1; } static void -clear_things_in_cave() +clear_things_in_cave(void) { int i; @@ -624,7 +619,7 @@ clear_things_in_cave() } static void -initialize_things_in_cave() +initialize_things_in_cave(void) { int i, loc; @@ -668,8 +663,7 @@ initialize_things_in_cave() } static int -getans(prompt) - const char *prompt; +getans(const char *prompt) { char buf[20]; @@ -694,7 +688,7 @@ getans(prompt) } static int -bats_nearby() +bats_nearby(void) { int i; @@ -706,7 +700,7 @@ bats_nearby() } static int -pit_nearby() +pit_nearby(void) { int i; @@ -718,7 +712,7 @@ pit_nearby() } static int -wump_nearby() +wump_nearby(void) { int i, j; @@ -735,20 +729,19 @@ wump_nearby() } static void -move_wump() +move_wump(void) { wumpus_loc = cave[wumpus_loc].tunnel[random() % link_num]; } static int -int_compare(a, b) - const void *a, *b; +int_compare(const void *a, const void *b) { return(*(const int *)a < *(const int *)b ? -1 : 1); } static void -instructions() +instructions(void) { const char *pager; pid_t pid; @@ -792,7 +785,7 @@ puff of greasy black smoke! (poof)\n"); } static void -usage() +usage(void) { (void)fprintf(stderr, "usage: wump [-h] [-a arrows] [-b bats] [-p pits] [-r rooms] [-t tunnels]\n"); @@ -802,7 +795,7 @@ usage() /* messages */ static void -wump_kill() +wump_kill(void) { (void)printf( "*ROAR* *chomp* *snurfle* *chomp*!\n\ @@ -814,7 +807,7 @@ passed out from the stench!\n"); } static void -kill_wump() +kill_wump(void) { (void)printf( "*thwock!* *groan* *crash*\n\n\ @@ -826,7 +819,7 @@ mightiest adventurer at a single whiff!!\n"); } static void -no_arrows() +no_arrows(void) { (void)printf( "\nYou turn and look at your quiver, and realize with a sinking feeling\n\ @@ -836,7 +829,7 @@ you, and with a mighty *ROAR* eats you alive!\n"); } static void -shoot_self() +shoot_self(void) { (void)printf( "\n*Thwack!* A sudden piercing feeling informs you that the ricochet\n\ @@ -847,8 +840,7 @@ and immediately rushes to your side, not to help, alas, but to EAT YOU!\n\ } static void -jump(where) - int where; +jump(int where) { (void)printf( "\nWith a jaunty step you enter the magic tunnel. As you do, you\n\ @@ -857,7 +849,7 @@ a very curious, warm sensation and find yourself in room %d!!\n", where); } static void -pit_kill() +pit_kill(void) { (void)printf( "*AAAUUUUGGGGGHHHHHhhhhhhhhhh...*\n\ @@ -869,7 +861,7 @@ you can at least find out if Jules Verne was right...\n"); } static void -pit_survive() +pit_survive(void) { (void)printf( "Without conscious thought you grab for the side of the cave and manage\n\ -- cgit v1.2.3-56-ge451