X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.h;h=4e1d3c351ea51db7e887faff24d4c337e06c1919;hp=5a0ad5df5790708e3a0e1d8d37f2926fcb3b668a;hb=4095ff0ee51bdc76c247bd11d5f3a7008974e2ad;hpb=856a5f3aaaf8b9d53599963decacd4476b55c034 diff --git a/src/search.h b/src/search.h index 5a0ad5df..4e1d3c35 100644 --- a/src/search.h +++ b/src/search.h @@ -55,15 +55,15 @@ struct Stack { struct RootMove { - RootMove(Move m) : score(-VALUE_INFINITE), previousScore(-VALUE_INFINITE), pv(1, m) {} + explicit RootMove(Move m) : pv(1, m) {} bool operator<(const RootMove& m) const { return score > m.score; } // Ascending sort bool operator==(const Move& m) const { return pv[0] == m; } void insert_pv_in_tt(Position& pos); - Move extract_ponder_from_tt(Position& pos); + bool extract_ponder_from_tt(Position& pos); - Value score; - Value previousScore; + Value score = -VALUE_INFINITE; + Value previousScore = -VALUE_INFINITE; std::vector pv; }; @@ -76,7 +76,7 @@ typedef std::vector RootMoveVector; struct LimitsType { LimitsType() { // Init explicitly due to broken value-initialization of non POD in MSVC - nodes = time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = movestogo = + nodes = time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = npmsec = movestogo = depth = movetime = mate = infinite = ponder = 0; } @@ -85,7 +85,7 @@ struct LimitsType { } std::vector searchmoves; - int time[COLOR_NB], inc[COLOR_NB], movestogo, depth, movetime, mate, infinite, ponder; + int time[COLOR_NB], inc[COLOR_NB], npmsec, movestogo, depth, movetime, mate, infinite, ponder; int64_t nodes; }; @@ -96,17 +96,17 @@ struct SignalsType { bool stop, stopOnPonderhit, firstRootMove, failedLowAtRoot; }; -typedef std::auto_ptr > StateStackPtr; +typedef std::unique_ptr> StateStackPtr; extern volatile SignalsType Signals; extern LimitsType Limits; extern RootMoveVector RootMoves; extern Position RootPos; -extern Time::point SearchTime; extern StateStackPtr SetupStates; void init(); void think(); +void reset(); template uint64_t perft(Position& pos, Depth depth); } // namespace Search