]> git.sesse.net Git - stockfish/commitdiff
Retire some unused functions in bitboard.h
authorMarco Costalba <mcostalba@gmail.com>
Wed, 19 Jan 2011 09:53:47 +0000 (10:53 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 19 Jan 2011 12:33:26 +0000 (13:33 +0100)
No functional change.

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

index 42c096d1992ad50d82c78dfaa11b993dd624f57c..6e37395241ad538a3a256f123f4a508af2755e8a 100644 (file)
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
-
 #if !defined(BITBOARD_H_INCLUDED)
 #define BITBOARD_H_INCLUDED
 
 #if !defined(BITBOARD_H_INCLUDED)
 #define BITBOARD_H_INCLUDED
 
-////
-//// Includes
-////
-
 #include "piece.h"
 #include "square.h"
 #include "types.h"
 
 #include "piece.h"
 #include "square.h"
 #include "types.h"
 
-
-////
-//// Constants and variables
-////
-
 const Bitboard EmptyBoardBB = 0;
 
 const Bitboard FileABB = 0x0101010101010101ULL;
 const Bitboard EmptyBoardBB = 0;
 
 const Bitboard FileABB = 0x0101010101010101ULL;
@@ -92,10 +82,6 @@ extern Bitboard QueenPseudoAttacks[64];
 extern uint8_t BitCount8Bit[256];
 
 
 extern uint8_t BitCount8Bit[256];
 
 
-////
-//// Inline functions
-////
-
 /// Functions for testing whether a given bit is set in a bitboard, and for
 /// setting and clearing bits.
 
 /// Functions for testing whether a given bit is set in a bitboard, and for
 /// setting and clearing bits.
 
@@ -123,7 +109,8 @@ inline void do_move_bb(Bitboard *b, Bitboard move_bb) {
   *b ^= move_bb;
 }
 
   *b ^= move_bb;
 }
 
