]> git.sesse.net Git - stockfish/commitdiff
Assume UCI 'nodes' is int64_t instead of int
authorMarco Costalba <mcostalba@gmail.com>
Thu, 30 Oct 2014 11:11:20 +0000 (12:11 +0100)
committerJoona Kiiski <joona.kiiski@gmail.com>
Wed, 5 Nov 2014 21:11:05 +0000 (21:11 +0000)
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
src/search.h

index 8099787ec71980751e8fa826f641e058326e0609..fedad43241050a6c33007a5b269501f33bf48264 100644 (file)
@@ -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.
index 4fe5a5b4f60bfd41a528781f5d0dff74137e607b..2fd160b68a6d9ab5a58f45e8321880c9ab3d9b98 100644 (file)
@@ -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<Move> 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;
 };