Skip to content

Commit ce5670f

Browse files
jsmjsm
authored andcommitted
Fix uses of namespaces reserved by ISO C or POSIX.1.
1 parent 2492ffe commit ce5670f

File tree

18 files changed

+94
-71
lines changed

18 files changed

+94
-71
lines changed

games/atc/def.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: def.h,v 1.4 1998/09/11 12:53:28 hubertf Exp $ */
1+
/* $NetBSD: def.h,v 1.5 1999/09/30 18:01:31 jsm Exp $ */
22

33
/*-
44
* Copyright (c) 1990, 1993
@@ -74,6 +74,11 @@
7474
#define T_EXIT 2
7575
#define T_AIRPORT 3
7676

77+
#undef S_NONE
78+
#undef S_GONE
79+
#undef S_MARKED
80+
#undef S_UNMARKED
81+
#undef S_IGNORED
7782
#define S_NONE 0
7883
#define S_GONE 1
7984
#define S_MARKED 2

games/cribbage/cards.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: cards.c,v 1.5 1999/09/08 21:17:47 jsm Exp $ */
1+
/* $NetBSD: cards.c,v 1.6 1999/09/30 18:01:32 jsm Exp $ */
22

33
/*-
44
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: cards.c,v 1.5 1999/09/08 21:17:47 jsm Exp $");
41+
__RCSID("$NetBSD: cards.c,v 1.6 1999/09/30 18:01:32 jsm Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -101,10 +101,10 @@ eq(a, b)
101101
}
102102

103103
/*
104-
* isone returns TRUE if a is in the set of cards b
104+
* is_one returns TRUE if a is in the set of cards b
105105
*/
106106
int
107-
isone(a, b, n)
107+
is_one(a, b, n)
108108
CARD a;
109109
const CARD b[];
110110
int n;

games/cribbage/cribbage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: cribbage.h,v 1.6 1999/09/10 00:03:14 jsm Exp $ */
1+
/* $NetBSD: cribbage.h,v 1.7 1999/09/30 18:01:32 jsm Exp $ */
22

33
/*
44
* Copyright (c) 1980, 1993
@@ -85,7 +85,7 @@ int getuchar __P((void));
8585
int incard __P((CARD *));
8686
int infrom __P((const CARD [], int, const char *));
8787
void instructions __P((void));
88-
int isone __P((CARD, const CARD [], int));
88+
int is_one __P((CARD, const CARD [], int));
8989
void makeboard __P((void));
9090
void makedeck __P((CARD []));
9191
void makeknown __P((const CARD [], int));

games/cribbage/io.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: io.c,v 1.13 1999/09/18 19:38:48 jsm Exp $ */
1+
/* $NetBSD: io.c,v 1.14 1999/09/30 18:01:32 jsm Exp $ */
22

