From: Arun Persaud Date: Tue, 8 Sep 2009 16:33:53 +0000 (-0700) Subject: another bug fix found by Stanislav Brabec X-Git-Tag: v4.4.1.20091019~86 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=00f6fcd2f683cda76e458177526a96f94957d345 another bug fix found by Stanislav Brabec returned -1 in some case although the variable was a char... changed to signed char --- diff --git a/backend.c b/backend.c index 2f96d08..2f839b9 100644 --- a/backend.c +++ b/backend.c @@ -456,10 +456,10 @@ AppData appData; Board boards[MAX_MOVES]; /* [HGM] Following 7 needed for accurate legality tests: */ -char epStatus[MAX_MOVES]; -char castlingRights[MAX_MOVES][BOARD_SIZE]; // stores files for pieces with castling rights or -1 -char castlingRank[BOARD_SIZE]; // and corresponding ranks -char initialRights[BOARD_SIZE], FENcastlingRights[BOARD_SIZE], fileRights[BOARD_SIZE]; +signed char epStatus[MAX_MOVES]; +signed char castlingRights[MAX_MOVES][BOARD_SIZE]; // stores files for pieces with castling rights or -1 +signed char castlingRank[BOARD_SIZE]; // and corresponding ranks +signed char initialRights[BOARD_SIZE], FENcastlingRights[BOARD_SIZE], fileRights[BOARD_SIZE]; int nrCastlingRights; // For TwoKings, or to implement castling-unknown status int initialRulePlies, FENrulePlies; char FENepStatus; diff --git a/moves.c b/moves.c index b5b9c2f..b4572fe 100644 --- a/moves.c +++ b/moves.c @@ -69,7 +69,7 @@ int BlackPiece P((ChessSquare)); int SameColor P((ChessSquare, ChessSquare)); int PosFlags(int index); -extern char initialRights[BOARD_SIZE]; /* [HGM] all rights enabled, set in InitPosition */ +extern signed char initialRights[BOARD_SIZE]; /* [HGM] all rights enabled, set in InitPosition */ int WhitePiece(piece) diff --git a/parser.h b/parser.h index c7b87e2..78e8de6 100644 --- a/parser.h +++ b/parser.h @@ -62,5 +62,5 @@ extern int yyskipmoves; /* If TRUE, all moves are reported as AmbiguousMove extern char *yy_text; /* Needed because yytext can be either a char[] or a (non-constant) char* */ extern int yyoffset P((void)); -extern char initialRights[BOARD_SIZE]; -extern char castlingRights[MAX_MOVES][BOARD_SIZE]; +extern signed char initialRights[BOARD_SIZE]; +extern signed char castlingRights[MAX_MOVES][BOARD_SIZE];