X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitboard.h;h=a53f348b2fb268eb412bebbdfc967c6f70b5b072;hp=2c51b073de3042ec1e7f1cf455b9d247ac927cd9;hb=abb40777bf7dbfd2f5250840f84b4c6965719f46;hpb=9a1d5f0f1d8a12a85b198688d4f1d636a146eb7a diff --git a/src/bitboard.h b/src/bitboard.h index 2c51b073..a53f348b 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -63,6 +63,7 @@ extern Bitboard PassedPawnMask[COLOR_NB][SQUARE_NB]; extern Bitboard AttackSpanMask[COLOR_NB][SQUARE_NB]; extern Bitboard PseudoAttacks[PIECE_TYPE_NB][SQUARE_NB]; +const Bitboard BlackSquares = 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. @@ -199,8 +200,7 @@ inline bool squares_aligned(Square s1, Square s2, Square s3) { /// the same color of the given square. inline Bitboard same_color_squares(Square s) { - return Bitboard(0xAA55AA55AA55AA55ULL) & s ? 0xAA55AA55AA55AA55ULL - : ~0xAA55AA55AA55AA55ULL; + return BlackSquares & s ? BlackSquares : ~BlackSquares; }