]> git.sesse.net Git - stockfish/commitdiff
Perft should return an int64_t not an int
authorMarco Costalba <mcostalba@gmail.com>
Wed, 5 Jan 2011 16:03:57 +0000 (17:03 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 5 Jan 2011 20:13:21 +0000 (21:13 +0100)
Found by Louis Zulli with his super fast
hardware: 65M nodes/sec at perft !

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp
src/search.h
src/uci.cpp

index d75036b33413eee1705200ed6905c7df1aa60570..ba0a47f52ed3a9c8668e101959c5c2fb82d20050 100644 (file)
@@ -364,12 +364,12 @@ void init_search() {
 /// perft() is our utility to verify move generation is bug free. All the legal
 /// moves up to given depth are generated and counted and the sum returned.
 
-int perft(Position& pos, Depth depth)
+int64_t perft(Position& pos, Depth depth)
 {
     MoveStack mlist[MOVES_MAX];
     StateInfo st;
     Move m;
-    int sum = 0;
+    int64_t sum = 0;
 
     // Generate all legal moves
     MoveStack* last = generate_moves(pos, mlist);
index b2c876455c7c0c4afcbacdd9d75a43b8bd1c5911..22a74bcfd22a9644285e8b7adc811134db3deca7 100644 (file)
@@ -70,7 +70,7 @@ struct SearchStack {
 extern void init_search();
 extern void init_threads();
 extern void exit_threads();
-extern int perft(Position& pos, Depth depth);
+extern int64_t perft(Position& pos, Depth depth);
 extern bool think(Position& pos, bool infinite, bool ponder, int time[], int increment[],
                   int movesToGo, int maxDepth, int maxNodes, int maxTime, Move searchMoves[]);
 
index 1b10c7b418697c969f00d8f8b9a4e0ed938db3db..28cbacb38f3b6455d7484b5000c1eb09bbb93e77 100644 (file)
@@ -287,7 +287,8 @@ namespace {
 
   void perft(Position& pos, UCIParser& up) {
 
-    int depth, tm, n;
+    int depth, tm;
+    int64_t n;
 
     if (!(up >> depth))
         return;