X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=7a8d0b019f19830b8c7ddfc05c66e6cdb1ace611;hp=cae315a150180a542569c57b7c3352ad54f1284b;hb=e4695f15bc62c0e34572b3a995e25b7461d2ae90;hpb=ffd6685f791f7e980cbada45ff66243c7b1aff76 diff --git a/src/types.h b/src/types.h index cae315a1..7a8d0b01 100644 --- a/src/types.h +++ b/src/types.h @@ -98,6 +98,7 @@ const int MAX_PLY_PLUS_6 = MAX_PLY + 6; /// bit 6-11: origin square (from 0 to 63) /// bit 12-13: promotion piece type - 2 (from KNIGHT-2 to QUEEN-2) /// bit 14-15: special move flag: promotion (1), en passant (2), castling (3) +/// NOTE: EN-PASSANT bit is set only when a pawn can be captured /// /// Special cases are MOVE_NONE and MOVE_NULL. We can sneak these in because in /// any normal move destination square is always different from origin square @@ -260,12 +261,12 @@ inline Value mg_value(Score s) { return Value(((s + 0x8000) & ~0xffff) / 0x10000 /// standard compliant, seems to work for Intel and MSVC. #if defined(IS_64BIT) && (!defined(__GNUC__) || defined(__INTEL_COMPILER)) -inline Value eg_value(Score s) { return Value(int16_t(s & 0xffff)); } +inline Value eg_value(Score s) { return Value(int16_t(s & 0xFFFF)); } #else inline Value eg_value(Score s) { - return Value((int)(unsigned(s) & 0x7fffu) - (int)(unsigned(s) & 0x8000u)); + return Value((int)(unsigned(s) & 0x7FFFU) - (int)(unsigned(s) & 0x8000U)); } #endif @@ -295,7 +296,7 @@ ENABLE_OPERATORS_ON(Square) ENABLE_OPERATORS_ON(File) ENABLE_OPERATORS_ON(Rank) -/// Added operators for adding integers to a Value +/// Additional operators to add integers to a Value inline Value operator+(Value v, int i) { return Value(int(v) + i); } inline Value operator-(Value v, int i) { return Value(int(v) - i); }