From: Eric S. Raymond Date: Tue, 19 Oct 2010 10:19:17 +0000 (-0400) Subject: Use bools and stdlib. X-Git-Tag: 2.8~5 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=80ccf7e218c86d3412dcd3f146ea18b853f8e48a;p=bs.git Use bools and stdlib. --- diff --git a/bs.c b/bs.c index 0fb5e8a..07bc2d5 100644 --- a/bs.c +++ b/bs.c @@ -3,8 +3,6 @@ * salvo option by: Chuck A DeGaul * with improved user interface, autoconfiguration and code cleanup * by Eric S. Raymond - * - * $Id: bs.c,v 1.9 2001/05/07 20:27:59 esr Exp esr $ */ #include @@ -14,6 +12,8 @@ #include #include #include +#include +#include #ifndef SIGIOT #define SIGIOT SIGABRT @@ -154,7 +154,7 @@ static char board[2][BWIDTH][BDEPTH]; static int turn; /* 0=player, 1=computer */ static int plywon=0, cpuwon=0; /* How many games has each won? */ -static int salvo, blitz, closepack; +static bool salvo, blitz, closepack; #define PR (void)addstr @@ -1175,8 +1175,8 @@ static void do_options(int c, char *op[]) switch(op[i][1]) { case 'b': - blitz = 1; - if (salvo == 1) + blitz = true; + if (salvo) { (void) fprintf(stderr, "Bad Arg: -b and -s are mutually exclusive\n"); @@ -1184,8 +1184,8 @@ static void do_options(int c, char *op[]) } break; case 's': - salvo = 1; - if (blitz == 1) + salvo = true; + if (blitz) { (void) fprintf(stderr, "Bad Arg: -s and -b are mutually exclusive\n"); @@ -1193,7 +1193,7 @@ static void do_options(int c, char *op[]) } break; case 'c': - closepack = 1; + closepack = true; break; default: (void) fprintf(stderr,