-/// rank_bb() and file_bb() take a file or a square as input, and return
+
+/// rank_bb() and file_bb() take a file or a square as input and return
 /// a bitboard representing all squares on the given file or rank.
 
 inline Bitboard rank_bb(Rank r) {
 /// a bitboard representing all squares on the given file or rank.
 
 inline Bitboard rank_bb(Rank r) {
@@ -131,7 +118,7 @@ inline Bitboard rank_bb(Rank r) {
 }
 
 inline Bitboard rank_bb(Square s) {
 }
 
 inline Bitboard rank_bb(Square s) {
-  return rank_bb(square_rank(s));
+  return RankBB[square_rank(s)];
 }
 
 inline Bitboard file_bb(File f) {
 }
 
 inline Bitboard file_bb(File f) {
@@ -139,11 +126,11 @@ inline Bitboard file_bb(File f) {
 }
 
 inline Bitboard file_bb(Square s) {
 }
 
 inline Bitboard file_bb(Square s) {
-  return file_bb(square_file(s));
+  return FileBB[square_file(s)];
 }
 
 
 }
 
 
-/// neighboring_files_bb takes a file or a square as input, and returns a
+/// neighboring_files_bb takes a file or a square as input and returns a
 /// bitboard representing all squares on the neighboring files.
 
 inline Bitboard neighboring_files_bb(File f) {
 /// bitboard representing all squares on the neighboring files.
 
 inline Bitboard neighboring_files_bb(File f) {
@@ -155,9 +142,8 @@ inline Bitboard neighboring_files_bb(Square s) {
 }
 
 
 }
 
 
-/// this_and_neighboring_files_bb takes a file or a square as input, and
-/// returns a bitboard representing all squares on the given and neighboring
-/// files.
+/// this_and_neighboring_files_bb takes a file or a square as input and returns
+/// a bitboard representing all squares on the given and neighboring files.
 
 inline Bitboard this_and_neighboring_files_bb(File f) {
   return ThisAndNeighboringFilesBB[f];
 
 inline Bitboard this_and_neighboring_files_bb(File f) {
   return ThisAndNeighboringFilesBB[f];
@@ -194,19 +180,6 @@ inline Bitboard in_front_bb(Color c, Square s) {
 }
 
 
 }
 
 
-/// behind_bb() takes a color and a rank or square as input, and returns a
-/// bitboard representing all the squares on all ranks behind of the rank
-/// (or square), from the given color's point of view.
-
-inline Bitboard behind_bb(Color c, Rank r) {
-  return InFrontBB[opposite_color(c)][r];
-}
-
-inline Bitboard behind_bb(Color c, Square s) {
-  return InFrontBB[opposite_color(c)][square_rank(s)];
-}
-
-
 /// Functions for computing sliding attack bitboards. rook_attacks_bb(),
 /// bishop_attacks_bb() and queen_attacks_bb() all take a square and a
 /// bitboard of occupied squares as input, and return a bitboard representing
 /// Functions for computing sliding attack bitboards. rook_attacks_bb(),
 /// bishop_attacks_bb() and queen_attacks_bb() all take a square and a
 /// bitboard of occupied squares as input, and return a bitboard representing
@@ -269,14 +242,6 @@ inline Bitboard squares_in_front_of(Color c, Square s) {
 }
 
 
 }
 
 
-/// squares_behind is similar to squares_in_front, but returns the squares
-/// behind the square instead of in front of the square.
-
-inline Bitboard squares_behind(Color c, Square s) {
-  return SquaresInFrontMask[opposite_color(c)][s];
-}
-
-
 /// passed_pawn_mask takes a color and a square as input, and returns a
 /// bitboard mask which can be used to test if a pawn of the given color on
 /// the given square is a passed pawn. Definition of the table is:
 /// passed_pawn_mask takes a color and a square as input, and returns a
 /// bitboard mask which can be used to test if a pawn of the given color on
 /// the given square is a passed pawn. Definition of the table is:
@@ -332,12 +297,7 @@ extern Square pop_1st_bit(Bitboard* b);
 #endif
 
 
 #endif
 
 
-////
-//// Prototypes
-////
-
 extern void print_bitboard(Bitboard b);
 extern void init_bitboards();
 
 extern void print_bitboard(Bitboard b);
 extern void init_bitboards();
 
-
 #endif // !defined(BITBOARD_H_INCLUDED)
 #endif // !defined(BITBOARD_H_INCLUDED)
index fe964935c828282490b53a3927cc18c471f263d1..680b8e0fb58d163598b45a184eb3814f9edc4d0a 100644 (file)
@@ -569,7 +569,7 @@ namespace {
             // problem, especially when that pawn is also blocked.
             if (s == relative_square(Us, SQ_A1) || s == relative_square(Us, SQ_H1))
             {
             // problem, especially when that pawn is also blocked.
             if (s == relative_square(Us, SQ_A1) || s == relative_square(Us, SQ_H1))
             {
-                SquareDelta d = pawn_push(Us) 
+                SquareDelta d = pawn_push(Us)
                    + (square_file(s) == FILE_A ? DELTA_E : DELTA_W);
                 if (pos.piece_on(s + d) == piece_of_color_and_type(Us, PAWN))
                 {
                    + (square_file(s) == FILE_A ? DELTA_E : DELTA_W);
                 if (pos.piece_on(s + d) == piece_of_color_and_type(Us, PAWN))
                 {
@@ -840,8 +840,8 @@ namespace {
                 // If there is an enemy rook or queen attacking the pawn from behind,
                 // add all X-ray attacks by the rook or queen. Otherwise consider only
                 // the squares in the pawn's path attacked or occupied by the enemy.
                 // If there is an enemy rook or queen attacking the pawn from behind,
                 // add all X-ray attacks by the rook or queen. Otherwise consider only
                 // the squares in the pawn's path attacked or occupied by the enemy.
-                if (   (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them))
-                    && (squares_behind(Us, s) & pos.pieces(ROOK, QUEEN, Them) & pos.attacks_from<ROOK>(s)))
+                if (   (squares_in_front_of(Them, s) & pos.pieces(ROOK, QUEEN, Them))
+                    && (squares_in_front_of(Them, s) & pos.pieces(ROOK, QUEEN, Them) & pos.attacks_from<ROOK>(s)))
                     unsafeSquares = squaresToQueen;
                 else
                     unsafeSquares = squaresToQueen & (ei.attackedBy[Them][0] | pos.pieces_of_color(Them));
                     unsafeSquares = squaresToQueen;
                 else
                     unsafeSquares = squaresToQueen & (ei.attackedBy[Them][0] | pos.pieces_of_color(Them));