mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Fix a couple of Intel compiler warnings
And avoid calculating emptySquares for pawns captures case. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
46141b078c
commit
e68e135771
1 changed files with 45 additions and 48 deletions
|
@ -576,7 +576,6 @@ namespace {
|
|||
Bitboard b1, b2, dcPawns1, dcPawns2;
|
||||
Square to;
|
||||
Bitboard pawns = (Type == EVASION ? pos.pieces(PAWN, Us) & ~dcp : pos.pieces(PAWN, Us));
|
||||
Bitboard emptySquares = pos.empty_squares();
|
||||
bool possiblePromotion = pawns & TRank7BB;
|
||||
|
||||
if (Type == CAPTURE)
|
||||
|
@ -621,7 +620,7 @@ namespace {
|
|||
|
||||
// Underpromotion pawn pushes. Also queen promotions for evasions and captures.
|
||||
b1 = move_pawns<Us, DELTA_N>(pp) & TRank8BB;
|
||||
b1 &= (Type == EVASION ? blockSquares : emptySquares);
|
||||
b1 &= (Type == EVASION ? blockSquares : pos.empty_squares());
|
||||
|
||||
while (b1)
|
||||
{
|
||||
|
@ -638,26 +637,9 @@ namespace {
|
|||
}
|
||||
}
|
||||
|
||||
if (Type == CAPTURE)
|
||||
if (Type != CAPTURE)
|
||||
{
|
||||
// En passant captures
|
||||
if (pos.ep_square() != SQ_NONE)
|
||||
{
|
||||
assert(Us != WHITE || square_rank(pos.ep_square()) == RANK_6);
|
||||
assert(Us != BLACK || square_rank(pos.ep_square()) == RANK_3);
|
||||
|
||||
Bitboard b1 = pawns & pos.attacks_from<PAWN>(pos.ep_square(), Them);
|
||||
assert(b1 != EmptyBoardBB);
|
||||
|
||||
while (b1)
|
||||
{
|
||||
to = pop_1st_bit(&b1);
|
||||
(*mlist++).move = make_ep_move(to, pos.ep_square());
|
||||
}
|
||||
}
|
||||
return mlist;
|
||||
}
|
||||
|
||||
Bitboard emptySquares = pos.empty_squares();
|
||||
dcPawns1 = dcPawns2 = EmptyBoardBB;
|
||||
if (Type == CHECK && (pawns & dcp))
|
||||
{
|
||||
|
@ -679,6 +661,21 @@ namespace {
|
|||
b2 = (Type == CHECK ? (b1 & pos.attacks_from<PAWN>(ksq, Them)) | dcPawns2 :
|
||||
(Type == EVASION ? b1 & blockSquares : b1));
|
||||
SERIALIZE_MOVES_D(b2, -TDELTA_N -TDELTA_N);
|
||||
}
|
||||
else if (pos.ep_square() != SQ_NONE) // En passant captures
|
||||
{
|
||||
assert(Us != WHITE || square_rank(pos.ep_square()) == RANK_6);
|
||||
assert(Us != BLACK || square_rank(pos.ep_square()) == RANK_3);
|
||||
|
||||
b1 = pawns & pos.attacks_from<PAWN>(pos.ep_square(), Them);
|
||||
assert(b1 != EmptyBoardBB);
|
||||
|
||||
while (b1)
|
||||
{
|
||||
to = pop_1st_bit(&b1);
|
||||
(*mlist++).move = make_ep_move(to, pos.ep_square());
|
||||
}
|
||||
}
|
||||
return mlist;
|
||||
}
|
||||
|
||||
|
@ -706,9 +703,8 @@ namespace {
|
|||
// Direct non-capture checks
|
||||
b = target & ~dc;
|
||||
Bitboard checkSqs = pos.attacks_from<Piece>(ksq) & pos.empty_squares();
|
||||
if (Piece == KING || !checkSqs)
|
||||
return mlist;
|
||||
|
||||
if (Piece != KING && checkSqs)
|
||||
{
|
||||
while (b)
|
||||
{
|
||||
Square from = pop_1st_bit(&b);
|
||||
|
@ -720,6 +716,7 @@ namespace {
|
|||
Bitboard bb = pos.attacks_from<Piece>(from) & checkSqs;
|
||||
SERIALIZE_MOVES(bb);
|
||||
}
|
||||
}
|
||||
return mlist;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue