another bug fix found by Stanislav Brabec
authorArun Persaud <arun@nubati.net>
Tue, 8 Sep 2009 16:33:53 +0000 (09:33 -0700)
committerArun Persaud <arun@nubati.net>
Sun, 27 Sep 2009 17:07:57 +0000 (10:07 -0700)
returned -1  in some case although the variable was a char...  changed to signed char

backend.c
moves.c
parser.h

index 2f96d08..2f839b9 100644 (file)
--- 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 (file)
--- 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)
index c7b87e2..78e8de6 100644 (file)
--- 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];