}
inline int Position::castling_rights(Color c) const {
- return st->castlingRights & ((WHITE_OO | WHITE_OOO) << (2 * c));
+ return st->castlingRights & (c == WHITE ? WHITE_CASTLING : BLACK_CASTLING);
}
inline bool Position::castling_impeded(CastlingRight cr) const {
}
inline bool Position::pawn_passed(Color c, Square s) const {
- return !(pieces(~c, PAWN) & passed_pawn_mask(c, s));
+ return !(pieces(~c, PAWN) & passed_pawn_span(c, s));
}
inline bool Position::advanced_pawn_push(Move m) const {
// index[from] is not updated and becomes stale. This works as long as index[]
// is accessed just by known occupied squares.
- Bitboard fromTo = SquareBB[from] ^ SquareBB[to];
+ Bitboard fromTo = square_bb(from) ^ square_bb(to);
byTypeBB[ALL_PIECES] ^= fromTo;
byTypeBB[type_of(pc)] ^= fromTo;
byColorBB[color_of(pc)] ^= fromTo;