mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Silence idiotic warning on two's complement of an unsigned
MSVC gives: warning C4146: unary minus operator applied to unsigned type, result still unsigned When finds -b where b is an unsigned integer. So rewrite the two's complement in a way to avoid the warning. Theoretically the new version is slower, but in practice changes nothing. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
683595fee1
commit
d7ef09727a
1 changed files with 1 additions and 1 deletions
|
@ -1618,7 +1618,7 @@ int Position::see(Square from, Square to) const {
|
|||
// Remove the attacker we just found from the 'attackers' bitboard,
|
||||
// and scan for new X-ray attacks behind the attacker.
|
||||
b = attackers & pieces_of_color_and_type(c, pt);
|
||||
occ ^= (b & -b);
|
||||
occ ^= (b & (~b + 1));
|
||||
attackers |= (rook_attacks_bb(to, occ) & rooks_and_queens())
|
||||
| (bishop_attacks_bb(to, occ) & bishops_and_queens());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue