From eac5068feece8cc21e80cc8ef3189f3e74bdd03f Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sun, 25 May 2014 15:29:23 +0200 Subject: [PATCH] Bool transition: struct flags and side-effects. --- gnushogi/commondsp.c | 2 +- gnushogi/gnushogi.h | 46 +++++++++++++++++++++++----------------------- gnushogi/search.c | 2 +- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gnushogi/commondsp.c b/gnushogi/commondsp.c index 5380397..d31ea90 100644 --- a/gnushogi/commondsp.c +++ b/gnushogi/commondsp.c @@ -1502,7 +1502,7 @@ InputCommand(char *command) #ifdef QUIETBACKGROUND bool have_shown_prompt = false; #endif - short ok, done, is_move = false; + bool ok, done, is_move = false; unsigned short mv; char s[80], sx[80]; diff --git a/gnushogi/gnushogi.h b/gnushogi/gnushogi.h index 5007dca..d193ad3 100644 --- a/gnushogi/gnushogi.h +++ b/gnushogi/gnushogi.h @@ -635,30 +635,30 @@ struct TimeControlRec struct flags { - short mate; /* the game is over */ - short post; /* show principle variation */ - short quit; /* quit/exit */ - short regularstart; /* did the game start from standard + bool mate; /* the game is over */ + bool post; /* show principle variation */ + bool quit; /* quit/exit */ + bool regularstart; /* did the game start from standard * initial board ? */ - short reverse; /* reverse board display */ - short bothsides; /* computer plays both sides */ - short hash; /* enable/disable transposition table */ - short force; /* enter moves */ - short easy; /* disable thinking on opponents time */ - short beep; /* enable/disable beep */ - short timeout; /* time to make a move */ - short musttimeout; /* time to make a move */ - short back; /* time to make a move */ - short rcptr; /* enable/disable recapture heuristics */ - short rv; /* reverse video */ - short stars; /* add stars to uxdsp screen */ - short coords; /* add coords to visual screen */ - short shade; - short material; /* draw on lack of material */ - short illegal; /* illegal position */ - short onemove; /* timing is onemove */ - short gamein; /* timing is gamein */ - short tsume; /* first consider checks */ + bool reverse; /* reverse board display */ + bool bothsides; /* computer plays both sides */ + bool hash; /* enable/disable transposition table */ + bool force; /* enter moves */ + bool easy; /* disable thinking on opponents time */ + bool beep; /* enable/disable beep */ + bool timeout; /* time to make a move */ + bool musttimeout; /* time to make a move */ + bool back; /* time to make a move */ + bool rcptr; /* enable/disable recapture heuristics */ + bool rv; /* reverse video */ + bool stars; /* add stars to uxdsp screen */ + bool coords; /* add coords to visual screen */ + bool shade; + bool material; /* draw on lack of material */ + bool illegal; /* illegal position */ + bool onemove; /* timing is onemove */ + bool gamein; /* timing is gamein */ + bool tsume; /* first consider checks */ }; extern FILE *debugfile; diff --git a/gnushogi/search.c b/gnushogi/search.c index 882e3df..89293df 100644 --- a/gnushogi/search.c +++ b/gnushogi/search.c @@ -121,7 +121,7 @@ pick(short p1, short p2) return false; } -int bookflag = false; +bool bookflag = false; int Jscore = 0; int TCcount; -- 2.11.4.GIT