From c9d7e99de682516c560009b550c41da9ae2008b8 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 24 Apr 2011 08:54:36 +0100 Subject: [PATCH 1/1] Rename MOVES_MAX in MAX_MOVES No functional change. Signed-off-by: Marco Costalba --- src/book.cpp | 2 +- src/move.cpp | 4 ++-- src/move.h | 2 +- src/movepick.cpp | 4 ++-- src/movepick.h | 2 +- src/position.cpp | 4 ++-- src/search.cpp | 8 ++++---- src/uci.cpp | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/book.cpp b/src/book.cpp index 091767b3..8c7cd52c 100644 --- a/src/book.cpp +++ b/src/book.cpp @@ -459,7 +459,7 @@ Move Book::get_move(const Position& pos, bool findBestMove) { move_to(Move(bookMove)), PieceType(p + 1))); // Verify the book move (if any) is legal - MoveStack mlist[MOVES_MAX]; + MoveStack mlist[MAX_MOVES]; MoveStack* last = generate(pos, mlist); for (MoveStack* cur = mlist; cur != last; cur++) if ((int(cur->move) & ~(3 << 14)) == bookMove) // Mask out special flags diff --git a/src/move.cpp b/src/move.cpp index f915feec..96215e82 100644 --- a/src/move.cpp +++ b/src/move.cpp @@ -70,7 +70,7 @@ const string move_to_uci(Move m, bool chess960) { Move move_from_uci(const Position& pos, const string& str) { - MoveStack mlist[MOVES_MAX]; + MoveStack mlist[MAX_MOVES]; MoveStack* last = generate(pos, mlist); for (MoveStack* cur = mlist; cur != last; cur++) @@ -90,7 +90,7 @@ const string move_to_san(Position& pos, Move m) { assert(pos.is_ok()); assert(move_is_ok(m)); - MoveStack mlist[MOVES_MAX]; + MoveStack mlist[MAX_MOVES]; Square from = move_from(m); Square to = move_to(m); PieceType pt = pos.type_of_piece_on(from); diff --git a/src/move.h b/src/move.h index ada89a4e..299379e2 100644 --- a/src/move.h +++ b/src/move.h @@ -26,7 +26,7 @@ #include "types.h" // Maximum number of allowed moves per position -const int MOVES_MAX = 256; +const int MAX_MOVES = 256; /// A move needs 16 bits to be stored /// diff --git a/src/movepick.cpp b/src/movepick.cpp index fa30de55..8872e39f 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -59,7 +59,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, int searchTT = ttm; ttMoves[0].move = ttm; badCaptureThreshold = 0; - badCaptures = moves + MOVES_MAX; + badCaptures = moves + MAX_MOVES; assert(d > DEPTH_ZERO); @@ -153,7 +153,7 @@ void MovePicker::go_next_phase() { // Bad captures SEE value is already calculated so just pick // them in order to get SEE move ordering. curMove = badCaptures; - lastMove = moves + MOVES_MAX; + lastMove = moves + MAX_MOVES; return; case PH_EVASIONS: diff --git a/src/movepick.h b/src/movepick.h index adae851d..765cae29 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -57,7 +57,7 @@ private: int badCaptureThreshold, phase; const uint8_t* phasePtr; MoveStack *curMove, *lastMove, *lastGoodNonCapture, *badCaptures; - MoveStack moves[MOVES_MAX]; + MoveStack moves[MAX_MOVES]; }; #endif // !defined(MOVEPICK_H_INCLUDED) diff --git a/src/position.cpp b/src/position.cpp index e3bf4aee..3f6400a8 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -649,7 +649,7 @@ bool Position::pl_move_is_evasion(Move m, Bitboard pinned) const bool Position::move_is_legal(const Move m) const { - MoveStack mlist[MOVES_MAX]; + MoveStack mlist[MAX_MOVES]; MoveStack *cur, *last = generate(*this, mlist); for (cur = mlist; cur != last; cur++) @@ -1795,7 +1795,7 @@ bool Position::is_draw() const { bool Position::is_mate() const { - MoveStack moves[MOVES_MAX]; + MoveStack moves[MAX_MOVES]; return is_check() && generate(*this, moves) == moves; } diff --git a/src/search.cpp b/src/search.cpp index e6903f1d..df1c9b50 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -214,7 +214,7 @@ namespace { inline int futility_move_count(Depth d) { - return d < 16 * ONE_PLY ? FutilityMoveCountArray[d] : MOVES_MAX; + return d < 16 * ONE_PLY ? FutilityMoveCountArray[d] : MAX_MOVES; } // Step 14. Reduced search @@ -418,7 +418,7 @@ void exit_threads() { ThreadsMgr.exit_threads(); } int64_t perft(Position& pos, Depth depth) { - MoveStack mlist[MOVES_MAX]; + MoveStack mlist[MAX_MOVES]; StateInfo st; Move m; int64_t sum = 0; @@ -764,7 +764,7 @@ namespace { assert(PvNode || alpha == beta - 1); assert(pos.thread() >= 0 && pos.thread() < ThreadsMgr.active_threads()); - Move movesSearched[MOVES_MAX]; + Move movesSearched[MAX_MOVES]; int64_t nodes; StateInfo st; const TTEntry *tte; @@ -2490,7 +2490,7 @@ split_point_start: // At split points actual search starts from here void RootMoveList::init(Position& pos, Move searchMoves[]) { - MoveStack mlist[MOVES_MAX]; + MoveStack mlist[MAX_MOVES]; Move* sm; clear(); diff --git a/src/uci.cpp b/src/uci.cpp index 9593b593..248601b5 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -205,7 +205,7 @@ namespace { string token; int time[] = { 0, 0 }, inc[] = { 0, 0 }; SearchLimits limits(0, 0, 0, 0, 0, 0, false, false); - Move searchMoves[MOVES_MAX] = { MOVE_NONE }; + Move searchMoves[MAX_MOVES] = { MOVE_NONE }; Move* cur = searchMoves; while (up >> token) -- 2.39.2