summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--monop/brd.dat28
-rw-r--r--monop/cards.c6
-rw-r--r--monop/execute.c12
-rw-r--r--monop/getinp.c22
-rw-r--r--monop/malloc.c12
-rw-r--r--monop/mon.dat26
-rw-r--r--monop/morg.c14
-rw-r--r--monop/prop.c12
-rw-r--r--monop/trade.c16
9 files changed, 78 insertions, 70 deletions
diff --git a/monop/brd.dat b/monop/brd.dat
index cf6af308..e4dd64a4 100644
--- a/monop/brd.dat
+++ b/monop/brd.dat
@@ -1,4 +1,4 @@
-/* $NetBSD: brd.dat,v 1.3 2003/08/07 09:37:27 agc Exp $ */
+/* $NetBSD: brd.dat,v 1.4 2008/01/28 06:16:13 dholland Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -33,29 +33,29 @@
/* name (COLOR) owner type desc cost */
-{"=== GO ===", -1, SAFE, 0 },
+{"=== GO ===", -1, SAFE, NULL, 0 },
{"Mediterranean ave. (P)", -1, PRPTY, &prop[0], 60 },
-{"Community Chest i", -1, CC, },
+{"Community Chest i", -1, CC, NULL, 0 },
{"Baltic ave. (P)", -1, PRPTY, &prop[1], 60 },
-{"Income Tax", -1, INC_TAX, },
+{"Income Tax", -1, INC_TAX, NULL, 0 },
{"Reading RR", -1, RR, &rr[0], 200 },
{"Oriental ave. (L)", -1, PRPTY, &prop[2], 100 },
-{"Chance i", -1, CHANCE, },
+{"Chance i", -1, CHANCE, NULL, 0 },
{"Vermont ave. (L)", -1, PRPTY, &prop[3], 100 },
{"Connecticut ave. (L)", -1, PRPTY, &prop[4], 120 },
-{"Just Visiting", -1, SAFE, 0 },
+{"Just Visiting", -1, SAFE, NULL, 0 },
{"St. Charles pl. (V)", -1, PRPTY, &prop[5], 140 },
{"Electric Co.", -1, UTIL, &util[0], 150 },
{"States ave. (V)", -1, PRPTY, &prop[6], 140 },
{"Virginia ave. (V)", -1, PRPTY, &prop[7], 160 },
{"Pennsylvania RR", -1, RR, &rr[1], 200 },
{"St. James pl. (O)", -1, PRPTY, &prop[8], 180 },
-{"Community Chest ii", -1, CC, },
+{"Community Chest ii", -1, CC, NULL, 0 },
{"Tennessee ave. (O)", -1, PRPTY, &prop[9], 180 },
{"New York ave. (O)", -1, PRPTY, &prop[10], 200 },
-{"Free Parking", -1, SAFE, 0 },
+{"Free Parking", -1, SAFE, NULL, 0 },
{"Kentucky ave. (R)", -1, PRPTY, &prop[11], 220 },
-{"Chance ii", -1, CHANCE, },
+{"Chance ii", -1, CHANCE, NULL, 0 },
{"Indiana ave. (R)", -1, PRPTY, &prop[12], 220 },
{"Illinois ave. (R)", -1, PRPTY, &prop[13], 240 },
{"B&O RR", -1, RR, &rr[2], 200 },
@@ -63,14 +63,14 @@
{"Ventnor ave. (Y)", -1, PRPTY, &prop[15], 260 },
{"Water Works", -1, UTIL, &util[1], 150 },
{"Marvin Gardens (Y)", -1, PRPTY, &prop[16], 280 },
-{"GO TO JAIL", -1, GOTO_J, },
+{"GO TO JAIL", -1, GOTO_J, NULL, 0 },
{"Pacific ave. (G)", -1, PRPTY, &prop[17], 300 },
{"N. Carolina ave. (G)", -1, PRPTY, &prop[18], 300 },
-{"Community Chest iii", -1, CC, },
+{"Community Chest iii", -1, CC, NULL, 0 },
{"Pennsylvania ave. (G)", -1, PRPTY, &prop[19], 320 },
{"Short Line RR", -1, RR, &rr[3], 200 },
-{"Chance iii", -1, CHANCE, },
+{"Chance iii", -1, CHANCE, NULL, 0 },
{"Park place (D)", -1, PRPTY, &prop[20], 350 },
-{"Luxury Tax", -1, LUX_TAX, },
+{"Luxury Tax", -1, LUX_TAX, NULL, 0 },
{"Boardwalk (D)", -1, PRPTY, &prop[21], 400 },
-{"JAIL", -1, IN_JAIL, }
+{"JAIL", -1, IN_JAIL, NULL, 0 }
diff --git a/monop/cards.c b/monop/cards.c
index cd0e2362..e3778f02 100644
--- a/monop/cards.c
+++ b/monop/cards.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cards.c,v 1.14 2004/01/27 20:30:30 jsm Exp $ */
+/* $NetBSD: cards.c,v 1.15 2008/01/28 06:16:13 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: cards.c,v 1.14 2004/01/27 20:30:30 jsm Exp $");
+__RCSID("$NetBSD: cards.c,v 1.15 2008/01/28 06:16:13 dholland Exp $");
#endif
#endif /* not lint */
@@ -101,7 +101,7 @@ set_up(dp)
if (dp->offsets == NULL)
errx(1, "out of memory");
if (fread(dp->offsets, sizeof(off_t), dp->num_cards, deckf) !=
- dp->num_cards) {
+ (unsigned) dp->num_cards) {
perror(cardfile);
exit(1);
}
diff --git a/monop/execute.c b/monop/execute.c
index 828d9908..07dce323 100644
--- a/monop/execute.c
+++ b/monop/execute.c
@@ -1,4 +1,4 @@
-/* $NetBSD: execute.c,v 1.11 2004/01/27 20:30:30 jsm Exp $ */
+/* $NetBSD: execute.c,v 1.12 2008/01/28 06:16:13 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)execute.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: execute.c,v 1.11 2004/01/27 20:30:30 jsm Exp $");
+__RCSID("$NetBSD: execute.c,v 1.12 2008/01/28 06:16:13 dholland Exp $");
#endif
#endif /* not lint */
@@ -242,7 +242,7 @@ rest_f(file)
{
char *sp;
int inf, num;
- char buf[80];
+ char xbuf[80];
char *start, *end;
STAT sbuf;
@@ -263,10 +263,10 @@ rest_f(file)
start += num;
}
close(inf);
- strcpy(buf, ctime(&sbuf.st_mtime));
- for (sp = buf; *sp != '\n'; sp++)
+ strcpy(xbuf, ctime(&sbuf.st_mtime));
+ for (sp = xbuf; *sp != '\n'; sp++)
continue;
*sp = '\0';
- printf("[%s]\n", buf);
+ printf("[%s]\n", xbuf);
return TRUE;
}
diff --git a/monop/getinp.c b/monop/getinp.c
index cd0253c9..2166b9fa 100644
--- a/monop/getinp.c
+++ b/monop/getinp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: getinp.c,v 1.14 2006/01/20 21:40:08 elad Exp $ */
+/* $NetBSD: getinp.c,v 1.15 2008/01/28 06:16:13 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)getinp.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: getinp.c,v 1.14 2006/01/20 21:40:08 elad Exp $");
+__RCSID("$NetBSD: getinp.c,v 1.15 2008/01/28 06:16:13 dholland Exp $");
#endif
#endif /* not lint */
@@ -50,8 +50,8 @@ static char buf[257];
static int comp(const char *);
int
-getinp(prompt, list)
- const char *prompt, *const list[];
+getinp(prompt, lst)
+ const char *prompt, *const lst[];
{
int i, n_match, match = 0;
char *sp;
@@ -69,18 +69,18 @@ getinp(prompt, list)
*sp = c;
if (buf[0] == '?' && buf[1] == '\n') {
printf("Valid inputs are: ");
- for (i = 0, match = 18; list[i]; i++) {
- if ((match+=(n_match=strlen(list[i]))) > LINE) {
+ for (i = 0, match = 18; lst[i]; i++) {
+ if ((match+=(n_match=strlen(lst[i]))) > LINE) {
printf("\n\t");
match = n_match + 8;
}
- if (*list[i] == '\0') {
+ if (*lst[i] == '\0') {
match += 8;
printf("<RETURN>");
}
else
- printf("%s", list[i]);
- if (list[i+1])
+ printf("%s", lst[i]);
+ if (lst[i+1])
printf(", ");
else
putchar('\n');
@@ -91,8 +91,8 @@ getinp(prompt, list)
*sp = '\0';
for (sp = buf; *sp; sp++)
*sp = tolower((unsigned char)*sp);
- for (i = n_match = 0; list[i]; i++)
- if (comp(list[i])) {
+ for (i = n_match = 0; lst[i]; i++)
+ if (comp(lst[i])) {
n_match++;
match = i;
}
diff --git a/monop/malloc.c b/monop/malloc.c
index 5e171af8..8e570b20 100644
--- a/monop/malloc.c
+++ b/monop/malloc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: malloc.c,v 1.4 2004/12/14 00:21:01 nathanw Exp $ */
+/* $NetBSD: malloc.c,v 1.5 2008/01/28 06:16:13 dholland Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)malloc.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: malloc.c,v 1.4 2004/12/14 00:21:01 nathanw Exp $");
+__RCSID("$NetBSD: malloc.c,v 1.5 2008/01/28 06:16:13 dholland Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -208,7 +208,7 @@ malloc(nbytes)
* stored in hash buckets which satisfies request.
* Account for space used per block for accounting.
*/
- if (nbytes <= (n = pagesz - sizeof (*op) - RSLOP)) {
+ if (nbytes <= (size_t)(n = pagesz - sizeof (*op) - RSLOP)) {
#ifndef RCHECK
amt = 8; /* size of first bucket */
bucket = 0;
@@ -221,7 +221,7 @@ malloc(nbytes)
amt = (unsigned)pagesz;
bucket = pagebucket;
}
- while (nbytes > amt + n) {
+ while (nbytes > (size_t)(amt + n)) {
amt <<= 1;
if (amt == 0)
return (NULL);
@@ -390,7 +390,7 @@ realloc(cp, nbytes)
i = NBUCKETS;
}
onb = (u_long)1 << (u_long)(i + 3);
- if (onb < pagesz)
+ if (onb < (u_long)pagesz)
onb -= sizeof (*op) + RSLOP;
else
onb += pagesz - sizeof (*op) - RSLOP;
@@ -403,7 +403,7 @@ realloc(cp, nbytes)
else
i += pagesz - sizeof (*op) - RSLOP;
}
- if (nbytes <= onb && nbytes > i) {
+ if (nbytes <= onb && nbytes > (size_t) i) {
#ifdef RCHECK
op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1);
*(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC;
diff --git a/monop/mon.dat b/monop/mon.dat
index be1b68be..24a5a88f 100644
--- a/monop/mon.dat
+++ b/monop/mon.dat
@@ -1,4 +1,4 @@
-/* $NetBSD: mon.dat,v 1.3 2003/08/07 09:37:28 agc Exp $ */
+/* $NetBSD: mon.dat,v 1.4 2008/01/28 06:16:13 dholland Exp $ */
/*-
* Copyright (c) 1980, 1993
@@ -31,12 +31,18 @@
* @(#)mon.dat 5.4 (Berkeley) 5/31/93
*/
-/* name owner num_in num_own h_cost not_m mon_n sq */
-{0, -1, 2, 0, 1, "Purple", "PURPLE", {1,3}},
-{0, -1, 3, 0, 1, "Lt. Blue", "LT. BLUE", {6,8,9}},
-{0, -1, 3, 0, 2, "Violet", "VIOLET", {11,13,14}},
-{0, -1, 3, 0, 2, "Orange", "ORANGE", {16,18,19}},
-{0, -1, 3, 0, 3, "Red", "RED", {21,23,24}},
-{0, -1, 3, 0, 3, "Yellow", "YELLOW", {26,27,29}},
-{0, -1, 3, 0, 4, "Green", "GREEN", {31,32,34}},
-{0, -1, 2, 0, 4, "Dk. Blue", "DK. BLUE", {37,39}}
+#define MONINIT(num_in, h_cost, not_m, mon_n, sq1,sq2,sq3) \
+ {0, -1, num_in, 0, h_cost, not_m, mon_n, {sq1,sq2,sq3}, {0,0,0}}
+/* name owner num_own sq */
+
+/* num_in h_cost not_m mon_n sqnums */
+MONINIT(2, 1, "Purple", "PURPLE", 1,3, 0),
+MONINIT(3, 1, "Lt. Blue", "LT. BLUE", 6,8,9),
+MONINIT(3, 2, "Violet", "VIOLET", 11,13,14),
+MONINIT(3, 2, "Orange", "ORANGE", 16,18,19),
+MONINIT(3, 3, "Red", "RED", 21,23,24),
+MONINIT(3, 3, "Yellow", "YELLOW", 26,27,29),
+MONINIT(3, 4, "Green", "GREEN", 31,32,34),
+MONINIT(2, 4, "Dk. Blue", "DK. BLUE", 37,39, 0),
+
+#undef MONINIT
diff --git a/monop/morg.c b/monop/morg.c
index 4b8e69f6..c9873f42 100644
--- a/monop/morg.c
+++ b/monop/morg.c
@@ -1,4 +1,4 @@
-/* $NetBSD: morg.c,v 1.10 2004/01/27 20:30:30 jsm Exp $ */
+/* $NetBSD: morg.c,v 1.11 2008/01/28 06:16:13 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)morg.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: morg.c,v 1.10 2004/01/27 20:30:30 jsm Exp $");
+__RCSID("$NetBSD: morg.c,v 1.11 2008/01/28 06:16:13 dholland Exp $");
#endif
#endif /* not lint */
@@ -83,7 +83,8 @@ static void fix_ex(int);
void
mortgage()
{
- int prop;
+#define prop __suk
+ int propnum;
for (;;) {
if (set_mlist() == 0) {
@@ -102,10 +103,11 @@ mortgage()
m(square[0]);
return;
}
- prop = getinp("Which property do you want to mortgage? ",names);
- if (prop == num_good)
+ propnum = getinp("Which property do you want to mortgage? ",
+ names);
+ if (propnum == num_good)
return;
- m(square[prop]);
+ m(square[propnum]);
notify();
}
}
diff --git a/monop/prop.c b/monop/prop.c
index 7b17b0a8..f5784b6e 100644
--- a/monop/prop.c
+++ b/monop/prop.c
@@ -1,4 +1,4 @@
-/* $NetBSD: prop.c,v 1.11 2006/03/19 00:18:47 christos Exp $ */
+/* $NetBSD: prop.c,v 1.12 2008/01/28 06:16:13 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)prop.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: prop.c,v 1.11 2006/03/19 00:18:47 christos Exp $");
+__RCSID("$NetBSD: prop.c,v 1.12 2008/01/28 06:16:13 dholland Exp $");
#endif
#endif /* not lint */
@@ -48,13 +48,13 @@ static int value(SQUARE *);
* appropriate flags.
*/
void
-buy(player, sqrp)
- int player;
+buy(playernum, sqrp)
+ int playernum;
SQUARE *sqrp;
{
trading = FALSE;
- sqrp->owner = player;
- add_list(player, &(play[player].own_list), cur_p->loc);
+ sqrp->owner = playernum;
+ add_list(playernum, &(play[playernum].own_list), cur_p->loc);
}
/*
diff --git a/monop/trade.c b/monop/trade.c
index ff60ca0a..ef5d9f80 100644
--- a/monop/trade.c
+++ b/monop/trade.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trade.c,v 1.9 2004/01/27 20:30:30 jsm Exp $ */
+/* $NetBSD: trade.c,v 1.10 2008/01/28 06:16:13 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)trade.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: trade.c,v 1.9 2004/01/27 20:30:30 jsm Exp $");
+__RCSID("$NetBSD: trade.c,v 1.10 2008/01/28 06:16:13 dholland Exp $");
#endif
#endif /* not lint */
@@ -107,7 +107,7 @@ get_list(struct_no, play_no)
{
int sn, pn;
PLAY *pp;
- int numin, prop, num_prp;
+ int numin, propnum, num_prp;
OWN *op;
TRADE *tp;
@@ -121,16 +121,16 @@ get_list(struct_no, play_no)
if (pp->own_list) {
numin = set_list(pp->own_list);
for (num_prp = numin; num_prp; ) {
- prop = getinp("Which property do you wish to trade? ",
+ propnum=getinp("Which property do you wish to trade? ",
plist);
- if (prop == numin)
+ if (propnum == numin)
break;
- else if (used[prop])
+ else if (used[propnum])
printf("You've already allocated that.\n");
else {
num_prp--;
- used[prop] = TRUE;
- for (op = pp->own_list; prop--; op = op->next)
+ used[propnum] = TRUE;
+ for (op = pp->own_list; propnum--; op = op->next)
continue;
add_list(pn, &(tp->prop_list), sqnum(op->sqr));
}