From bcbab1937670ca39ddb0a216ff9a787e56b79b3a Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Thu, 30 Oct 2014 12:11:20 +0100 Subject: [PATCH] Assume UCI 'nodes' is int64_t instead of int UCI specification is not clear on the size of integers that are exchanged in the protocol, so instead of a simple int, assume 'nodes' is a int64_t because we need a bigger size to store this value in many real cases, especialy with very long searches. No functional change. Resolves #75 --- src/search.cpp | 2 +- src/search.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 8099787e..fedad432 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1566,7 +1566,7 @@ void check_time() { { Threads.mutex.lock(); - int nodes = RootPos.nodes_searched(); + int64_t nodes = RootPos.nodes_searched(); // Loop across all split points and sum accumulated SplitPoint nodes plus // all the currently active positions nodes. diff --git a/src/search.h b/src/search.h index 4fe5a5b4..2fd160b6 100644 --- a/src/search.h +++ b/src/search.h @@ -78,13 +78,14 @@ struct RootMove { struct LimitsType { LimitsType() { // Using memset on a std::vector is undefined behavior - time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = movestogo = - depth = nodes = movetime = mate = infinite = ponder = 0; + nodes = time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = movestogo = + depth = movetime = mate = infinite = ponder = 0; } bool use_time_management() const { return !(mate | movetime | depth | nodes | infinite); } std::vector searchmoves; - int time[COLOR_NB], inc[COLOR_NB], movestogo, depth, nodes, movetime, mate, infinite, ponder; + int time[COLOR_NB], inc[COLOR_NB], movestogo, depth, movetime, mate, infinite, ponder; + int64_t nodes; }; -- 2.39.2