Use more_than_one() instead of single_bit()

It is more correct given what the function does. In
particular single_bit() returns true also in case of
empty bitboards.

Of course also the usual renaming while there :-)

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-04-14 09:16:34 +01:00
parent 25a9b601b2
commit f59323b56a
8 changed files with 67 additions and 68 deletions

View File

@@ -410,7 +410,7 @@ MoveStack* generate<MV_EVASION>(const Position& pos, MoveStack* mlist) {
// If queen and king are far or not on a diagonal line we can safely
// remove all the squares attacked in the other direction becuase are
// not reachable by the king anyway.
if (squares_between(ksq, checksq) || !(PseudoAttacks[BISHOP][checksq] & ksq))
if (between_bb(ksq, checksq) || !(PseudoAttacks[BISHOP][checksq] & ksq))
sliderAttacks |= PseudoAttacks[QUEEN][checksq];
// Otherwise we need to use real rook attacks to check if king is safe
@@ -434,7 +434,7 @@ MoveStack* generate<MV_EVASION>(const Position& pos, MoveStack* mlist) {
return mlist;
// Blocking evasions or captures of the checking piece
target = squares_between(checksq, ksq) | checkers;
target = between_bb(checksq, ksq) | checkers;
mlist = (us == WHITE ? generate_pawn_moves<WHITE, MV_EVASION>(pos, mlist, target)
: generate_pawn_moves<BLACK, MV_EVASION>(pos, mlist, target));