]> git.sesse.net Git - stockfish/commitdiff
Revert "Generalize shift_bb() to handle double pushes"
authorMarco Costalba <mcostalba@gmail.com>
Mon, 21 Apr 2014 18:54:55 +0000 (20:54 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 21 Apr 2014 18:56:12 +0000 (20:56 +0200)
Seems to intorduce some compiler warning as
reported by Gary. Warning seems bogus, but
revert anyhow.

No functional change.

src/bitboard.h
src/evaluate.cpp

index 888e96905469b1c907340a79beaca613d2b90c41..9814268327afdd9c269d728077d1f82770035c87 100644 (file)
@@ -130,9 +130,10 @@ inline int rank_distance(Square s1, Square s2) {
 template<Square Delta>
 inline Bitboard shift_bb(Bitboard b) {
 
-  return  Delta == DELTA_NE ? (b & ~FileHBB) << 9 : Delta == DELTA_SE ? (b & ~FileHBB) >> 7
+  return  Delta == DELTA_N  ?  b             << 8 : Delta == DELTA_S  ?  b             >> 8
+        : Delta == DELTA_NE ? (b & ~FileHBB) << 9 : Delta == DELTA_SE ? (b & ~FileHBB) >> 7
         : Delta == DELTA_NW ? (b & ~FileABB) << 7 : Delta == DELTA_SW ? (b & ~FileABB) >> 9
-        : Delta > 0 ? b << Delta : b >> -Delta;
+        : 0;
 }
 
 
index b1422ac67eccb50fefdebde17d7396d01b0542db..8eb0364844a363e5fb33e5a7e55a4d8e26dd739c 100644 (file)
@@ -702,9 +702,7 @@ namespace {
   template<Color Us>
   int evaluate_space(const Position& pos, const EvalInfo& ei) {
 
-    const Color  Them     = (Us == WHITE ? BLACK    : WHITE);
-    const Square Down     = (Us == WHITE ? DELTA_S  : DELTA_N);
-    const Square DownDown = (Us == WHITE ? DELTA_SS : DELTA_NN);
+    const Color Them = (Us == WHITE ? BLACK : WHITE);
 
     // Find the safe squares for our pieces inside the area defined by
     // SpaceMask[]. A square is unsafe if it is attacked by an enemy
@@ -716,8 +714,8 @@ namespace {
 
     // Find all squares which are at most three squares behind some friendly pawn
     Bitboard behind = pos.pieces(Us, PAWN);
-    behind |= shift_bb<    Down>(behind);
-    behind |= shift_bb<DownDown>(behind);
+    behind |= (Us == WHITE ? behind >>  8 : behind <<  8);
+    behind |= (Us == WHITE ? behind >> 16 : behind << 16);
 
     // Since SpaceMask[Us] is fully on our half of the board
     assert(unsigned(safe >> (Us == WHITE ? 32 : 0)) == 0);