X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsyzygy%2Ftbprobe.cpp;h=14d34e79b097af0ac406d822f5dbe1006e245ff3;hp=17326970a49c55194ddc7e37c3a2946306c87a47;hb=8fb45caadef67fb2ccc27857c15ade987d9f5e2f;hpb=856a5f3aaaf8b9d53599963decacd4476b55c034 diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index 17326970..14d34e79 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -7,13 +7,14 @@ this code to other chess engines. */ +#define NOMINMAX + #include #include "../position.h" #include "../movegen.h" #include "../bitboard.h" #include "../search.h" -#include "../bitcount.h" #include "tbprobe.h" #include "tbcore.h" @@ -37,12 +38,12 @@ static void prt_str(Position& pos, char *str, int mirror) color = !mirror ? WHITE : BLACK; for (pt = KING; pt >= PAWN; --pt) - for (i = popcount(pos.pieces(color, pt)); i > 0; i--) + for (i = popcount(pos.pieces(color, pt)); i > 0; i--) *str++ = pchr[6 - pt]; *str++ = 'v'; color = ~color; for (pt = KING; pt >= PAWN; --pt) - for (i = popcount(pos.pieces(color, pt)); i > 0; i--) + for (i = popcount(pos.pieces(color, pt)); i > 0; i--) *str++ = pchr[6 - pt]; *str++ = 0; } @@ -58,11 +59,11 @@ static uint64 calc_key(Position& pos, int mirror) color = !mirror ? WHITE : BLACK; for (pt = PAWN; pt <= KING; ++pt) - for (i = popcount(pos.pieces(color, pt)); i > 0; i--) + for (i = popcount(pos.pieces(color, pt)); i > 0; i--) key ^= Zobrist::psq[WHITE][pt][i - 1]; color = ~color; for (pt = PAWN; pt <= KING; ++pt) - for (i = popcount(pos.pieces(color, pt)); i > 0; i--) + for (i = popcount(pos.pieces(color, pt)); i > 0; i--) key ^= Zobrist::psq[BLACK][pt][i - 1]; return key; @@ -622,7 +623,7 @@ int Tablebases::probe_dtz(Position& pos, int *success) if (v1 >= 0) v = v1; } else if (v < 0) { - if (v1 >= 0 || v1 < 100) + if (v1 >= 0 || v1 < -100) v = v1; } else if (v > 100) { if (v1 > 0)