]> git.sesse.net Git - stockfish/commitdiff
Small renaming
authorMarco Costalba <mcostalba@gmail.com>
Mon, 29 Jul 2013 17:32:59 +0000 (19:32 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 29 Jul 2013 17:32:59 +0000 (19:32 +0200)
No functional change.

src/bitboard.h
src/evaluate.cpp
src/pawns.cpp
src/pawns.h

index 859fc958c88f60b8c88d4375fe1f53503ac3be7b..bc3ed87b623dab6ae9debb5d89a48df9e3ee68ee 100644 (file)
@@ -82,7 +82,7 @@ extern Bitboard PseudoAttacks[PIECE_TYPE_NB][SQUARE_NB];
 
 extern int SquareDistance[SQUARE_NB][SQUARE_NB];
 
 
 extern int SquareDistance[SQUARE_NB][SQUARE_NB];
 
-const Bitboard BlackSquares = 0xAA55AA55AA55AA55ULL;
+const Bitboard DarkSquares = 0xAA55AA55AA55AA55ULL;
 
 /// Overloads of bitwise operators between a Bitboard and a Square for testing
 /// whether a given bit is set in a bitboard, and for setting and clearing bits.
 
 /// Overloads of bitwise operators between a Bitboard and a Square for testing
 /// whether a given bit is set in a bitboard, and for setting and clearing bits.
@@ -214,6 +214,14 @@ inline Bitboard passed_pawn_mask(Color c, Square s) {
 }
 
 
 }
 
 
+/// squares_of_color() returns a bitboard representing all squares with the same
+/// color of the given square.
+
+inline Bitboard squares_of_color(Square s) {
+  return DarkSquares & s ? DarkSquares : ~DarkSquares;
+}
+
+
 /// squares_aligned() returns true if the squares s1, s2 and s3 are aligned
 /// either on a straight or on a diagonal line.
 
 /// squares_aligned() returns true if the squares s1, s2 and s3 are aligned
 /// either on a straight or on a diagonal line.
 
@@ -223,14 +231,6 @@ inline bool squares_aligned(Square s1, Square s2, Square s3) {
 }
 
 
 }
 
 
-/// same_color_squares() returns a bitboard representing all squares with
-/// the same color of the given square.
-
-inline Bitboard same_color_squares(Square s) {
-  return BlackSquares & s ? BlackSquares : ~BlackSquares;
-}
-
-
 /// Functions for computing sliding attack bitboards. Function attacks_bb() takes
 /// a square and a bitboard of occupied squares as input, and returns a bitboard
 /// representing all squares attacked by Pt (bishop or rook) on the given square.
 /// Functions for computing sliding attack bitboards. Function attacks_bb() takes
 /// a square and a bitboard of occupied squares as input, and returns a bitboard
 /// representing all squares attacked by Pt (bishop or rook) on the given square.
index 3f01d56457c2fd8c5e026e8d75bc5e5421e9a951..25ee79ead4df1ca94f1ddbe95d62a36b49496c84 100644 (file)
@@ -468,7 +468,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
     if (bonus && (ei.attackedBy[Us][PAWN] & s))
     {
         if (   !pos.pieces(Them, KNIGHT)
     if (bonus && (ei.attackedBy[Us][PAWN] & s))
     {
         if (   !pos.pieces(Them, KNIGHT)
-            && !(same_color_squares(s) & pos.pieces(Them, BISHOP)))
+            && !(squares_of_color(s) & pos.pieces(Them, BISHOP)))
             bonus += bonus + bonus / 2;
         else
             bonus += bonus / 2;
             bonus += bonus + bonus / 2;
         else
             bonus += bonus / 2;
index 74aa0e0dd95892df9b1cdd44e00dc0c9a6d02638..718dd575957076d73e62b0bf47350619e826891c 100644 (file)
@@ -104,7 +104,7 @@ namespace {
     e->kingSquares[Us] = SQ_NONE;
     e->semiopenFiles[Us] = 0xFF;
     e->pawnAttacks[Us] = shift_bb<Right>(ourPawns) | shift_bb<Left>(ourPawns);
     e->kingSquares[Us] = SQ_NONE;
     e->semiopenFiles[Us] = 0xFF;
     e->pawnAttacks[Us] = shift_bb<Right>(ourPawns) | shift_bb<Left>(ourPawns);
-    e->pawnsOnSquares[Us][BLACK] = popcount<Max15>(ourPawns & BlackSquares);
+    e->pawnsOnSquares[Us][BLACK] = popcount<Max15>(ourPawns & DarkSquares);
     e->pawnsOnSquares[Us][WHITE] = pos.count<PAWN>(Us) - e->pawnsOnSquares[Us][BLACK];
 
     // Loop through all pawns of the current color and score each pawn
     e->pawnsOnSquares[Us][WHITE] = pos.count<PAWN>(Us) - e->pawnsOnSquares[Us][BLACK];
 
     // Loop through all pawns of the current color and score each pawn
index 7292606b8451b95a06716bc65a6157a7668d1971..9f2af30e4f5028472e493e1ea42ee5fbd630691b 100644 (file)
@@ -37,7 +37,7 @@ struct Entry {
   Score pawns_value() const { return value; }
   Bitboard pawn_attacks(Color c) const { return pawnAttacks[c]; }
   Bitboard passed_pawns(Color c) const { return passedPawns[c]; }
   Score pawns_value() const { return value; }
   Bitboard pawn_attacks(Color c) const { return pawnAttacks[c]; }
   Bitboard passed_pawns(Color c) const { return passedPawns[c]; }
-  int pawns_on_same_color_squares(Color c, Square s) const { return pawnsOnSquares[c][!!(BlackSquares & s)]; }
+  int pawns_on_same_color_squares(Color c, Square s) const { return pawnsOnSquares[c][!!(DarkSquares & s)]; }
   int semiopen(Color c, File f) const { return semiopenFiles[c] & (1 << int(f)); }
   int semiopen_on_side(Color c, File f, bool left) const {
 
   int semiopen(Color c, File f) const { return semiopenFiles[c] & (1 << int(f)); }
   int semiopen_on_side(Color c, File f, bool left) const {