summaryrefslogtreecommitdiffstats
path: root/mille/extern.c
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 /mille/extern.c
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 'mille/extern.c')
-rw-r--r--mille/extern.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/mille/extern.c b/mille/extern.c
index 64ae3e6b..81039ff0 100644
--- a/mille/extern.c
+++ b/mille/extern.c
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.c,v 1.5 1997/10/12 00:53:55 lukem Exp $ */
+/* $NetBSD: extern.c,v 1.6 1999/09/08 21:17:50 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: extern.c,v 1.5 1997/10/12 00:53:55 lukem Exp $");
+__RCSID("$NetBSD: extern.c,v 1.6 1999/09/08 21:17:50 jsm Exp $");
#endif
#endif /* not lint */
@@ -55,10 +55,10 @@ bool Debug, /* set if debugging code on */
Order, /* set if hand should be sorted */
Saved; /* set if game just saved */
-char *C_fmt = "%-18.18s", /* format for printing cards */
+char Initstr[100]; /* initial string for error field */
+const char *C_fmt = "%-18.18s", /* format for printing cards */
*Fromfile = NULL, /* startup file for game */
- Initstr[100], /* initial string for error field */
- *_cn[NUM_CARDS] = { /* Card name buffer */
+ *const _cn[NUM_CARDS] = { /* Card name buffer */
"",
"25",
"50",
@@ -80,7 +80,7 @@ char *C_fmt = "%-18.18s", /* format for printing cards */
"Driving Ace",
"Right of Way"
},
- **C_name = &_cn[1]; /* Card names */
+ *const *C_name = &_cn[1]; /* Card names */
int Card_no, /* Card number for current move */
End, /* End value for current hand */
@@ -89,8 +89,8 @@ int Card_no, /* Card number for current move */
Play, /* Current player */
Numgos, /* Number of Go cards used by computer */
Window = W_SMALL, /* Current window wanted */
- Numseen[NUM_CARDS], /* Number of cards seen in current hand */
- Value[NUM_MILES] = { /* Value of mileage cards */
+ Numseen[NUM_CARDS]; /* Number of cards seen in current hand */
+const int Value[NUM_MILES] = { /* Value of mileage cards */
25, 50, 75, 100, 200
},
Numcards[NUM_CARDS] = { /* Number of cards in deck */
@@ -114,8 +114,8 @@ int Card_no, /* Card number for current move */
1, /* C_DRIVE_SAFE */
1, /* C_RIGHT_WAY */
0 /* C_INIT */
- },
- Numneed[NUM_CARDS] = { /* number of cards needed per hand */
+ };
+int Numneed[NUM_CARDS] = { /* number of cards needed per hand */
0, /* C_25 */
0, /* C_50 */
0, /* C_75 */
@@ -140,13 +140,13 @@ int Card_no, /* Card number for current move */
CARD Discard, /* Top of discard pile */
Sh_discard, /* Last discard card shown */
- *Topcard, /* Pointer to next card to be picked */
- Opposite[NUM_CARDS] = { /* Opposites of each card */
+ *Topcard; /* Pointer to next card to be picked */
+const CARD Opposite[NUM_CARDS] = { /* Opposites of each card */
C_25, C_50, C_75, C_100, C_200, C_GAS, C_SPARE,
C_REPAIRS, C_GO, C_END_LIMIT, C_EMPTY, C_FLAT, C_CRASH,
C_STOP, C_LIMIT, C_EMPTY, C_FLAT, C_CRASH, C_STOP, C_INIT
- },
- Deck[DECK_SZ] = { /* Current deck */
+ };
+CARD Deck[DECK_SZ] = { /* Current deck */
C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25, C_25,
C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50, C_50,
C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75, C_75,