summaryrefslogtreecommitdiffstats
path: root/fish
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>1999-09-08 21:17:44 +0000
committerjsm <jsm@NetBSD.org>1999-09-08 21:17:44 +0000
commit04f4d7044367099914cf1906ae27ac20c24e44cf (patch)
treec17cb5c2f270bbb70eeba18cbe2bcfa43cfd8e10 /fish
parentf9706028dd6e2afabb6bd63d02d7bc90f78e4aab (diff)
downloadbsdgames-darwin-04f4d7044367099914cf1906ae27ac20c24e44cf.tar.gz
bsdgames-darwin-04f4d7044367099914cf1906ae27ac20c24e44cf.tar.zst
bsdgames-darwin-04f4d7044367099914cf1906ae27ac20c24e44cf.zip
Add use of `const' where appropriate to the games.
This merges in all such remaining changes from the Linux port of the NetBSD games, except in hunt (where substantial changes from OpenBSD need to be looked at). Some such changes were previously covered in PRs bin/6041, bin/6146, bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994, bin/8039, bin/8057 and bin/8093.
Diffstat (limited to 'fish')
-rw-r--r--fish/fish.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fish/fish.c b/fish/fish.c
index 3775e50f..1ce39130 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fish.c,v 1.8 1999/07/14 17:30:21 hubertf Exp $ */
+/* $NetBSD: fish.c,v 1.9 1999/09/08 21:17:48 jsm Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1990, 1993\n\
#if 0
static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fish.c,v 1.8 1999/07/14 17:30:21 hubertf Exp $");
+__RCSID("$NetBSD: fish.c,v 1.9 1999/09/08 21:17:48 jsm Exp $");
#endif
#endif /* not lint */
@@ -70,7 +70,7 @@ __RCSID("$NetBSD: fish.c,v 1.8 1999/07/14 17:30:21 hubertf Exp $");
#define COMPUTER 0
#define OTHER(a) (1 - (a))
-char *cards[] = {
+const char *const cards[] = {
"A", "2", "3", "4", "5", "6", "7",
"8", "9", "10", "J", "Q", "K", NULL,
};
@@ -80,10 +80,10 @@ int promode;
int asked[RANKS], comphand[RANKS], deck[RANKS];
int userasked[RANKS], userhand[RANKS];
-void chkwinner __P((int, int *));
+void chkwinner __P((int, const int *));
int compmove __P((void));
-int countbooks __P((int *));
-int countcards __P((int *));
+int countbooks __P((const int *));
+int countcards __P((const int *));
int drawcard __P((int, int *));
int gofish __P((int, int, int *));
void goodmove __P((int, int, int *, int *));
@@ -91,7 +91,7 @@ void init __P((void));
void instructions __P((void));
int main __P((int, char *[]));
int nrandom __P((int));
-void printhand __P((int *));
+void printhand __P((const int *));
void printplayer __P((int));
int promove __P((void));
void usage __P((void)) __attribute__((__noreturn__));
@@ -155,7 +155,7 @@ int
usermove()
{
int n;
- char **p;
+ const char *const *p;
char buf[256];
(void)printf("\nYour hand is:");
@@ -330,7 +330,7 @@ goodmove(player, move, hand, opphand)
void
chkwinner(player, hand)
int player;
- int *hand;
+ const int *hand;
{
int cb, i, ub;
@@ -373,7 +373,7 @@ printplayer(player)
void
printhand(hand)
- int *hand;
+ const int *hand;
{
int book, i, j;
@@ -394,7 +394,7 @@ printhand(hand)
int
countcards(hand)
- int *hand;
+ const int *hand;
{
int i, count;
@@ -405,7 +405,7 @@ countcards(hand)
int
countbooks(hand)
- int *hand;
+ const int *hand;
{
int i, count;