X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fuci.cpp;h=931891a0263cc6c32f7df193a8380a487e9aa905;hb=03ad183384d484990248cb22394a93926f421520;hp=fb24bb264c9235cc0f4742afcf52763906ac71f3;hpb=3d8140a54101a50860ba2e3eb0f2d6cce68bfe47;p=stockfish diff --git a/src/uci.cpp b/src/uci.cpp index fb24bb26..931891a0 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -39,7 +39,7 @@ namespace { // Keep track of position keys along the setup moves (from start position to the // position just before to start searching). This is needed by draw detection. - std::vector SetupState; + std::vector SetupState(200, StateInfo()); // UCIParser is a class for parsing UCI input. The class // is actually a string stream built on a given input string. @@ -144,13 +144,13 @@ namespace { } else return; - // Parse move list (if any) SetupState.clear(); + // Parse move list (if any) while (up >> token && (m = move_from_uci(pos, token)) != MOVE_NONE) { SetupState.push_back(StateInfo()); - pos.do_setup_move(m, SetupState.back()); + pos.do_move(m, SetupState.back()); } } @@ -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]); }