X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsan.cpp;h=222a10431be9a74f5f77223376739e87172de0a5;hp=efdf1773956a90510b33034c469bbdb8f8c62758;hb=1b0fee9b17a1220b60b3051626e8444f474e884c;hpb=9f943a132a2290f28eea388bf5ea45ddab7da973 diff --git a/src/san.cpp b/src/san.cpp index efdf1773..222a1043 100644 --- a/src/san.cpp +++ b/src/san.cpp @@ -172,7 +172,7 @@ Move move_from_san(const Position& pos, const std::string& movestr) { for (size_t i = 0; i < movestr.length(); i++) { char type, c = movestr[i]; - if (pieceLetters.find(c) != -1) + if (pieceLetters.find(c) != std::string::npos) type = 'P'; else if (c >= 'a' && c <= 'h') type = 'F'; @@ -223,7 +223,7 @@ Move move_from_san(const Position& pos, const std::string& movestr) { toRank = rank_from_char(c); state = (i < movestr.length() - 1) ? PROMOTION_OR_CHECK : END; } - else if (state == TO_FILE && fromRank == FILE_NONE) + else if (state == TO_FILE && fromRank == RANK_NONE) { // It's a disambiguation rank instead of a file fromRank = rank_from_char(c); @@ -263,7 +263,7 @@ Move move_from_san(const Position& pos, const std::string& movestr) { return MOVE_NONE; // Look for a matching move - Move m, move; + Move m, move = MOVE_NONE; to = make_square(toFile, toRank); int matches = 0;