From: Liam J. Foy Date: Mon, 25 Apr 2005 16:10:25 +0000 (+0000) Subject: - ANSI X-Git-Tag: v2.0.1~7688 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/e1acdbad00d85a4b20bae899794c73b4474aeafb - ANSI - WARNS 6 Submitted by: Peter Avalos --- diff --git a/games/morse/Makefile b/games/morse/Makefile index d8c730d0d1..9d580a7885 100644 --- a/games/morse/Makefile +++ b/games/morse/Makefile @@ -1,9 +1,10 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD: src/games/morse/Makefile,v 1.4.6.5 2001/04/25 09:28:58 ru Exp $ -# $DragonFly: src/games/morse/Makefile,v 1.2 2003/06/17 04:25:24 dillon Exp $ +# $DragonFly: src/games/morse/Makefile,v 1.3 2005/04/25 16:10:24 liamfoy Exp $ PROG= morse MAN= morse.6 +WARNS?= 6 .if ${MACHINE_ARCH} == "i386" CFLAGS += -DSPEAKER=\"/dev/speaker\" diff --git a/games/morse/morse.c b/games/morse/morse.c index 0baff15119..07a82d90dd 100644 --- a/games/morse/morse.c +++ b/games/morse/morse.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)morse.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/morse/morse.c,v 1.12.2.2 2002/03/12 17:45:15 phantom Exp $ - * $DragonFly: src/games/morse/morse.c,v 1.2 2003/06/17 04:25:24 dillon Exp $ + * $DragonFly: src/games/morse/morse.c,v 1.3 2005/04/25 16:10:24 liamfoy Exp $ */ /* @@ -60,7 +60,7 @@ struct morsetab { char inchar; - char *morse; + const char *morse; }; static const struct morsetab mtab[] = { diff --git a/games/number/Makefile b/games/number/Makefile index cc20e9d998..9ab15dd141 100644 --- a/games/number/Makefile +++ b/games/number/Makefile @@ -1,8 +1,9 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD: src/games/number/Makefile,v 1.2.6.1 2001/04/25 09:28:59 ru Exp $ -# $DragonFly: src/games/number/Makefile,v 1.2 2003/06/17 04:25:24 dillon Exp $ +# $DragonFly: src/games/number/Makefile,v 1.3 2005/04/25 16:10:24 liamfoy Exp $ PROG= number MAN= number.6 +WARNS?= 6 .include diff --git a/games/number/number.c b/games/number/number.c index b3a303ba8e..a1178587ce 100644 --- a/games/number/number.c +++ b/games/number/number.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)number.c 8.3 (Berkeley) 5/4/95 * $FreeBSD: src/games/number/number.c,v 1.12 1999/12/12 03:22:35 billf Exp $ - * $DragonFly: src/games/number/number.c,v 1.3 2003/11/12 14:53:53 eirikn Exp $ + * $DragonFly: src/games/number/number.c,v 1.4 2005/04/25 16:10:24 liamfoy Exp $ */ #include @@ -79,9 +79,7 @@ void usage (void); int lflag; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch, first; char line[256]; @@ -118,8 +116,7 @@ main(argc, argv) } void -convert(line) - char *line; +convert(char *line) { int flen, len, rval; char *p, *fraction; @@ -187,9 +184,7 @@ badnum: errx(1, "illegal number: %s", line); } int -unit(len, p) - int len; - char *p; +unit(int len, char *p) { int off, rval; @@ -223,9 +218,7 @@ unit(len, p) } int -number(p, len) - char *p; - int len; +number(char *p, int len) { int val, rval; @@ -263,10 +256,9 @@ number(p, len) } void -pfract(len) - int len; +pfract(int len) { - static char *pref[] = { "", "ten-", "hundred-" }; + static const char *pref[] = { "", "ten-", "hundred-" }; switch(len) { case 1: @@ -282,7 +274,7 @@ pfract(len) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: number [# ...]\n"); exit(1); diff --git a/games/pig/Makefile b/games/pig/Makefile index aa967e78a4..ab7413567c 100644 --- a/games/pig/Makefile +++ b/games/pig/Makefile @@ -1,8 +1,9 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD: src/games/pig/Makefile,v 1.2.6.1 2001/04/25 09:29:00 ru Exp $ -# $DragonFly: src/games/pig/Makefile,v 1.2 2003/06/17 04:25:24 dillon Exp $ +# $DragonFly: src/games/pig/Makefile,v 1.3 2005/04/25 16:10:24 liamfoy Exp $ PROG= pig MAN= pig.6 +WARNS?= 6 .include diff --git a/games/pig/pig.c b/games/pig/pig.c index e84c6c1425..7265339fe0 100644 --- a/games/pig/pig.c +++ b/games/pig/pig.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1992, 1993 The Regents of the University of California. All rights reserved. * @(#)pig.c 8.2 (Berkeley) 5/4/95 * $FreeBSD: src/games/pig/pig.c,v 1.7 1999/11/30 03:49:08 billf Exp $ - * $DragonFly: src/games/pig/pig.c,v 1.3 2003/11/12 14:53:53 eirikn Exp $ + * $DragonFly: src/games/pig/pig.c,v 1.4 2005/04/25 16:10:24 liamfoy Exp $ */ #include @@ -48,9 +48,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; @@ -67,7 +65,7 @@ main(argc, argv) for (len = 0; (ch = getchar()) != EOF;) { if (isalpha(ch)) { - if (len >= sizeof(buf)) { + if (len >= (int)sizeof(buf)) { (void)fprintf(stderr, "pig: ate too much!\n"); exit(1); } @@ -84,9 +82,7 @@ main(argc, argv) } void -pigout(buf, len) - char *buf; - int len; +pigout(char *buf, int len) { int ch, start; int olen; @@ -115,7 +111,7 @@ pigout(buf, len) } void -usage() +usage(void) { (void)fprintf(stderr, "usage: pig\n"); exit(1); diff --git a/games/primes/Makefile b/games/primes/Makefile index edf216f863..f8982b4f69 100644 --- a/games/primes/Makefile +++ b/games/primes/Makefile @@ -1,9 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 +# $DragonFly: src/games/primes/Makefile,v 1.2 2005/04/25 16:10:24 liamfoy Exp $ PROG= primes SRCS= pattern.c pr_tbl.c primes.c NOMAN= noman DPADD= ${LIBM} LDADD= -lm +WARNS?= 6 .include diff --git a/games/quiz/Makefile b/games/quiz/Makefile index 1e80b12e19..2a65bd017d 100644 --- a/games/quiz/Makefile +++ b/games/quiz/Makefile @@ -1,6 +1,6 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD: src/games/quiz/Makefile,v 1.5.6.3 2002/02/18 16:02:43 ru Exp $ -# $DragonFly: src/games/quiz/Makefile,v 1.2 2003/06/17 04:25:24 dillon Exp $ +# $DragonFly: src/games/quiz/Makefile,v 1.3 2005/04/25 16:10:24 liamfoy Exp $ PROG= quiz SRCS= quiz.c rxp.c @@ -11,6 +11,7 @@ FILES= africa america areas arith asia babies bard chinese collectives \ sexes sov spell state trek ucc FILESDIR= ${SHAREDIR}/games/quiz.db HIDEGAME=hidegame +WARNS?= 6 .PATH: ${.CURDIR}/datfiles diff --git a/games/quiz/quiz.c b/games/quiz/quiz.c index bc3388089b..50117f316f 100644 --- a/games/quiz/quiz.c +++ b/games/quiz/quiz.c @@ -37,7 +37,7 @@ * @(#) Copyright (c) 1991, 1993 The Regents of the University of California. All rights reserved. * @(#)quiz.c 8.3 (Berkeley) 5/4/95 * $FreeBSD: src/games/quiz/quiz.c,v 1.12 1999/12/12 02:29:54 billf Exp $ - * $DragonFly: src/games/quiz/quiz.c,v 1.4 2004/07/27 07:37:39 asmodai Exp $ + * $DragonFly: src/games/quiz/quiz.c,v 1.5 2005/04/25 16:10:24 liamfoy Exp $ */ #include @@ -61,7 +61,7 @@ char *appdstr (char *, char *, size_t); void downcase (char *); void err (const char *, ...); void get_cats (char *, char *); -void get_file (char *); +void get_file (const char *); char *next_cat (char *); void quiz (void); void score (u_int, u_int, u_int); @@ -69,12 +69,10 @@ void show_index (void); void usage (void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char **argv) { int ch; - char *indexfile; + const char *indexfile; /* revoke */ setgid(getgid()); @@ -112,8 +110,7 @@ main(argc, argv) } void -get_file(file) - char *file; +get_file(const char *file) { FILE *fp; QE *qp; @@ -149,7 +146,7 @@ get_file(file) } void -show_index() +show_index(void) { QE *qp; char *p, *s; @@ -175,8 +172,7 @@ show_index() } void -get_cats(cat1, cat2) - char *cat1, *cat2; +get_cats(char *cat1, char *cat2) { QE *qp; int i; @@ -208,7 +204,7 @@ get_cats(cat1, cat2) } void -quiz() +quiz(void) { QE *qp; int i; @@ -289,8 +285,7 @@ quiz() } char * -next_cat(s) - char * s; +next_cat(char *s) { for (;;) switch (*s++) { @@ -306,10 +301,7 @@ next_cat(s) } char * -appdstr(s, tp, len) - char *s; - char *tp; - size_t len; +appdstr(char *s, char *tp, size_t len) { char *mp, *sp; char *m; @@ -333,8 +325,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) @@ -343,8 +334,7 @@ score(r, w, g) } void -downcase(p) - char *p; +downcase(char *p) { int ch; @@ -354,7 +344,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 cb580e0df6..bd719ec70d 100644 --- a/games/quiz/rxp.c +++ b/games/quiz/rxp.c @@ -36,7 +36,7 @@ * * @(#)rxp.c 8.1 (Berkeley) 5/31/93 * $FreeBSD: src/games/quiz/rxp.c,v 1.5 1999/12/12 02:29:54 billf Exp $ - * $DragonFly: src/games/quiz/rxp.c,v 1.3 2003/11/12 14:53:54 eirikn Exp $ + * $DragonFly: src/games/quiz/rxp.c,v 1.4 2005/04/25 16:10:24 liamfoy Exp $ */ /* @@ -83,16 +83,13 @@ static char *rxp__expand (int); static int rxp__match (char *, int, Rxp_t *, Rxp_t *, char *); int -rxp_compile(s) - char * s; +rxp_compile(char *s) { return (rxp__compile(s, TRUE)); } static int -rxp__compile(s, first) - char *s; - int first; +rxp__compile(char *s, int first) { static Rxp_t *rp; static char *sp; @@ -188,19 +185,18 @@ rxp__compile(s, first) * match string against compiled regular expression */ int -rxp_match(s) - char * s; +rxp_match(char *s) { return (rxp__match(s, TRUE, NULL, NULL, NULL)); } +/* + * jump to j_succ on successful alt match + * jump to j_fail on failed match + * reset sp to sp_fail on failed match + */ static int -rxp__match(s, first, j_succ, j_fail, sp_fail) - char *s; - int first; - Rxp_t *j_succ; /* jump here on successful alt match */ - Rxp_t *j_fail; /* jump here on failed match */ - char *sp_fail; /* reset sp to here on failed match */ +rxp__match(char *s, int first, Rxp_t *j_succ, Rxp_t *j_fail, char *sp_fail) { static Rxp_t *rp; static char *sp; @@ -259,14 +255,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/Makefile b/games/rain/Makefile index ebf03497fb..d59a3f360c 100644 --- a/games/rain/Makefile +++ b/games/rain/Makefile @@ -1,9 +1,10 @@ # @(#)Makefile 8.1 (Berkeley) 5/31/93 # $FreeBSD: src/games/rain/Makefile,v 1.5.2.1 2001/04/25 09:29:01 ru Exp $ -# $DragonFly: src/games/rain/Makefile,v 1.2 2003/06/17 04:25:24 dillon Exp $ +# $DragonFly: src/games/rain/Makefile,v 1.3 2005/04/25 16:10:25 liamfoy Exp $ PROG= rain MAN= rain.6 +WARNS?= 6 DPADD= ${LIBCURSES} ${LIBTERMCAP} LDADD= -lcurses -ltermcap