DragonFly BSD
DragonFly submit List (threaded) for 2005-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

[PATCH] games/bcd WARNS6


From: Peter Avalos <pavalos@xxxxxxxxxxxx>
Date: Sun, 31 Jul 2005 21:02:34 -0700

Here's a patch to bring games/bcd to WARNS6.

http://www.theshell.com/~pavalos/wip/bcd.diff

--Peter


Index: games/bcd/Makefile
===================================================================
RCS file: /home/dcvs/src/games/bcd/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- games/bcd/Makefile	17 Jun 2003 04:25:23 -0000	1.2
+++ games/bcd/Makefile	31 Jul 2005 14:41:13 -0000
@@ -5,6 +5,7 @@
 PROG=	bcd
 MAN=	bcd.6
 MLINKS=	bcd.6 ppt.6
+WARNS?=	6
 
 .include <bsd.prog.mk>
 
Index: games/bcd/bcd.c
===================================================================
RCS file: /home/dcvs/src/games/bcd/bcd.c,v
retrieving revision 1.2
diff -u -r1.2 bcd.c
--- games/bcd/bcd.c	17 Jun 2003 04:25:23 -0000	1.2
+++ games/bcd/bcd.c	1 Aug 2005 03:57:19 -0000
@@ -73,8 +73,11 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <unistd.h>
 #include <ctype.h>
 
+static void	printcard(char *);
+
 u_short holes[256] = {
     0x0,	 0x0,	  0x0,	   0x0,	    0x0,     0x0,     0x0,     0x0,
     0x0,	 0x0,	  0x0,	   0x0,	    0x0,     0x0,     0x0,     0x0,
@@ -116,9 +119,7 @@
 #define	bit(w,i)	((w)&(1<<(i)))
 
 int
-main(argc, argv)
-	int argc;
-	char **argv;
+main(int argc, char **argv)
 {
 	char cardline[80];
 
@@ -136,18 +137,17 @@
 	} else
 		while (fgets(cardline, sizeof(cardline), stdin))
 			printcard(cardline);
-	exit(0);
+	return(0);
 }
 
 #define	COLUMNS	48
 
-printcard(str)
-	char *str;
+static void
+printcard(char *str)
 {
 	static char rowchars[] = "   123456789";
 	int i, row;
 	char *p;
-	char *index();
 
 	/* ruthlessly remove newlines and truncate at 48 characters. */
 	if ((p = index(str, '\n')))
@@ -174,7 +174,7 @@
 	p = str;
 	putchar('/');
 	for (i = 1; *p; i++, p++)
-		if (holes[*p])
+		if (holes[(int)*p])
 			putchar(*p);
 		else
 			putchar(' ');
@@ -192,7 +192,7 @@
 	for (row = 0; row <= 11; ++row) {
 		putchar('|');
 		for (i = 0, p = str; *p; i++, p++) {
-			if (bit(holes[*p], 11 - row))
+			if (bit(holes[(int)*p], 11 - row))
 				putchar(']');
 			else
 				putchar(rowchars[row]);

Attachment: pgp00018.pgp
Description: PGP signature



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