From: Marco Costalba Date: Wed, 20 Jul 2011 08:21:41 +0000 (+0200) Subject: Use std::vector to store UCI search moves X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=527a2ec541838e217b6ddcae856d0d4fa75ac7a4;hp=3185c36a6554390d9061f1d74eb16a6c39caefb4 Use std::vector to store UCI search moves Avoid the ugly and anyhow incorrect hard limit on the maximum number of moves and allow to handle an arbitrary number of moves to search. No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/uci.cpp b/src/uci.cpp index b17cf089..64489f79 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -189,7 +189,7 @@ namespace { string token; SearchLimits limits; - Move searchMoves[MAX_MOVES], *cur = searchMoves; + std::vector searchMoves; int time[] = { 0, 0 }, inc[] = { 0, 0 }; while (up >> token) @@ -216,14 +216,14 @@ namespace { up >> limits.maxTime; else if (token == "searchmoves") while (up >> token) - *cur++ = move_from_uci(pos, token); + searchMoves.push_back(move_from_uci(pos, token)); } - *cur = MOVE_NONE; + searchMoves.push_back(MOVE_NONE); limits.time = time[pos.side_to_move()]; limits.increment = inc[pos.side_to_move()]; - return think(pos, limits, searchMoves); + return think(pos, limits, &searchMoves[0]); }