]> git.sesse.net Git - stockfish/commitdiff
Introduce and use SCORE_ZERO
authorMarco Costalba <mcostalba@gmail.com>
Thu, 19 Aug 2010 15:36:18 +0000 (16:36 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 19 Aug 2010 17:22:46 +0000 (18:22 +0100)
No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/evaluate.cpp
src/pawns.cpp
src/position.cpp
src/value.h

index 47d5eb3e9bc93760432f369c04195afff4f20ac3..e7af307303ae3fd447e5b46c553d235ef00552ce 100644 (file)
@@ -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)
index 5a789ef24bf376063cbbccdddee49d781a2ad035..cec9aba142af22fcf96edf82879ef8da7f190fa8 100644 (file)
@@ -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
index 058fab66b13940b2db943aef8548c46b63d1e936..11684d763124ed1872f7b8746123528321e846c8 100644 (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.
 Score Position::compute_value() const {
 
-  Score result = make_score(0, 0);
+  Score result = SCORE_ZERO;
   Bitboard b;
   Square s;
 
index d86a8bb90017126a02acbae20211107fc3a501ab..345526b625eaf3e3118d37f0e06e54476f6fd17c 100644 (file)
@@ -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);