summaryrefslogtreecommitdiffstats
path: root/fish/fish.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-08-12 05:48:04 +0000
committerdholland <dholland@NetBSD.org>2009-08-12 05:48:04 +0000
commitba1cf76ebd685f2689baa5790f261a8378a56aa3 (patch)
tree047797bfd77fe77c98c1307188f7894bb980844e /fish/fish.c
parentae271365b029dbf18dbdc93763cb6fda6db7f559 (diff)
downloadbsdgames-darwin-ba1cf76ebd685f2689baa5790f261a8378a56aa3.tar.gz
bsdgames-darwin-ba1cf76ebd685f2689baa5790f261a8378a56aa3.tar.zst
bsdgames-darwin-ba1cf76ebd685f2689baa5790f261a8378a56aa3.zip
sprinkle static
Diffstat (limited to 'fish/fish.c')
-rw-r--r--fish/fish.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/fish/fish.c b/fish/fish.c
index becedf6a..f029e4dc 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fish.c,v 1.19 2008/07/20 01:03:21 lukem Exp $ */
+/* $NetBSD: fish.c,v 1.20 2009/08/12 05:55:53 dholland Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993\
#if 0
static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fish.c,v 1.19 2008/07/20 01:03:21 lukem Exp $");
+__RCSID("$NetBSD: fish.c,v 1.20 2009/08/12 05:55:53 dholland Exp $");
#endif
#endif /* not lint */
@@ -67,32 +67,32 @@ __RCSID("$NetBSD: fish.c,v 1.19 2008/07/20 01:03:21 lukem Exp $");
#define COMPUTER 0
#define OTHER(a) (1 - (a))
-const char *const cards[] = {
+static const char *const cards[] = {
"A", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "J", "Q", "K", NULL,
};
#define PRC(card) (void)printf(" %s", cards[card])
-int promode;
-int asked[RANKS], comphand[RANKS], deck[TOTCARDS];
-int userasked[RANKS], userhand[RANKS];
-int curcard = TOTCARDS;
-
-void chkwinner(int, const int *);
-int compmove(void);
-int countbooks(const int *);
-int countcards(const int *);
-int drawcard(int, int *);
-int gofish(int, int, int *);
-void goodmove(int, int, int *, int *);
-void init(void);
-void instructions(void);
-int nrandom(int);
-void printhand(const int *);
-void printplayer(int);
-int promove(void);
-void usage(void) __dead;
-int usermove(void);
+static int promode;
+static int asked[RANKS], comphand[RANKS], deck[TOTCARDS];
+static int userasked[RANKS], userhand[RANKS];
+static int curcard = TOTCARDS;
+
+static void chkwinner(int, const int *);
+static int compmove(void);
+static int countbooks(const int *);
+static int countcards(const int *);
+static int drawcard(int, int *);
+static int gofish(int, int, int *);
+static void goodmove(int, int, int *, int *);
+static void init(void);
+static void instructions(void);
+static int nrandom(int);
+static void printhand(const int *);
+static void printplayer(int);
+static int promove(void);
+static void usage(void) __dead;
+static int usermove(void);
int
main(int argc, char **argv)
@@ -146,7 +146,7 @@ istart: for (;;) {
/* NOTREACHED */
}
-int
+static int
usermove(void)
{
int n;
@@ -201,7 +201,7 @@ usermove(void)
/* NOTREACHED */
}
-int
+static int
compmove(void)
{
static int lmove;
@@ -219,7 +219,7 @@ compmove(void)
return(lmove);
}
-int
+static int
promove(void)
{
int i, max;
@@ -258,7 +258,7 @@ promove(void)
/* NOTREACHED */
}
-int
+static int
drawcard(int player, int *hand)
{
int card;
@@ -277,7 +277,7 @@ drawcard(int player, int *hand)
return(card);
}
-int
+static int
gofish(int askedfor, int player, int *hand)
{
printplayer(OTHER(player));
@@ -292,7 +292,7 @@ gofish(int askedfor, int player, int *hand)
return(0);
}
-void
+static void
goodmove(int player, int move, int *hand, int *opphand)
{
printplayer(OTHER(player));
@@ -314,7 +314,7 @@ goodmove(int player, int move, int *hand, int *opphand)
(void)printf("get another guess!\n");
}
-void
+static void
chkwinner(int player, const int *hand)
{
int cb, i, ub;
@@ -342,7 +342,7 @@ chkwinner(int player, const int *hand)
exit(0);
}
-void
+static void
printplayer(int player)
{
switch (player) {
@@ -355,7 +355,7 @@ printplayer(int player)
}
}
-void
+static void
printhand(const int *hand)
{
int book, i, j;
@@ -375,7 +375,7 @@ printhand(const int *hand)
(void)putchar('\n');
}
-int
+static int
countcards(const int *hand)
{
int i, count;
@@ -385,7 +385,7 @@ countcards(const int *hand)
return(count);
}
-int
+static int
countbooks(const int *hand)
{
int i, count;
@@ -401,7 +401,7 @@ countbooks(const int *hand)
return(count);
}
-void
+static void
init(void)
{
int i, j, temp;
@@ -422,14 +422,14 @@ init(void)
}
}
-int
+static int
nrandom(int n)
{
return((int)random() % n);
}
-void
+static void
instructions(void)
{
int input;
@@ -470,7 +470,7 @@ instructions(void)
while ((input = getchar()) != EOF && input != '\n');
}
-void
+static void
usage(void)
{
(void)fprintf(stderr, "usage: fish [-p]\n");