From: mstembera Date: Wed, 16 May 2018 21:38:13 +0000 (+0200) Subject: Fix MSVC errors in tbprobe.cpp X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=e8005ebe569c102bca627b24c1dcf1b8a2d900c8 Fix MSVC errors in tbprobe.cpp Default template parameters values and recursive functions do not play well together. Fix for below errors that showed up after updating to latest MSVC. ```` tbprobe.cpp(1156): error C2672: 'search': no matching overloaded function found tbprobe.cpp(1198): error C2783: 'Tablebases::WDLScore `anonymous-namespace'::search(Position &,Tablebases::ProbeState *)': could not deduce template argument for 'CheckZeroingMoves' ```` Closes https://github.com/official-stockfish/Stockfish/pull/1594 No functional change. --- diff --git a/src/syzygy/tbprobe.cpp b/src/syzygy/tbprobe.cpp index fbd5c6dd..2b7f4497 100644 --- a/src/syzygy/tbprobe.cpp +++ b/src/syzygy/tbprobe.cpp @@ -1131,11 +1131,11 @@ Ret probe_table(const Position& pos, ProbeState* result, WDLScore wdl = WDLDraw) // All of this means that during probing, the engine must look at captures and probe // their results and must probe the position itself. The "best" result of these // probes is the correct result for the position. -// DTZ table don't store values when a following move is a zeroing winning move +// DTZ tables do not store values when a following move is a zeroing winning move // (winning capture or winning pawn move). Also DTZ store wrong values for positions // where the best move is an ep-move (even if losing). So in all these cases set // the state to ZEROING_BEST_MOVE. -template +template WDLScore search(Position& pos, ProbeState* result) { WDLScore value, bestValue = WDLLoss; @@ -1153,7 +1153,7 @@ WDLScore search(Position& pos, ProbeState* result) { moveCount++; pos.do_move(move, st); - value = -search(pos, result); + value = -search(pos, result); pos.undo_move(move); if (*result == FAIL) @@ -1347,7 +1347,7 @@ void Tablebases::init(const std::string& paths) { WDLScore Tablebases::probe_wdl(Position& pos, ProbeState* result) { *result = OK; - return search(pos, result); + return search(pos, result); } // Probe the DTZ table for a particular position. @@ -1412,7 +1412,7 @@ int Tablebases::probe_dtz(Position& pos, ProbeState* result) { // otherwise we will get the dtz of the next move sequence. Search the // position after the move to get the score sign (because even in a // winning position we could make a losing capture or going for a draw). - dtz = zeroing ? -dtz_before_zeroing(search(pos, result)) + dtz = zeroing ? -dtz_before_zeroing(search(pos, result)) : -probe_dtz(pos, result); // If the move mates, force minDTZ to 1