X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=506e1b0f9b5f1adeb6c82db127d89b5165432ec4;hp=2219b40becd8d929e8e73186374e2895b2411e40;hb=b5b799b5ab4de93aa8a03a310d2f178698a5cf86;hpb=feeafb0a50556654e345a09d16529a5eb7715dc0 diff --git a/src/types.h b/src/types.h index 2219b40b..506e1b0f 100644 --- a/src/types.h +++ b/src/types.h @@ -35,6 +35,7 @@ /// | only in 64-bit mode. For compiling requires hardware with /// | popcnt support. +#include #include #include #include @@ -163,7 +164,7 @@ enum Bound { BOUND_NONE = 0, BOUND_UPPER = 1, BOUND_LOWER = 2, - BOUND_EXACT = BOUND_UPPER | BOUND_LOWER | 4 + BOUND_EXACT = BOUND_UPPER | BOUND_LOWER }; enum Value { @@ -391,7 +392,8 @@ inline PieceType type_of(Piece p) { } inline Color color_of(Piece p) { - return p == NO_PIECE ? NO_COLOR : Color(p >> 3); + assert(p != NO_PIECE); + return Color(p >> 3); } inline bool is_ok(Square s) { @@ -473,7 +475,7 @@ inline Move make_move(Square from, Square to) { template inline Move make(Square from, Square to, PieceType pt = KNIGHT) { - return Move(to | (from << 6) | T | ((pt - KNIGHT) << 12)) ; + return Move(to | (from << 6) | T | ((pt - KNIGHT) << 12)); } inline bool is_ok(Move m) {