Prefer size_t over int for array sizes

Align to standard library conventions.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-08-19 10:20:15 +01:00
parent 7c1f8dbde9
commit 4b19430103
6 changed files with 26 additions and 33 deletions

View File

@@ -198,24 +198,23 @@ void Search::init() {
/// Search::perft() is our utility to verify move generation. All the leaf nodes
/// up to the given depth are generated and counted and the sum returned.
int64_t Search::perft(Position& pos, Depth depth) {
size_t Search::perft(Position& pos, Depth depth) {
// At the last ply just return the number of legal moves (leaf nodes)
if (depth == ONE_PLY)
return MoveList<LEGAL>(pos).size();
StateInfo st;
int64_t cnt = 0;
MoveList<LEGAL> ml(pos);
// At the last ply just return the number of moves (leaf nodes)
if (depth == ONE_PLY)
return ml.size();
size_t cnt = 0;
CheckInfo ci(pos);
for ( ; !ml.end(); ++ml)
for (MoveList<LEGAL> ml(pos); !ml.end(); ++ml)
{
pos.do_move(ml.move(), st, ci, pos.move_gives_check(ml.move(), ci));
cnt += perft(pos, depth - ONE_PLY);
pos.undo_move(ml.move());
}
return cnt;
}
@@ -1541,7 +1540,7 @@ split_point_start: // At split points actual search starts from here
int t = SearchTime.elapsed();
int selDepth = 0;
for (int i = 0; i < Threads.size(); i++)
for (size_t i = 0; i < Threads.size(); i++)
if (Threads[i].maxPly > selDepth)
selDepth = Threads[i].maxPly;