33
/*-
44
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: io.c,v 1.13 1999/09/18 19:38:48 jsm Exp $");
41+
__RCSID("$NetBSD: io.c,v 1.14 1999/09/30 18:01:32 jsm Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -203,15 +203,15 @@ infrom(hand, n, prompt)
203203
for (;;) {
204204
msg(prompt);
205205
if (incard(&crd)) { /* if card is full card */
206-
if (!isone(crd, hand, n))
206+
if (!is_one(crd, hand, n))
207207
msg("That's not in your hand");
208208
else {
209209
for (i = 0; i < n; i++)
210210
if (hand[i].rank == crd.rank &&
211211
hand[i].suit == crd.suit)
212212
break;
213213
if (i >= n) {
214-
printf("\nINFROM: isone or something messed up\n");
214+
printf("\nINFROM: is_one or something messed up\n");
215215
exit(77);
216216
}
217217
return (i);

games/mille/comp.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: comp.c,v 1.7 1999/09/18 19:38:52 jsm Exp $ */
1+
/* $NetBSD: comp.c,v 1.8 1999/09/30 18:01:32 jsm Exp $ */
22

33
/*
44
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: comp.c,v 1.7 1999/09/18 19:38:52 jsm Exp $");
41+
__RCSID("$NetBSD: comp.c,v 1.8 1999/09/30 18:01:32 jsm Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -131,7 +131,7 @@ calcmove()
131131
if (foundend)
132132
foundend = !check_ext(TRUE);
133133
for (i = 0; safe && i < HAND_SZ; i++) {
134-
if (issafety(pp->hand[i])) {
134+
if (is_safety(pp->hand[i])) {
135135
if (onecard(op) || (foundend && cango && !canstop)) {
136136
#ifdef DEBUG
137137
if (Debug)
@@ -167,7 +167,7 @@ calcmove()
167167
playit[i] = cango;
168168
}
169169
}
170-
if (!pp->can_go && !isrepair(pp->battle))
170+
if (!pp->can_go && !is_repair(pp->battle))
171171
Numneed[opposite(pp->battle)]++;
172172
redoit:
173173
foundlow = (cango || count[C_END_LIMIT] != 0
@@ -183,7 +183,7 @@ calcmove()
183183
value = valbuf;
184184
for (i = 0; i < HAND_SZ; i++) {
185185
card = pp->hand[i];
186-
if (issafety(card) || playit[i] == (cango != 0)) {
186+
if (is_safety(card) || playit[i] == (cango != 0)) {
187187
#ifdef DEBUG
188188
if (Debug)
189189
fprintf(outf, "CALCMOVE: switch(\"%s\")\n",
@@ -383,7 +383,7 @@ calcmove()
383383
#endif
384384
value++;
385385
}
386-
if (!pp->can_go && !isrepair(pp->battle))
386+
if (!pp->can_go && !is_repair(pp->battle))
387387
Numneed[opposite(pp->battle)]++;
388388
if (cango) {
389389
play_it:
@@ -392,7 +392,7 @@ calcmove()
392392
Card_no = nummax;
393393
}
394394
else {
395-
if (issafety(pp->hand[nummin])) { /* NEVER discard a safety */
395+
if (is_safety(pp->hand[nummin])) { /* NEVER discard a safety */
396396
nummax = nummin;
397397
goto play_it;
398398
}
@@ -415,7 +415,7 @@ onecard(pp)
415415
bat = pp->battle;
416416
spd = pp->speed;
417417
card = -1;
418-
if (pp->can_go || ((isrepair(bat) || bat == C_STOP || spd == C_LIMIT) &&
418+
if (pp->can_go || ((is_repair(bat) || bat == C_STOP || spd == C_LIMIT) &&
419419
Numseen[S_RIGHT_WAY] != 0) ||
420420
(bat >= 0 && Numseen[safety(bat)] != 0))
421421
switch (End - pp->mileage) {
@@ -478,7 +478,7 @@ canplay(pp, op, card)
478478
break;
479479
case C_GO:
480480
if (!pp->can_go &&
481-
(isrepair(pp->battle) || pp->battle == C_STOP))
481+
(is_repair(pp->battle) || pp->battle == C_STOP))
482482
return TRUE;
483483
break;
484484
case C_END_LIMIT:

games/mille/init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: init.c,v 1.7 1997/10/12 00:53:59 lukem Exp $ */
1+
/* $NetBSD: init.c,v 1.8 1999/09/30 18:01:32 jsm Exp $ */
22

33
/*
44
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: init.c,v 1.7 1997/10/12 00:53:59 lukem Exp $");
41+
__RCSID("$NetBSD: init.c,v 1.8 1999/09/30 18:01:32 jsm Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -69,7 +69,7 @@ init()
6969
pp->hand[j] = *--Topcard;
7070
if (i == COMP) {
7171
account(card = *Topcard);
72-
if (issafety(card))
72+
if (is_safety(card))
7373
pp->safety[card - S_CONV] = S_IN_HAND;
7474
}
7575
}

games/mille/mille.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: mille.h,v 1.10 1999/09/08 21:17:50 jsm Exp $ */
1+
/* $NetBSD: mille.h,v 1.11 1999/09/30 18:01:32 jsm Exp $ */
22

33
/*
44
* Copyright (c) 1982, 1993
@@ -109,6 +109,14 @@
109109
* safety descriptions
110110
*/
111111

112+
# undef S_UNKNOWN
113+
# undef S_IN_HAND
114+
# undef S_PLAYED
115+
# undef S_GAS_SAFE
116+
# undef S_SPARE_SAFE
117+
# undef S_DRIVE_SAFE
118+
# undef S_RIGHT_WAY
119+
# undef S_CONV
112120
# define S_UNKNOWN 0 /* location of safety unknown */
113121
# define S_IN_HAND 1 /* safety in player's hand */
114122
# define S_PLAYED 2 /* safety has been played */
@@ -199,7 +207,7 @@ typedef struct {
199207
# define nextplay() (Play = other(Play))
200208
# define nextwin(x) (1 - x)
201209
# define opposite(x) (Opposite[x])
202-
# define issafety(x) (x >= C_GAS_SAFE)
210+
# define is_safety(x) (x >= C_GAS_SAFE)
203211

204212
/*
205213
* externals
@@ -243,7 +251,7 @@ void getmove __P((void));
243251
int getyn __P((int));
244252
int haspicked __P((const PLAY *));
245253
void init __P((void));
246-
int isrepair __P((CARD));
254+
int is_repair __P((CARD));
247255
int main __P((int, char **));
248256
void newboard __P((void));
249257
void newscore __P((void));

games/mille/move.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: move.c,v 1.10 1999/09/08 21:17:51 jsm Exp $ */
1+
/* $NetBSD: move.c,v 1.11 1999/09/30 18:01:32 jsm Exp $ */
22

33
/*
44
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: move.c,v 1.10 1999/09/08 21:17:51 jsm Exp $");
41+
__RCSID("$NetBSD: move.c,v 1.11 1999/09/30 18:01:32 jsm Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -79,7 +79,7 @@ domove()
7979
else
8080
error("no card there");
8181
else {
82-
if (issafety(pp->hand[Card_no])) {
82+
if (is_safety(pp->hand[Card_no])) {
8383
error("discard a safety?");
8484
goodplay = FALSE;
8585
break;
@@ -112,7 +112,7 @@ domove()
112112
acc:
113113
if (Play == COMP) {
114114
account(*Topcard);
115-
if (issafety(*Topcard))
115+
if (is_safety(*Topcard))
116116
pp->safety[*Topcard-S_CONV] = S_IN_HAND;
117117
}
118118
if (pp->hand[1] == C_INIT && Topcard > Deck) {
@@ -171,11 +171,11 @@ check_go()
171171
op = (pp == &Player[COMP] ? &Player[PLAYER] : &Player[COMP]);
172172
for (i = 0; i < HAND_SZ; i++) {
173173
card = pp->hand[i];
174-
if (issafety(card) || canplay(pp, op, card)) {
174+
if (is_safety(card) || canplay(pp, op, card)) {
175175
#ifdef DEBUG
176176
if (Debug) {
177177
fprintf(outf, "CHECK_GO: can play %s (%d), ", C_name[card], card);
178-
fprintf(outf, "issafety(card) = %d, ", issafety(card));
178+
fprintf(outf, "is_safety(card) = %d, ", issafety(card));
179179
fprintf(outf, "canplay(pp, op, card) = %d\n", canplay(pp, op, card));
180180
}
181181
#endif
@@ -248,7 +248,7 @@ playcard(pp)
248248

249249
case C_GO:
250250
if (pp->battle != C_INIT && pp->battle != C_STOP
251-
&& !isrepair(pp->battle))
251+
&& !is_repair(pp->battle))
252252
return error("cannot play \"Go\" on a \"%s\"",
253253
C_name[pp->battle]);
254254
pp->battle = C_GO;
@@ -290,7 +290,7 @@ playcard(pp)
290290
case C_DRIVE_SAFE: case C_RIGHT_WAY:
291291
if (pp->battle == opposite(card)
292292
|| (card == C_RIGHT_WAY && pp->speed == C_LIMIT)) {
293-
if (!(card == C_RIGHT_WAY && !isrepair(pp->battle))) {
293+
if (!(card == C_RIGHT_WAY && !is_repair(pp->battle))) {
294294
pp->battle = C_GO;
295295
pp->can_go = TRUE;
296296
}
@@ -323,7 +323,7 @@ playcard(pp)
323323
pp->can_go = TRUE;
324324
pp->battle = C_INIT;
325325
}
326-
if (!pp->can_go && isrepair(pp->battle))
326+
if (!pp->can_go && is_repair(pp->battle))
327327
pp->can_go = TRUE;
328328
}
329329
Next = -1;

games/mille/types.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: types.c,v 1.6 1997/10/12 00:54:40 lukem Exp $ */
1+
/* $NetBSD: types.c,v 1.7 1999/09/30 18:01:32 jsm Exp $ */
22

33
/*
44
* Copyright (c) 1982, 1993
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char sccsid[] = "@(#)types.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: types.c,v 1.6 1997/10/12 00:54:40 lukem Exp $");
41+
__RCSID("$NetBSD: types.c,v 1.7 1999/09/30 18:01:32 jsm Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -49,7 +49,7 @@ __RCSID("$NetBSD: types.c,v 1.6 1997/10/12 00:54:40 lukem Exp $");
4949
*/
5050

5151
int
52-
isrepair(card)
52+
is_repair(card)
5353
CARD card;
5454
{
5555

games/monop/misc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: misc.c,v 1.8 1999/09/08 21:17:52 jsm Exp $ */
1+
/* $NetBSD: misc.c,v 1.9 1999/09/30 18:01:32 jsm Exp $ */
22

33
/*
44
* Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
3838
#if 0
3939
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
4040
#else
41-
__RCSID("$NetBSD: misc.c,v 1.8 1999/09/08 21:17:52 jsm Exp $");
41+
__RCSID("$NetBSD: misc.c,v 1.9 1999/09/30 18:01:32 jsm Exp $");
4242
#endif
4343
#endif /* not lint */
4444

@@ -223,7 +223,7 @@ set_ownlist(pl)
223223
if (num == orig->num_in)
224224
is_monop(orig, pl);
225225
else
226-
isnot_monop(orig);
226+
is_not_monop(orig);
227227
break;
228228
}
229229
}
@@ -250,7 +250,7 @@ is_monop(mp, pl)
250250
* This routine sets things up as if it is no longer a monopoly
251251
*/
252252
void
253-
isnot_monop(mp)
253+
is_not_monop(mp)
254254
MON *mp;
255255
{
256256
int i;

0 commit comments

Comments
 (0)