X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=2f18427d827f8111d0357416d92525bb4ad7bb72;hp=12485fbb780fb64026e359bc97cdd271ea9c2599;hb=bb3427ca85bdb20b4c8af12b63f635d03c5e9146;hpb=c6f497f09de59ce4889c2045e0e4b6efb3082899 diff --git a/src/position.cpp b/src/position.cpp index 12485fbb..2f18427d 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include "bitcount.h" #include "movegen.h" @@ -96,7 +97,7 @@ CheckInfo::CheckInfo(const Position& pos) { /// or the FEN string, we want the new born Position object do not depend /// on any external data so we detach state pointer from the source one. -Position::Position(const Position& pos, int th) { +void Position::copy(const Position& pos, int th) { memcpy(this, &pos, sizeof(Position)); threadID = th; @@ -223,7 +224,7 @@ void Position::from_fen(const string& fenStr, bool isChess960) { // Convert from fullmove starting from 1 to ply starting from 0, // handle also common incorrect FEN with fullmove = 0. - startPosPly = Max(2 * (startPosPly - 1), 0) + int(sideToMove == BLACK); + startPosPly = std::max(2 * (startPosPly - 1), 0) + int(sideToMove == BLACK); st->key = compute_key(); st->pawnKey = compute_pawn_key(); @@ -1330,7 +1331,7 @@ int Position::see(Move m) const { // Having built the swap list, we negamax through it to find the best // achievable score from the point of view of the side to move. while (--slIndex) - swapList[slIndex-1] = Min(-swapList[slIndex], swapList[slIndex-1]); + swapList[slIndex-1] = std::min(-swapList[slIndex], swapList[slIndex-1]); return swapList[0]; } @@ -1502,7 +1503,7 @@ bool Position::is_draw() const { // Draw by repetition? if (!SkipRepetition) { - int i = 4, e = Min(st->rule50, st->pliesFromNull); + int i = 4, e = std::min(st->rule50, st->pliesFromNull); if (i <= e) {