Cleanup piece_attacks_square() functions

Most of them are not required to be public and are
used in one place only so remove them and use its
definitions.

Also rename piece_attacks_square() in piece_attacks()
to be aligned to the current naming policy.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-09-20 09:43:28 +01:00
parent 0e0adfe2e1
commit f74f42b298
4 changed files with 23 additions and 34 deletions

View File

@@ -557,7 +557,7 @@ bool move_is_legal(const Position& pos, const Move m, Bitboard pinned) {
}
// Luckly we can handle all the other pieces in one go
return ( pos.piece_attacks_square(pos.piece_on(from), from, to)
return ( bit_is_set(pos.piece_attacks(pc, from), to)
&& pos.pl_move_is_legal(m, pinned)
&& !move_is_promotion(m));
}