Fix undefined behavior
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sat, 26 Nov 2016 14:13:58 +0000 (15:13 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 26 Nov 2016 15:49:59 +0000 (16:49 +0100)
This fixes #892. Undefined behavior as seen with
clang -fsanitize=undefined.

No functional change.

src/types.h

index 519f6af..a95420c 100644 (file)
@@ -209,7 +209,7 @@ const Piece Pieces[] = { W_PAWN, W_KNIGHT, W_BISHOP, W_ROOK, W_QUEEN, W_KING,
                          B_PAWN, B_KNIGHT, B_BISHOP, B_ROOK, B_QUEEN, B_KING };
 extern Value PieceValue[PHASE_NB][PIECE_NB];
 
-enum Depth {
+enum Depth : int {
 
   ONE_PLY = 1,