X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=b10ea9ea49c787bab1b08670917505cb3cb5023e;hp=537674c9119c123370c44456cfb7b9ea94301451;hb=19540c9ee824abc156d5a12ab353c250a083da4b;hpb=34178205fc762638e633a61ecc45360e1662bdee diff --git a/src/position.cpp b/src/position.cpp index 537674c9..b10ea9ea 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -379,8 +379,7 @@ Bitboard Position::hidden_checkers() const { { b = squares_between(ksq, pop_1st_bit(&pinners)) & occupied_squares(); - // Only one bit set and is an our piece? - if (b && !(b & (b - 1)) && (b & pieces(sideToMove))) + if (b && single_bit(b) && (b & pieces(sideToMove))) result |= b; } return result; @@ -1520,7 +1519,7 @@ void Position::init() { Bitboard b = cr; while (b) { - Key k = zobCastle[1 << pop_1st_bit(&b)]; + Key k = zobCastle[1ULL << pop_1st_bit(&b)]; zobCastle[cr] ^= k ? k : rk.rand(); } }