Change pawn_attacks() API

Instead of pawn_attacks(Color c, Square s) define as
pawn_attacks(Square s, Color c) to be more aligned to
the others attack info functions.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-09-20 08:59:18 +01:00
parent 62a8f393f1
commit 049139d025
6 changed files with 29 additions and 32 deletions

View File

@@ -303,7 +303,7 @@ PawnInfo* PawnInfoTable::get_pawn_info(const Position& pos) {
if ( passed
|| isolated
|| chain
|| (pos.pawn_attacks(us, s) & theirPawns)
|| (pos.pawn_attacks(s, us) & theirPawns)
|| (ourPawns & behind_bb(us, r) & neighboring_files_bb(f)))
backward = false;
else
@@ -312,7 +312,7 @@ PawnInfo* PawnInfoTable::get_pawn_info(const Position& pos) {
// pawn on neighboring files. We now check whether the pawn is
// backward by looking in the forward direction on the neighboring
// files, and seeing whether we meet a friendly or an enemy pawn first.
Bitboard b = pos.pawn_attacks(us, s);
Bitboard b = pos.pawn_attacks(s, us);
if (us == WHITE)
{
for ( ; !(b & (ourPawns | theirPawns)); b <<= 8);