1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Introduce and use SCORE_ZERO

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-08-19 16:36:18 +01:00
parent 4419924fcf
commit 5bed82cd4e
4 changed files with 6 additions and 5 deletions

View file

@ -634,7 +634,7 @@ namespace {
const Color Them = (Us == WHITE ? BLACK : WHITE); const Color Them = (Us == WHITE ? BLACK : WHITE);
Bitboard b; Bitboard b;
Score bonus = make_score(0, 0); Score bonus = SCORE_ZERO;
// Enemy pieces not defended by a pawn and under our attack // Enemy pieces not defended by a pawn and under our attack
Bitboard weakEnemies = pos.pieces_of_color(Them) Bitboard weakEnemies = pos.pieces_of_color(Them)

View file

@ -185,7 +185,7 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns,
Rank r; Rank r;
int bonus; int bonus;
bool passed, isolated, doubled, opposed, chain, backward, candidate; 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); const Square* ptr = pos.piece_list_begin(Us, PAWN);
// Initialize pawn storm scores by giving bonuses for open files // Initialize pawn storm scores by giving bonuses for open files

View file

@ -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. /// updated by do_move and undo_move when the program is running in debug mode.
Score Position::compute_value() const { Score Position::compute_value() const {
Score result = make_score(0, 0); Score result = SCORE_ZERO;
Bitboard b; Bitboard b;
Square s; Square s;

View file

@ -68,8 +68,9 @@ enum ScaleFactor {
// Compiler is free to choose the enum type as long as can keep // Compiler is free to choose the enum type as long as can keep
// its data, so ensure Score to be an integer type. // its data, so ensure Score to be an integer type.
enum Score { enum Score {
ENSURE_32_BITS_SIZE_P = (1 << 16), SCORE_ZERO = 0,
ENSURE_32_BITS_SIZE_N = -(1 << 16) SCORE_ENSURE_32_BITS_SIZE_P = (1 << 16),
SCORE_ENSURE_32_BITS_SIZE_N = -(1 << 16)
}; };
ENABLE_OPERATORS_ON(Score); ENABLE_OPERATORS_ON(Score);