From 0b6a2f8856907c367fe3bbdf18e8c8f24bd0231e Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Sun, 25 May 2014 23:50:09 +0200 Subject: [PATCH] Bool transition: init.c and friends --- gnushogi/globals.c | 14 +++++++------- gnushogi/gnushogi.h | 18 +++++++++--------- gnushogi/init.c | 6 +++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/gnushogi/globals.c b/gnushogi/globals.c index ae1bf24..44b7881 100644 --- a/gnushogi/globals.c +++ b/gnushogi/globals.c @@ -33,7 +33,7 @@ #include "gnushogi.h" -short ahead = true, hash = true; +bool ahead = true, hash = true; /* default values for CLI flags -a and -h */ char *xwin = 0; char *Lang = NULL; @@ -167,33 +167,33 @@ value_array *value = NULL; fscore_array *fscore = NULL; #ifndef SAVE_DISTDATA -short use_distdata = true; +bool use_distdata = true; distdata_array *distdata = NULL; #endif #ifndef SAVE_PTYPE_DISTDATA -short use_ptype_distdata = true; +bool use_ptype_distdata = true; distdata_array *ptype_distdata[NO_PTYPE_PIECES]; #endif #if !defined SAVE_NEXTPOS next_array *nextdir[NO_PTYPE_PIECES]; next_array *nextpos[NO_PTYPE_PIECES]; -short use_nextpos = true; +bool use_nextpos = true; #endif #if defined HISTORY -short use_history = true; +bool use_history = true; unsigned short *history = NULL; #endif #ifdef CACHE -short use_etable = true; +bool use_etable = true; etable_field *etab[2] = { NULL, NULL }; #endif #if ttblsz -short use_ttable = true; +bool use_ttable = true; unsigned int ttblsize = ttblsz; struct hashentry *ttable[2] = { NULL, NULL }; #endif diff --git a/gnushogi/gnushogi.h b/gnushogi/gnushogi.h index dfa577f..a7baf2d 100644 --- a/gnushogi/gnushogi.h +++ b/gnushogi/gnushogi.h @@ -571,7 +571,7 @@ struct etable }; #if defined CACHE -extern short use_etable; +extern bool use_etable; typedef struct etable etable_field[ETABLE]; extern etable_field *etab[2]; #endif @@ -672,7 +672,7 @@ extern short debug_moves; #ifdef HISTORY -extern short use_history; +extern bool use_history; extern unsigned short *history; #endif @@ -688,7 +688,7 @@ extern struct leaf *root; extern char savefile[], listfile[]; extern short TrPnt[]; extern small_short board[], color[]; -extern const small_short sweep[NO_PIECES]; +extern const bool sweep[NO_PIECES]; extern small_short PieceList[2][NO_SQUARES], PawnCnt[2][NO_COLS]; extern small_short Captured[2][NO_PIECES]; @@ -753,7 +753,7 @@ extern short stage, stage2; #define in_middlegame_stage (!flag.tsume && (stage >= 33) && (stage <= 66)) #define in_endgame_stage (flag.tsume || (stage > 66)) -extern short ahead, hash; +extern bool ahead, hash; extern short balance[2]; extern bool ChkFlag[], CptrFlag[], TesujiFlag[]; extern short Pscore[], Tscore[]; @@ -776,7 +776,7 @@ extern const small_short relative_value[]; extern const long control[]; extern small_short diagonal(short delta); extern const small_short promoted[NO_PIECES], unpromoted[NO_PIECES]; -extern const small_short is_promoted[NO_PIECES]; +extern const bool is_promoted[NO_PIECES]; typedef unsigned char next_array[NO_SQUARES][NO_SQUARES]; typedef small_short distdata_array[NO_SQUARES][NO_SQUARES]; @@ -794,7 +794,7 @@ extern short first_direction(short ptyp, short *d, short sq); extern short next_direction(short ptyp, short *d, short sq); extern short next_position(short ptyp, short *d, short sq, short u); #else -extern short use_nextpos; +extern bool use_nextpos; extern next_array *nextpos[NO_PTYPE_PIECES]; extern next_array *nextdir[NO_PTYPE_PIECES]; #endif @@ -803,12 +803,12 @@ extern value_array *value; extern fscore_array *fscore; #ifndef SAVE_DISTDATA -extern short use_distdata; +extern bool use_distdata; extern distdata_array *distdata; #endif #ifndef SAVE_PTYPE_DISTDATA -extern short use_ptype_distdata; +extern bool use_ptype_distdata; extern distdata_array *ptype_distdata[NO_PTYPE_PIECES]; #endif @@ -858,7 +858,7 @@ extern short background; #endif /* QUIETBACKGROUND */ #if ttblsz -extern short use_ttable; +extern bool use_ttable; extern struct hashentry *ttable[2]; #endif diff --git a/gnushogi/init.c b/gnushogi/init.c index 2463fbc..d6babdf 100644 --- a/gnushogi/init.c +++ b/gnushogi/init.c @@ -66,7 +66,7 @@ display_t display_type = DISPLAY_X; /* .... MOVE GENERATION VARIABLES AND INITIALIZATIONS .... */ #ifdef SAVE_NEXTPOS -const small_short psweep[NO_PTYPE_PIECES] = +static const bool psweep[NO_PTYPE_PIECES] = { false, #ifndef MINISHOGI @@ -81,7 +81,7 @@ const small_short psweep[NO_PTYPE_PIECES] = }; #endif -const small_short sweep[NO_PIECES] = +const bool sweep[NO_PIECES] = { false, false, #ifndef MINISHOGI @@ -164,7 +164,7 @@ Initialize_dist(void) */ -const small_short is_promoted[NO_PIECES] = +const bool is_promoted[NO_PIECES] = { false, false, #ifndef MINISHOGI -- 2.11.4.GIT