From: | Peter Avalos <pavalos@xxxxxxxxxxxx> |
Date: | Sun, 24 Apr 2005 20:18:13 -0700 |
ANSI function declarations. WARNS6 cleanup. Index: Makefile =================================================================== RCS file: /ftp/pub/DragonFly/dcvs/src/games/number/Makefile,v retrieving revision 1.2 diff -u -r1.2 Makefile --- Makefile 17 Jun 2003 04:25:24 -0000 1.2 +++ Makefile 25 Apr 2005 03:14:54 -0000 @@ -4,5 +4,6 @@ PROG= number MAN= number.6 +WARNS?= 6 .include <bsd.prog.mk> Index: number.c =================================================================== RCS file: /ftp/pub/DragonFly/dcvs/src/games/number/number.c,v retrieving revision 1.3 diff -u -r1.3 number.c --- number.c 12 Nov 2003 14:53:53 -0000 1.3 +++ number.c 25 Apr 2005 03:14:27 -0000 @@ -79,9 +79,7 @@ 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 @@ } void -convert(line) - char *line; +convert(char *line) { int flen, len, rval; char *p, *fraction; @@ -187,9 +184,7 @@ } int -unit(len, p) - int len; - char *p; +unit(int len, char *p) { int off, rval; @@ -223,9 +218,7 @@ } int -number(p, len) - char *p; - int len; +number(char *p, int len) { int val, rval; @@ -263,10 +256,9 @@ } 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 @@ } void -usage() +usage(void) { (void)fprintf(stderr, "usage: number [# ...]\n"); exit(1);
Attachment:
pgp00004.pgp
Description: PGP signature