summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games/mille/comp.c18
-rw-r--r--games/mille/end.c8
-rw-r--r--games/mille/extern.c6
-rw-r--r--games/mille/init.c6
-rw-r--r--games/mille/mille.c6
-rw-r--r--games/mille/mille.h8
-rw-r--r--games/mille/misc.c12
-rw-r--r--games/mille/move.c16
-rw-r--r--games/mille/save.c6
-rw-r--r--games/mille/types.c6
-rw-r--r--games/mille/varpush.c4
11 files changed, 49 insertions, 47 deletions
diff --git a/games/mille/comp.c b/games/mille/comp.c
index e653418fdbf..0d6c25257d5 100644
--- a/games/mille/comp.c
+++ b/games/mille/comp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comp.c,v 1.3 1999/09/25 15:52:19 pjanzen Exp $ */
+/* $OpenBSD: comp.c,v 1.4 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: comp.c,v 1.4 1995/03/24 05:01:11 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)comp.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: comp.c,v 1.3 1999/09/25 15:52:19 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: comp.c,v 1.4 2001/09/03 21:36:12 pjanzen 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/games/mille/end.c b/games/mille/end.c
index 86d619ea617..e5b96069c83 100644
--- a/games/mille/end.c
+++ b/games/mille/end.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: end.c,v 1.3 1998/09/22 04:08:22 pjanzen Exp $ */
+/* $OpenBSD: end.c,v 1.4 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: end.c,v 1.4 1995/03/24 05:01:30 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)end.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: end.c,v 1.3 1998/09/22 04:08:22 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: end.c,v 1.4 2001/09/03 21:36:12 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -49,7 +49,7 @@ static char rcsid[] = "$OpenBSD: end.c,v 1.3 1998/09/22 04:08:22 pjanzen Exp $";
*/
/*
- * print out the score as if it was final, and add the totals for
+ * print out the score as if it were final, and add the totals for
* the end-of-games points to the user who deserves it (if any).
*/
void
@@ -94,7 +94,7 @@ finalscore(pp)
static int Last_tot[2]; /* last tot used for extrapolate */
/*
- * print out the score as if it was final, and add the totals for
+ * print out the score as if it were final, and add the totals for
* the end-of-games points to the user who deserves it (if any).
*/
void
diff --git a/games/mille/extern.c b/games/mille/extern.c
index fddfd7632db..477bf601d65 100644
--- a/games/mille/extern.c
+++ b/games/mille/extern.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.c,v 1.3 1999/09/25 15:52:20 pjanzen Exp $ */
+/* $OpenBSD: extern.c,v 1.4 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: extern.c,v 1.4 1995/03/24 05:01:36 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: extern.c,v 1.3 1999/09/25 15:52:20 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: extern.c,v 1.4 2001/09/03 21:36:12 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -69,7 +69,7 @@ const char *Fromfile = NULL, /* startup file for game */
"Flat Tire",
"Accident",
"Stop",
- "Speed Limit",
+ "Speed Limit",
"Gasoline",
"Spare Tire",
"Repairs",
diff --git a/games/mille/init.c b/games/mille/init.c
index 3fa7190a859..23f36a7d4c8 100644
--- a/games/mille/init.c
+++ b/games/mille/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.3 1998/09/22 04:08:22 pjanzen Exp $ */
+/* $OpenBSD: init.c,v 1.4 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: init.c,v 1.5 1995/03/24 05:01:40 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: init.c,v 1.3 1998/09/22 04:08:22 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: init.c,v 1.4 2001/09/03 21:36:12 pjanzen 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/games/mille/mille.c b/games/mille/mille.c
index 5c6a2cc36e2..e7fe597507f 100644
--- a/games/mille/mille.c
+++ b/games/mille/mille.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mille.c,v 1.9 2001/03/08 21:18:35 deraadt Exp $ */
+/* $OpenBSD: mille.c,v 1.10 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: mille.c,v 1.4 1995/03/24 05:01:48 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mille.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: mille.c,v 1.9 2001/03/08 21:18:35 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mille.c,v 1.10 2001/09/03 21:36:12 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -66,11 +66,13 @@ main(ac, av)
setegid(getgid());
setgid(getgid());
+#ifdef DEBUG
if (strcmp(av[0], "a.out") == 0) {
outf = fopen("q", "w");
setbuf(outf, (char *)NULL);
Debug = TRUE;
}
+#endif
restore = FALSE;
switch (ac) {
case 2:
diff --git a/games/mille/mille.h b/games/mille/mille.h
index cfb84c16042..deb8af59d0c 100644
--- a/games/mille/mille.h
+++ b/games/mille/mille.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mille.h,v 1.4 1999/09/25 15:52:20 pjanzen Exp $ */
+/* $OpenBSD: mille.h,v 1.5 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: mille.h,v 1.5 1995/03/24 05:01:51 cgd Exp $ */
/*
@@ -62,7 +62,7 @@
# define HAND_SZ 7 /* number of cards in a hand */
# define DECK_SZ 101 /* number of cards in decks */
-# define NUM_SAFE 4 /* number of saftey cards */
+# define NUM_SAFE 4 /* number of safety cards */
# define NUM_MILES 5 /* number of milestones types */
# define NUM_CARDS 20 /* number of types of cards */
# define BOARD_Y 17 /* size of board screen */
@@ -200,7 +200,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 +243,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/games/mille/misc.c b/games/mille/misc.c
index fdee29f7cfb..bc9eeaba250 100644
--- a/games/mille/misc.c
+++ b/games/mille/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.6 2000/07/23 21:50:20 pjanzen Exp $ */
+/* $OpenBSD: misc.c,v 1.7 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: misc.c,v 1.4 1995/03/24 05:01:54 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: misc.c,v 1.6 2000/07/23 21:50:20 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: misc.c,v 1.7 2001/09/03 21:36:12 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -107,7 +107,7 @@ getcard()
c = 0;
break;
default:
- putchar('\07');
+ beep();
addch('\b');
if (!isprint(c))
addch('\b');
@@ -126,7 +126,7 @@ getcard()
goto cont;
}
else
- write(0, "\07", 1);
+ beep();
return c;
}
cont: ;
@@ -172,7 +172,7 @@ done:
goto extend;
for (miles = 0, i = 0; i < HAND_SZ; i++)
if ((safe = pp->hand[i]) <= C_200)
- miles += Value[safe];
+ miles += Value[safe];
if (miles + (Topcard - Deck) * 3 > 1000)
goto extend;
goto done;
@@ -219,7 +219,7 @@ getyn(promptno)
default:
addstr(unctrl(c));
refresh();
- putchar('\07');
+ beep();
break;
}
}
diff --git a/games/mille/move.c b/games/mille/move.c
index a77d462e2c3..570505a0fa8 100644
--- a/games/mille/move.c
+++ b/games/mille/move.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: move.c,v 1.8 2000/08/05 21:57:41 pjanzen Exp $ */
+/* $OpenBSD: move.c,v 1.9 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: move.c,v 1.4 1995/03/24 05:01:57 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: move.c,v 1.8 2000/08/05 21:57:41 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: move.c,v 1.9 2001/09/03 21:36:12 pjanzen 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, ", is_safety(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]);
if (pp->safety[S_RIGHT_WAY] == S_PLAYED)
@@ -318,7 +318,7 @@ protected:
if (pp->speed == C_LIMIT)
pp->speed = C_INIT;
if (pp->battle == C_STOP || pp->battle == C_INIT ||
- (!pp->can_go && isrepair(pp->battle))) {
+ (!pp->can_go && is_repair(pp->battle))) {
pp->can_go = TRUE;
pp->battle = C_GO;
}
diff --git a/games/mille/save.c b/games/mille/save.c
index 3e8263ec1e2..1bd00fb978a 100644
--- a/games/mille/save.c
+++ b/games/mille/save.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: save.c,v 1.4 1999/09/25 15:52:20 pjanzen Exp $ */
+/* $OpenBSD: save.c,v 1.5 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: save.c,v 1.4 1995/03/24 05:02:13 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: save.c,v 1.4 1999/09/25 15:52:20 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: save.c,v 1.5 2001/09/03 21:36:12 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -77,7 +77,7 @@ over:
refresh();
sp = buf;
while ((*sp = readch()) != '\n' && *sp != '\r' &&
- (sp - buf < sizeof(buf))) {
+ (sp - buf < (int)sizeof(buf))) {
if (*sp == killchar())
goto over;
else if (*sp == erasechar()) {
diff --git a/games/mille/types.c b/games/mille/types.c
index e7bbe110c95..7956547bd36 100644
--- a/games/mille/types.c
+++ b/games/mille/types.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: types.c,v 1.4 1999/09/25 15:52:20 pjanzen Exp $ */
+/* $OpenBSD: types.c,v 1.5 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: types.c,v 1.4 1995/03/24 05:02:22 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)types.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: types.c,v 1.4 1999/09/25 15:52:20 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: types.c,v 1.5 2001/09/03 21:36:12 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -49,7 +49,7 @@ static char rcsid[] = "$OpenBSD: types.c,v 1.4 1999/09/25 15:52:20 pjanzen Exp $
*/
int
-isrepair(card)
+is_repair(card)
CARD card;
{
return card == C_GAS || card == C_SPARE ||
diff --git a/games/mille/varpush.c b/games/mille/varpush.c
index 2dbcd759e8f..f479d107876 100644
--- a/games/mille/varpush.c
+++ b/games/mille/varpush.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: varpush.c,v 1.3 1998/09/22 04:08:25 pjanzen Exp $ */
+/* $OpenBSD: varpush.c,v 1.4 2001/09/03 21:36:12 pjanzen Exp $ */
/* $NetBSD: varpush.c,v 1.4 1995/03/24 05:02:35 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)varpush.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: varpush.c,v 1.4 1995/03/24 05:02:35 cgd Exp $";
+static char rcsid[] = "$OpenBSD: varpush.c,v 1.4 2001/09/03 21:36:12 pjanzen Exp $";
#endif
#endif /* not lint */