Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games WARNS=5, and make WARNS=5 the default for src/games.



details:   https://anonhg.NetBSD.org/src/rev/c9591a10b874
branches:  trunk
changeset: 779787:c9591a10b874
user:      dholland <dholland%NetBSD.org@localhost>
date:      Tue Jun 19 05:46:08 2012 +0000

description:
WARNS=5, and make WARNS=5 the default for src/games.

diffstat:

 games/Makefile.inc              |   4 +-
 games/arithmetic/arithmetic.c   |  23 +++++--------
 games/battlestar/command1.c     |   6 +-
 games/battlestar/command5.c     |   6 +-
 games/fortune/fortune/fortune.c |   7 +--
 games/fortune/unstr/unstr.c     |  14 +++-----
 games/hack/hack.shk.c           |   7 +--
 games/hack/hack.shknam.c        |  13 +++++---
 games/morse/morse.c             |  17 +++-------
 games/number/number.c           |  24 +++++----------
 games/pig/pig.c                 |  14 +++-----
 games/snake/snake/snake.c       |  64 ++++++++++++++--------------------------
 games/snake/snscore/snscore.c   |   6 +-
 games/worms/worms.c             |  13 +++-----
 games/wump/wump.c               |  60 ++++++++++++++++---------------------
 15 files changed, 112 insertions(+), 166 deletions(-)

diffs (truncated from 1020 to 300 lines):

diff -r 6b5c4bb47b54 -r c9591a10b874 games/Makefile.inc
--- a/games/Makefile.inc        Tue Jun 19 05:45:00 2012 +0000
+++ b/games/Makefile.inc        Tue Jun 19 05:46:08 2012 +0000
@@ -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 @@
 BINMODE=       2555
 .endif
 .endif
-WARNS?=                4
+WARNS?=                5
diff -r 6b5c4bb47b54 -r c9591a10b874 games/arithmetic/arithmetic.c
--- a/games/arithmetic/arithmetic.c     Tue Jun 19 05:45:00 2012 +0000
+++ b/games/arithmetic/arithmetic.c     Tue Jun 19 05:46:08 2012 +0000
@@ -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 @@
 #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 @@
 
 /* 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 @@
 
 /* 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 @@
  * more likely to appear in subsequent problems.
  */
 static int
-problem()
+problem(void)
 {
        char *p;
        time_t start, finish;
@@ -303,8 +301,7 @@
  * 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 @@
  * 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 @@
 
 /* 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 @@
 
 /* Print usage message and quit. */
 static void
-usage()
+usage(void)
 {
        (void)fprintf(stderr, "Usage: %s [-o +-x/] [-r range]\n",
                getprogname());
diff -r 6b5c4bb47b54 -r c9591a10b874 games/battlestar/command1.c
--- a/games/battlestar/command1.c       Tue Jun 19 05:45:00 2012 +0000
+++ b/games/battlestar/command1.c       Tue Jun 19 05:46:08 2012 +0000
@@ -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 @@
 }
 
 void
-news()
+news(void)
 {
        int     n;
        int     hurt;
diff -r 6b5c4bb47b54 -r c9591a10b874 games/battlestar/command5.c
--- a/games/battlestar/command5.c       Tue Jun 19 05:45:00 2012 +0000
+++ b/games/battlestar/command5.c       Tue Jun 19 05:46:08 2012 +0000
@@ -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 -r 6b5c4bb47b54 -r c9591a10b874 games/fortune/fortune/fortune.c
--- a/games/fortune/fortune/fortune.c   Tue Jun 19 05:45:00 2012 +0000
+++ b/games/fortune/fortune/fortune.c   Tue Jun 19 05:46:08 2012 +0000
@@ -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 @@
 #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 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 -r 6b5c4bb47b54 -r c9591a10b874 games/fortune/unstr/unstr.c
--- a/games/fortune/unstr/unstr.c       Tue Jun 19 05:45:00 2012 +0000
+++ b/games/fortune/unstr/unstr.c       Tue Jun 19 05:46:08 2012 +0000
@@ -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 @@
 #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 @@
 
 /* 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 @@
 }
 
 void
-getargs(av)
-       char    *av[];
+getargs(char *av[])
 {
        if (!*++av) {
                (void) fprintf(stderr, "usage: unstr datafile\n");
@@ -127,8 +124,7 @@
 }
 
 void
-order_unstr(tbl)
-       STRFILE *tbl;
+order_unstr(STRFILE *tbl)
 {
        unsigned int    i;
        char    *sp;
diff -r 6b5c4bb47b54 -r c9591a10b874 games/hack/hack.shk.c
--- a/games/hack/hack.shk.c     Tue Jun 19 05:45:00 2012 +0000
+++ b/games/hack/hack.shk.c     Tue Jun 19 05:46:08 2012 +0000
@@ -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 <sys/cdefs.h>
 #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 <stdlib.h>
@@ -1103,8 +1103,7 @@
 
 /* He is digging in the shop. */
 void
-shopdig(fall)
-       int             fall;
+shopdig(int fall)
 {
        if (!fall) {
                if (u.utraptype == TT_PIT)
diff -r 6b5c4bb47b54 -r c9591a10b874 games/hack/hack.shknam.c
--- a/games/hack/hack.shknam.c  Tue Jun 19 05:45:00 2012 +0000
+++ b/games/hack/hack.shknam.c  Tue Jun 19 05:46:08 2012 +0000
@@ -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 <sys/cdefs.h>
 #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 @@
 };
 
 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 -r 6b5c4bb47b54 -r c9591a10b874 games/morse/morse.c
--- a/games/morse/morse.c       Tue Jun 19 05:45:00 2012 +0000
+++ b/games/morse/morse.c       Tue Jun 19 05:46:08 2012 +0000



Home | Main Index | Thread Index | Old Index