[PATCH] games/fish WARNS6

Peter Avalos pavalos at theshell.com
Sun Jul 31 06:46:23 PDT 2005


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

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

--Peter


Index: games/fish/Makefile
===================================================================
RCS file: /home/dcvs/src/games/fish/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- games/fish/Makefile	17 Jun 2003 04:25:23 -0000	1.2
+++ games/fish/Makefile	31 Jul 2005 10:03:12 -0000
@@ -6,5 +6,6 @@
 FILES=	fish.instr
 MAN=	fish.6
 HIDEGAME=hidegame
+WARNS?=	6
 
 .include <bsd.prog.mk>
Index: games/fish/fish.c
===================================================================
RCS file: /home/dcvs/src/games/fish/fish.c,v
retrieving revision 1.3
diff -u -r1.3 fish.c
--- games/fish/fish.c	12 Nov 2003 14:53:53 -0000	1.3
+++ games/fish/fish.c	31 Jul 2005 10:03:12 -0000
@@ -58,7 +58,7 @@
 #define	COMPUTER	0
 #define	OTHER(a)	(1 - (a))
 
-char *cards[] = {
+const char *cards[] = {
 	"A", "2", "3", "4", "5", "6", "7",
 	"8", "9", "10", "J", "Q", "K", NULL,
 };
@@ -85,9 +85,7 @@
 int 	usermove (void);
 
 int
-main(argc, argv)
-	int argc;
-	char **argv;
+main(int argc, char **argv)
 {
 	int ch, move;
 
@@ -138,10 +136,10 @@
 }
 
 int
-usermove()
+usermove(void)
 {
 	int n;
-	char **p;
+	const char **p;
 	char buf[256];
 
 	(void)printf("\nYour hand is:");
@@ -193,7 +191,7 @@
 }
 
 int
-compmove()
+compmove(void)
 {
 	static int lmove;
 
@@ -211,7 +209,7 @@
 }
 
 int
-promove()
+promove(void)
 {
 	int i, max;
 
@@ -250,9 +248,7 @@
 }
 
 int
-drawcard(player, hand)
-	int player;
-	int *hand;
+drawcard(int player, int *hand)
 {
 	int card;
 
@@ -273,9 +269,7 @@
 }
 
 int
-gofish(askedfor, player, hand)
-	int askedfor, player;
-	int *hand;
+gofish(int askedfor, int player, int *hand)
 {
 	printplayer(OTHER(player));
 	(void)printf("say \"GO FISH!\"\n");
@@ -290,9 +284,7 @@
 }
 
 void
-goodmove(player, move, hand, opphand)
-	int player, move;
-	int *hand, *opphand;
+goodmove(int player, int move, int *hand, int *opphand)
 {
 	printplayer(OTHER(player));
 	(void)printf("have %d %s%s.\n",
@@ -314,9 +306,7 @@
 }
 
 void
-chkwinner(player, hand)
-	int player;
-	int *hand;
+chkwinner(int player, int *hand)
 {
 	int cb, i, ub;
 
@@ -344,8 +334,7 @@
 }
 
 void
-printplayer(player)
-	int player;
+printplayer(int player)
 {
 	switch (player) {
 	case COMPUTER:
@@ -358,8 +347,7 @@
 }
 
 void
-printhand(hand)
-	int *hand;
+printhand(int *hand)
 {
 	int book, i, j;
 
@@ -379,8 +367,7 @@
 }
 
 int
-countcards(hand)
-	int *hand;
+countcards(int *hand)
 {
 	int i, count;
 
@@ -390,8 +377,7 @@
 }
 
 int
-countbooks(hand)
-	int *hand;
+countbooks(int *hand)
 {
 	int i, count;
 
@@ -407,7 +393,7 @@
 }
 
 void
-init()
+init(void)
 {
 	int i, rank;
 
@@ -426,15 +412,14 @@
 }
 
 int
-nrandom(n)
-	int n;
+nrandom(int n)
 {
 
 	return((int)random() % n);
 }
 
 void
-instructions()
+instructions(void)
 {
 	int input;
 	char buf[1024];
@@ -452,7 +437,7 @@
 }
 
 void
-usage()
+usage(void)
 {
 	(void)fprintf(stderr, "usage: fish [-p]\n");
 	exit(1);
Attachment:
pgp00015.pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00015.pgp
Type: application/octet-stream
Size: 189 bytes
Desc: "Description: PGP signature"
URL: <http://lists.dragonflybsd.org/pipermail/submit/attachments/20050731/fc6eba18/attachment-0014.obj>


More information about the Submit mailing list