summaryrefslogtreecommitdiffstats
path: root/mille
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>1999-09-30 18:01:31 +0000
committerjsm <jsm@NetBSD.org>1999-09-30 18:01:31 +0000
commit963f40fabfbfc47378585a05f5b465cbd4e0c7b6 (patch)
tree7d2ead721965b1afb7d25682629c2f61932820fc /mille
parente2f2d09292b8ac5c5390ab1b7e6fa09ab554080f (diff)
downloadbsdgames-darwin-963f40fabfbfc47378585a05f5b465cbd4e0c7b6.tar.gz
bsdgames-darwin-963f40fabfbfc47378585a05f5b465cbd4e0c7b6.tar.zst
bsdgames-darwin-963f40fabfbfc47378585a05f5b465cbd4e0c7b6.zip
Fix uses of namespaces reserved by ISO C or POSIX.1.
Diffstat (limited to 'mille')
-rw-r--r--mille/comp.c18
-rw-r--r--mille/init.c6
-rw-r--r--mille/mille.h14
-rw-r--r--mille/move.c18
-rw-r--r--mille/types.c6
5 files changed, 35 insertions, 27 deletions
diff --git a/mille/comp.c b/mille/comp.c
index 531fffd9..b184e6bb 100644
--- a/mille/comp.c
+++ b/mille/comp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: comp.c,v 1.7 1999/09/18 19:38:52 jsm Exp $ */
+/* $NetBSD: comp.c,v 1.8 1999/09/30 18:01:32 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: comp.c,v 1.7 1999/09/18 19:38:52 jsm Exp $");
+__RCSID("$NetBSD: comp.c,v 1.8 1999/09/30 18:01:32 jsm Exp $");
#endif
#endif /* not lint */
@@ -131,7 +131,7 @@ norm:
if (foundend)
foundend = !check_ext(TRUE);
for (i = 0; safe && i < HAND_SZ; i++) {
- if (issafety(pp->hand[i])) {
+ if (is_safety(pp->hand[i])) {
if (onecard(op) || (foundend && cango && !canstop)) {
#ifdef DEBUG
if (Debug)
@@ -167,7 +167,7 @@ playsafe:
playit[i] = cango;
}
}
- if (!pp->can_go && !isrepair(pp->battle))
+ if (!pp->can_go && !is_repair(pp->battle))
Numneed[opposite(pp->battle)]++;
redoit:
foundlow = (cango || count[C_END_LIMIT] != 0
@@ -183,7 +183,7 @@ redoit:
value = valbuf;
for (i = 0; i < HAND_SZ; i++) {
card = pp->hand[i];
- if (issafety(card) || playit[i] == (cango != 0)) {
+ if (is_safety(card) || playit[i] == (cango != 0)) {
#ifdef DEBUG
if (Debug)
fprintf(outf, "CALCMOVE: switch(\"%s\")\n",
@@ -383,7 +383,7 @@ normbad:
#endif
value++;
}
- if (!pp->can_go && !isrepair(pp->battle))
+ if (!pp->can_go && !is_repair(pp->battle))
Numneed[opposite(pp->battle)]++;
if (cango) {
play_it:
@@ -392,7 +392,7 @@ play_it:
Card_no = nummax;
}
else {
- if (issafety(pp->hand[nummin])) { /* NEVER discard a safety */
+ if (is_safety(pp->hand[nummin])) { /* NEVER discard a safety */
nummax = nummin;
goto play_it;
}
@@ -415,7 +415,7 @@ onecard(pp)
bat = pp->battle;
spd = pp->speed;
card = -1;
- if (pp->can_go || ((isrepair(bat) || bat == C_STOP || spd == C_LIMIT) &&
+ if (pp->can_go || ((is_repair(bat) || bat == C_STOP || spd == C_LIMIT) &&
Numseen[S_RIGHT_WAY] != 0) ||
(bat >= 0 && Numseen[safety(bat)] != 0))
switch (End - pp->mileage) {
@@ -478,7 +478,7 @@ canplay(pp, op, card)
break;
case C_GO:
if (!pp->can_go &&
- (isrepair(pp->battle) || pp->battle == C_STOP))
+ (is_repair(pp->battle) || pp->battle == C_STOP))
return TRUE;
break;
case C_END_LIMIT:
diff --git a/mille/init.c b/mille/init.c
index 0fa3579c..99d7a55a 100644
--- a/mille/init.c
+++ b/mille/init.c
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.7 1997/10/12 00:53:59 lukem Exp $ */
+/* $NetBSD: init.c,v 1.8 1999/09/30 18:01:32 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: init.c,v 1.7 1997/10/12 00:53:59 lukem Exp $");
+__RCSID("$NetBSD: init.c,v 1.8 1999/09/30 18:01:32 jsm Exp $");
#endif
#endif /* not lint */
@@ -69,7 +69,7 @@ init()
pp->hand[j] = *--Topcard;
if (i == COMP) {
account(card = *Topcard);
- if (issafety(card))
+ if (is_safety(card))
pp->safety[card - S_CONV] = S_IN_HAND;
}
}
diff --git a/mille/mille.h b/mille/mille.h
index c110c6b2..58825c1c 100644
--- a/mille/mille.h
+++ b/mille/mille.h
@@ -1,4 +1,4 @@
-/* $NetBSD: mille.h,v 1.10 1999/09/08 21:17:50 jsm Exp $ */
+/* $NetBSD: mille.h,v 1.11 1999/09/30 18:01:32 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -109,6 +109,14 @@
* safety descriptions
*/
+# undef S_UNKNOWN
+# undef S_IN_HAND
+# undef S_PLAYED
+# undef S_GAS_SAFE
+# undef S_SPARE_SAFE
+# undef S_DRIVE_SAFE
+# undef S_RIGHT_WAY
+# undef S_CONV
# define S_UNKNOWN 0 /* location of safety unknown */
# define S_IN_HAND 1 /* safety in player's hand */
# define S_PLAYED 2 /* safety has been played */
@@ -199,7 +207,7 @@ typedef struct {
# define nextplay() (Play = other(Play))
# define nextwin(x) (1 - x)
# define opposite(x) (Opposite[x])
-# define issafety(x) (x >= C_GAS_SAFE)
+# define is_safety(x) (x >= C_GAS_SAFE)
/*
* externals
@@ -243,7 +251,7 @@ void getmove __P((void));
int getyn __P((int));
int haspicked __P((const PLAY *));
void init __P((void));
-int isrepair __P((CARD));
+int is_repair __P((CARD));
int main __P((int, char **));
void newboard __P((void));
void newscore __P((void));
diff --git a/mille/move.c b/mille/move.c
index afc3acb6..4afa8207 100644
--- a/mille/move.c
+++ b/mille/move.c
@@ -1,4 +1,4 @@
-/* $NetBSD: move.c,v 1.10 1999/09/08 21:17:51 jsm Exp $ */
+/* $NetBSD: move.c,v 1.11 1999/09/30 18:01:32 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: move.c,v 1.10 1999/09/08 21:17:51 jsm Exp $");
+__RCSID("$NetBSD: move.c,v 1.11 1999/09/30 18:01:32 jsm Exp $");
#endif
#endif /* not lint */
@@ -79,7 +79,7 @@ domove()
else
error("no card there");
else {
- if (issafety(pp->hand[Card_no])) {
+ if (is_safety(pp->hand[Card_no])) {
error("discard a safety?");
goodplay = FALSE;
break;
@@ -112,7 +112,7 @@ domove()
acc:
if (Play == COMP) {
account(*Topcard);
- if (issafety(*Topcard))
+ if (is_safety(*Topcard))
pp->safety[*Topcard-S_CONV] = S_IN_HAND;
}
if (pp->hand[1] == C_INIT && Topcard > Deck) {
@@ -171,11 +171,11 @@ check_go()
op = (pp == &Player[COMP] ? &Player[PLAYER] : &Player[COMP]);
for (i = 0; i < HAND_SZ; i++) {
card = pp->hand[i];
- if (issafety(card) || canplay(pp, op, card)) {
+ if (is_safety(card) || canplay(pp, op, card)) {
#ifdef DEBUG
if (Debug) {
fprintf(outf, "CHECK_GO: can play %s (%d), ", C_name[card], card);
- fprintf(outf, "issafety(card) = %d, ", issafety(card));
+ fprintf(outf, "is_safety(card) = %d, ", issafety(card));
fprintf(outf, "canplay(pp, op, card) = %d\n", canplay(pp, op, card));
}
#endif
@@ -248,7 +248,7 @@ mustpick:
case C_GO:
if (pp->battle != C_INIT && pp->battle != C_STOP
- && !isrepair(pp->battle))
+ && !is_repair(pp->battle))
return error("cannot play \"Go\" on a \"%s\"",
C_name[pp->battle]);
pp->battle = C_GO;
@@ -290,7 +290,7 @@ protected:
case C_DRIVE_SAFE: case C_RIGHT_WAY:
if (pp->battle == opposite(card)
|| (card == C_RIGHT_WAY && pp->speed == C_LIMIT)) {
- if (!(card == C_RIGHT_WAY && !isrepair(pp->battle))) {
+ if (!(card == C_RIGHT_WAY && !is_repair(pp->battle))) {
pp->battle = C_GO;
pp->can_go = TRUE;
}
@@ -323,7 +323,7 @@ protected:
pp->can_go = TRUE;
pp->battle = C_INIT;
}
- if (!pp->can_go && isrepair(pp->battle))
+ if (!pp->can_go && is_repair(pp->battle))
pp->can_go = TRUE;
}
Next = -1;
diff --git a/mille/types.c b/mille/types.c
index a4cde54e..772ddbc0 100644
--- a/mille/types.c
+++ b/mille/types.c
@@ -1,4 +1,4 @@
-/* $NetBSD: types.c,v 1.6 1997/10/12 00:54:40 lukem Exp $ */
+/* $NetBSD: types.c,v 1.7 1999/09/30 18:01:32 jsm Exp $ */
/*
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)types.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: types.c,v 1.6 1997/10/12 00:54:40 lukem Exp $");
+__RCSID("$NetBSD: types.c,v 1.7 1999/09/30 18:01:32 jsm Exp $");
#endif
#endif /* not lint */
@@ -49,7 +49,7 @@ __RCSID("$NetBSD: types.c,v 1.6 1997/10/12 00:54:40 lukem Exp $");
*/
int
-isrepair(card)
+is_repair(card)
CARD card;
{