summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-11-29 06:42:21 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-11-29 06:42:21 +0000
commit5088359990d1a2115627a75174eeaf8b0ee62c9d (patch)
tree5fe74413fd4f7ace5b84115db77ac3fc1c490b38
parentec3f18f89c9276f3b7970964d1b354cc80e66a93 (diff)
Kill BOOLEAN, just use the curses/c++ bool type instead.
-rw-r--r--games/cribbage/crib.c28
-rw-r--r--games/cribbage/cribbage.h39
-rw-r--r--games/cribbage/deck.h4
-rw-r--r--games/cribbage/extern.c10
-rw-r--r--games/cribbage/io.c14
-rw-r--r--games/cribbage/score.c14
-rw-r--r--games/cribbage/support.c12
7 files changed, 60 insertions, 61 deletions
diff --git a/games/cribbage/crib.c b/games/cribbage/crib.c
index 44480f724a7..a5ec3d0976c 100644
--- a/games/cribbage/crib.c
+++ b/games/cribbage/crib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crib.c,v 1.6 1999/03/27 04:19:31 pjanzen Exp $ */
+/* $OpenBSD: crib.c,v 1.7 1999/11/29 06:42:20 millert Exp $ */
/* $NetBSD: crib.c,v 1.7 1997/07/10 06:47:29 mikel Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)crib.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: crib.c,v 1.6 1999/03/27 04:19:31 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: crib.c,v 1.7 1999/11/29 06:42:20 millert Exp $";
#endif
#endif /* not lint */
@@ -66,7 +66,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- BOOLEAN playing;
+ bool playing;
int ch;
#ifdef LOGGING
FILE *f;
@@ -209,8 +209,8 @@ void
game()
{
int i, j;
- BOOLEAN flag;
- BOOLEAN compcrib;
+ bool flag;
+ bool compcrib;
makedeck(deck);
shuffle(deck);
@@ -300,7 +300,7 @@ game()
*/
int
playhand(mycrib)
- BOOLEAN mycrib;
+ bool mycrib;
{
int deckpos;
@@ -332,7 +332,7 @@ playhand(mycrib)
*/
int
deal(mycrib)
- BOOLEAN mycrib;
+ bool mycrib;
{
int i, j;
@@ -355,7 +355,7 @@ deal(mycrib)
*/
void
discard(mycrib)
- BOOLEAN mycrib;
+ bool mycrib;
{
char *prompt;
CARD crd;
@@ -385,11 +385,11 @@ discard(mycrib)
*/
int
cut(mycrib, pos)
- BOOLEAN mycrib;
+ bool mycrib;
int pos;
{
int i;
- BOOLEAN win;
+ bool win;
win = FALSE;
if (mycrib) {
@@ -429,7 +429,7 @@ cut(mycrib, pos)
*/
void
prcrib(mycrib, blank)
- BOOLEAN mycrib, blank;
+ bool mycrib, blank;
{
int y, cardx;
@@ -460,13 +460,13 @@ static int Tcnt;
int
peg(mycrib)
- BOOLEAN mycrib;
+ bool mycrib;
{
static CARD ch[CINHAND], ph[CINHAND];
int i, j, k;
int l;
int cnum, pnum, sum;
- BOOLEAN myturn, mego, ugo, last, played;
+ bool myturn, mego, ugo, last, played;
CARD crd;
played = FALSE;
@@ -633,7 +633,7 @@ prtable(score)
*/
int
score(mycrib)
- BOOLEAN mycrib;
+ bool mycrib;
{
sorthand(crib, CINHAND);
if (mycrib) {
diff --git a/games/cribbage/cribbage.h b/games/cribbage/cribbage.h
index 4ddec968d4a..e94d70faaf7 100644
--- a/games/cribbage/cribbage.h
+++ b/games/cribbage/cribbage.h
@@ -1,3 +1,4 @@
+/* $OpenBSD: cribbage.h,v 1.2 1999/11/29 06:42:20 millert Exp $ */
/* $NetBSD: cribbage.h,v 1.3 1995/03/21 15:08:46 cgd Exp $ */
/*
@@ -53,11 +54,11 @@ extern int cgames; /* comp's games won */
extern int gamecount; /* # games played */
extern int Lastscore[2]; /* previous score for each */
-extern BOOLEAN iwon; /* if comp won last */
-extern BOOLEAN explain; /* player mistakes explained */
-extern BOOLEAN rflag; /* if all cuts random */
-extern BOOLEAN quiet; /* if suppress random mess */
-extern BOOLEAN playing; /* currently playing game */
+extern bool iwon; /* if comp won last */
+extern bool explain; /* player mistakes explained */
+extern bool rflag; /* if all cuts random */
+extern bool quiet; /* if suppress random mess */
+extern bool playing; /* currently playing game */
extern char expl[]; /* string for explanation */
@@ -67,13 +68,13 @@ int anymove __P((CARD [], int, int));
int anysumto __P((CARD [], int, int, int));
void bye __P((void));
int cchose __P((CARD [], int, int));
-void cdiscard __P((BOOLEAN));
+void cdiscard __P((bool));
int chkscr __P((int *, int));
int comphand __P((CARD [], char *));
void cremove __P((CARD, CARD [], int));
-int cut __P((BOOLEAN, int));
+int cut __P((bool, int));
int deal __P((int));
-void discard __P((BOOLEAN));
+void discard __P((bool));
void do_wait __P((void));
void endmsg __P((void));
int eq __P((CARD, CARD));
@@ -90,25 +91,25 @@ void makeboard __P((void));
void makedeck __P((CARD []));
void makeknown __P((CARD [], int));
void msg __P((const char *, ...));
-int msgcard __P((CARD, BOOLEAN));
-int msgcrd __P((CARD, BOOLEAN, char *, BOOLEAN));
+int msgcard __P((CARD, bool));
+int msgcrd __P((CARD, bool, char *, bool));
int number __P((int, int, char *));
int numofval __P((CARD [], int, int));
int pairuns __P((CARD [], int));
-int peg __P((BOOLEAN));
+int peg __P((bool));
int pegscore __P((CARD, CARD [], int, int));
-int playhand __P((BOOLEAN));
+int playhand __P((bool));
int plyrhand __P((CARD [], char *));
-void prcard __P((WINDOW *, int, int, CARD, BOOLEAN));
-void prcrib __P((BOOLEAN, BOOLEAN));
-void prhand __P((CARD [], int, WINDOW *, BOOLEAN));
-void printcard __P((WINDOW *, int, CARD, BOOLEAN));
-void prpeg __P((int, int, BOOLEAN));
+void prcard __P((WINDOW *, int, int, CARD, bool));
+void prcrib __P((bool, bool));
+void prhand __P((CARD [], int, WINDOW *, bool));
+void printcard __P((WINDOW *, int, CARD, bool));
+void prpeg __P((int, int, bool));
void prtable __P((int));
int readchar __P((void));
void rint __P((int));
-int score __P((BOOLEAN));
-int scorehand __P((CARD [], CARD, int, BOOLEAN, BOOLEAN));
+int score __P((bool));
+int scorehand __P((CARD [], CARD, int, bool, bool));
void shuffle __P((CARD []));
void sorthand __P((CARD [], int));
void wait_for __P((int));
diff --git a/games/cribbage/deck.h b/games/cribbage/deck.h
index 796175e0ddb..d03eb1fa7fe 100644
--- a/games/cribbage/deck.h
+++ b/games/cribbage/deck.h
@@ -1,3 +1,4 @@
+/* $OpenBSD: deck.h,v 1.2 1999/11/29 06:42:20 millert Exp $ */
/* $NetBSD: deck.h,v 1.3 1995/03/21 15:08:49 cgd Exp $ */
/*
@@ -82,6 +83,3 @@ typedef struct {
int rank;
int suit;
} CARD;
-
-typedef char BOOLEAN;
-
diff --git a/games/cribbage/extern.c b/games/cribbage/extern.c
index 8d7be990c1e..36fb6b9f782 100644
--- a/games/cribbage/extern.c
+++ b/games/cribbage/extern.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.c,v 1.2 1999/11/29 01:25:58 downsj Exp $ */
+/* $OpenBSD: extern.c,v 1.3 1999/11/29 06:42:20 millert Exp $ */
/* $NetBSD: extern.c,v 1.3 1995/03/21 15:08:50 cgd Exp $ */
/*-
@@ -47,10 +47,10 @@ static char rcsid[] = "$NetBSD: extern.c,v 1.3 1995/03/21 15:08:50 cgd Exp $";
#include "deck.h"
#include "cribbage.h"
-BOOLEAN explain = FALSE; /* player mistakes explained */
-BOOLEAN iwon = FALSE; /* if comp won last game */
-BOOLEAN quiet = FALSE; /* if suppress random mess */
-BOOLEAN rflag = FALSE; /* if all cuts random */
+bool explain = FALSE; /* player mistakes explained */
+bool iwon = FALSE; /* if comp won last game */
+bool quiet = FALSE; /* if suppress random mess */
+bool rflag = FALSE; /* if all cuts random */
char expl[128]; /* explanation */
diff --git a/games/cribbage/io.c b/games/cribbage/io.c
index 6e90d5db46d..765624b3b0e 100644
--- a/games/cribbage/io.c
+++ b/games/cribbage/io.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: io.c,v 1.4 1998/08/19 07:40:22 pjanzen Exp $ */
+/* $OpenBSD: io.c,v 1.5 1999/11/29 06:42:20 millert Exp $ */
/* $NetBSD: io.c,v 1.9 1997/07/09 06:25:47 phil Exp $ */
/*-
@@ -89,7 +89,7 @@ char *suitchar[SUITS] = {"S", "H", "D", "C"};
int
msgcard(c, brief)
CARD c;
- BOOLEAN brief;
+ bool brief;
{
if (brief)
return (msgcrd(c, TRUE, NULL, TRUE));
@@ -104,7 +104,7 @@ msgcard(c, brief)
int
msgcrd(c, brfrank, mid, brfsuit)
CARD c;
- BOOLEAN brfrank, brfsuit;
+ bool brfrank, brfsuit;
char *mid;
{
if (c.rank == EMPTY || c.suit == EMPTY)
@@ -131,7 +131,7 @@ printcard(win, cardno, c, blank)
WINDOW *win;
int cardno;
CARD c;
- BOOLEAN blank;
+ bool blank;
{
prcard(win, cardno * 2, cardno, c, blank);
}
@@ -145,7 +145,7 @@ prcard(win, y, x, c, blank)
WINDOW *win;
int y, x;
CARD c;
- BOOLEAN blank;
+ bool blank;
{
if (c.rank == EMPTY)
return;
@@ -172,7 +172,7 @@ prhand(h, n, win, blank)
CARD h[];
int n;
WINDOW *win;
- BOOLEAN blank;
+ bool blank;
{
int i;
@@ -250,7 +250,7 @@ incard(crd)
int i;
int rnk, sut;
char *line, *p, *p1;
- BOOLEAN retval;
+ bool retval;
retval = FALSE;
rnk = sut = EMPTY;
diff --git a/games/cribbage/score.c b/games/cribbage/score.c
index 369b03399f7..0c9595cf7f6 100644
--- a/games/cribbage/score.c
+++ b/games/cribbage/score.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: score.c,v 1.2 1998/08/19 07:40:24 pjanzen Exp $ */
+/* $OpenBSD: score.c,v 1.3 1999/11/29 06:42:20 millert Exp $ */
/* $NetBSD: score.c,v 1.3 1995/03/21 15:08:57 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: score.c,v 1.2 1998/08/19 07:40:24 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: score.c,v 1.3 1999/11/29 06:42:20 millert Exp $";
#endif
#endif /* not lint */
@@ -113,12 +113,12 @@ scorehand(hand, starter, n, crb, do_explain)
CARD hand[];
CARD starter;
int n;
- BOOLEAN crb; /* true if scoring crib */
- BOOLEAN do_explain; /* true if must explain this hand */
+ bool crb; /* true if scoring crib */
+ bool do_explain; /* true if must explain this hand */
{
int i, k;
int score;
- BOOLEAN flag;
+ bool flag;
CARD h[(CINHAND + 1)];
char buf[32];
@@ -234,7 +234,7 @@ pairuns(h, n)
int i;
int runlength, runmult, lastmult, curmult;
int mult1, mult2, pair1, pair2;
- BOOLEAN run;
+ bool run;
run = TRUE;
runlength = 1;
@@ -300,7 +300,7 @@ pegscore(crd, tbl, n, sum)
CARD crd, tbl[];
int n, sum;
{
- BOOLEAN got[RANKS];
+ bool got[RANKS];
int i, j, scr;
int k, lo, hi;
diff --git a/games/cribbage/support.c b/games/cribbage/support.c
index 0ef6decf3ea..4fe305877a1 100644
--- a/games/cribbage/support.c
+++ b/games/cribbage/support.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: support.c,v 1.3 1998/08/19 07:40:26 pjanzen Exp $ */
+/* $OpenBSD: support.c,v 1.4 1999/11/29 06:42:20 millert Exp $ */
/* $NetBSD: support.c,v 1.3 1995/03/21 15:08:59 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)support.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: support.c,v 1.3 1998/08/19 07:40:26 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: support.c,v 1.4 1999/11/29 06:42:20 millert Exp $";
#endif
#endif /* not lint */
@@ -134,7 +134,7 @@ plyrhand(hand, s)
{
static char prompt[BUFSIZ];
int i, j;
- BOOLEAN win;
+ bool win;
prhand(hand, CINHAND, Playwin, FALSE);
(void) sprintf(prompt, "Your %s scores ", s);
@@ -187,7 +187,7 @@ int
chkscr(scr, inc)
int *scr, inc;
{
- BOOLEAN myturn;
+ bool myturn;
myturn = (scr == &cscore);
if (inc != 0) {
@@ -209,7 +209,7 @@ void
prpeg(score, peg, myturn)
int score;
int peg;
- BOOLEAN myturn;
+ bool myturn;
{
int y, x;
@@ -246,7 +246,7 @@ prpeg(score, peg, myturn)
*/
void
cdiscard(mycrib)
- BOOLEAN mycrib;
+ bool mycrib;
{
CARD d[CARDS], h[FULLHAND], cb[2];
int i, j, k;