From 55b16593a487f6874a209d995265d7b88860fcd9 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Wed, 5 Jan 2011 17:03:57 +0100 Subject: [PATCH] Perft should return an int64_t not an int Found by Louis Zulli with his super fast hardware: 65M nodes/sec at perft ! No functional change. Signed-off-by: Marco Costalba --- src/search.cpp | 4 ++-- src/search.h | 2 +- src/uci.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index d75036b3..ba0a47f5 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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); diff --git a/src/search.h b/src/search.h index b2c87645..22a74bcf 100644 --- a/src/search.h +++ b/src/search.h @@ -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[]); diff --git a/src/uci.cpp b/src/uci.cpp index 1b10c7b4..28cbacb3 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -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; -- 2.39.2