From 5bed82cd4e34c329bd08c57963ccc93c15ca0f05 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Thu, 19 Aug 2010 16:36:18 +0100 Subject: [PATCH] Introduce and use SCORE_ZERO No functional change. Signed-off-by: Marco Costalba --- src/evaluate.cpp | 2 +- src/pawns.cpp | 2 +- src/position.cpp | 2 +- src/value.h | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 47d5eb3e..e7af3073 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -634,7 +634,7 @@ namespace { const Color Them = (Us == WHITE ? BLACK : WHITE); Bitboard b; - Score bonus = make_score(0, 0); + Score bonus = SCORE_ZERO; // Enemy pieces not defended by a pawn and under our attack Bitboard weakEnemies = pos.pieces_of_color(Them) diff --git a/src/pawns.cpp b/src/pawns.cpp index 5a789ef2..cec9aba1 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -185,7 +185,7 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns, Rank r; int bonus; bool passed, isolated, doubled, opposed, chain, backward, candidate; - Score value = make_score(0, 0); + Score value = SCORE_ZERO; const Square* ptr = pos.piece_list_begin(Us, PAWN); // Initialize pawn storm scores by giving bonuses for open files diff --git a/src/position.cpp b/src/position.cpp index 058fab66..11684d76 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1658,7 +1658,7 @@ Key Position::compute_material_key() const { /// updated by do_move and undo_move when the program is running in debug mode. Score Position::compute_value() const { - Score result = make_score(0, 0); + Score result = SCORE_ZERO; Bitboard b; Square s; diff --git a/src/value.h b/src/value.h index d86a8bb9..345526b6 100644 --- a/src/value.h +++ b/src/value.h @@ -68,8 +68,9 @@ enum ScaleFactor { // Compiler is free to choose the enum type as long as can keep // its data, so ensure Score to be an integer type. enum Score { - ENSURE_32_BITS_SIZE_P = (1 << 16), - ENSURE_32_BITS_SIZE_N = -(1 << 16) + SCORE_ZERO = 0, + SCORE_ENSURE_32_BITS_SIZE_P = (1 << 16), + SCORE_ENSURE_32_BITS_SIZE_N = -(1 << 16) }; ENABLE_OPERATORS_ON(Score); -- 2.39.2