mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Use arrow operator instead of * and .
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
1cc18d8a7a
commit
73131e7c78
1 changed files with 9 additions and 9 deletions
|
@ -24,11 +24,11 @@
|
||||||
|
|
||||||
/// Simple macro to wrap a very common while loop, no facny, no flexibility,
|
/// Simple macro to wrap a very common while loop, no facny, no flexibility,
|
||||||
/// hardcoded names 'mlist' and 'from'.
|
/// hardcoded names 'mlist' and 'from'.
|
||||||
#define SERIALIZE(b) while (b) (*mlist++).move = make_move(from, pop_lsb(&b))
|
#define SERIALIZE(b) while (b) (mlist++)->move = make_move(from, pop_lsb(&b))
|
||||||
|
|
||||||
/// Version used for pawns, where the 'from' square is given as a delta from the 'to' square
|
/// Version used for pawns, where the 'from' square is given as a delta from the 'to' square
|
||||||
#define SERIALIZE_PAWNS(b, d) while (b) { Square to = pop_lsb(&b); \
|
#define SERIALIZE_PAWNS(b, d) while (b) { Square to = pop_lsb(&b); \
|
||||||
(*mlist++).move = make_move(to - (d), to); }
|
(mlist++)->move = make_move(to - (d), to); }
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
template<CastlingSide Side, bool Checks, bool Chess960>
|
template<CastlingSide Side, bool Checks, bool Chess960>
|
||||||
|
@ -59,7 +59,7 @@ namespace {
|
||||||
if (Chess960 && (pos.attackers_to(kto, pos.pieces() ^ rfrom) & enemies))
|
if (Chess960 && (pos.attackers_to(kto, pos.pieces() ^ rfrom) & enemies))
|
||||||
return mlist;
|
return mlist;
|
||||||
|
|
||||||
(*mlist++).move = make<CASTLE>(kfrom, rfrom);
|
(mlist++)->move = make<CASTLE>(kfrom, rfrom);
|
||||||
|
|
||||||
if (Checks && !pos.move_gives_check((mlist - 1)->move, CheckInfo(pos)))
|
if (Checks && !pos.move_gives_check((mlist - 1)->move, CheckInfo(pos)))
|
||||||
mlist--;
|
mlist--;
|
||||||
|
@ -79,19 +79,19 @@ namespace {
|
||||||
Square to = pop_lsb(&b);
|
Square to = pop_lsb(&b);
|
||||||
|
|
||||||
if (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
|
if (Type == CAPTURES || Type == EVASIONS || Type == NON_EVASIONS)
|
||||||
(*mlist++).move = make<PROMOTION>(to - Delta, to, QUEEN);
|
(mlist++)->move = make<PROMOTION>(to - Delta, to, QUEEN);
|
||||||
|
|
||||||
if (Type == QUIETS || Type == EVASIONS || Type == NON_EVASIONS)
|
if (Type == QUIETS || Type == EVASIONS || Type == NON_EVASIONS)
|
||||||
{
|
{
|
||||||
(*mlist++).move = make<PROMOTION>(to - Delta, to, ROOK);
|
(mlist++)->move = make<PROMOTION>(to - Delta, to, ROOK);
|
||||||
(*mlist++).move = make<PROMOTION>(to - Delta, to, BISHOP);
|
(mlist++)->move = make<PROMOTION>(to - Delta, to, BISHOP);
|
||||||
(*mlist++).move = make<PROMOTION>(to - Delta, to, KNIGHT);
|
(mlist++)->move = make<PROMOTION>(to - Delta, to, KNIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Knight-promotion is the only one that can give a direct check not
|
// Knight-promotion is the only one that can give a direct check not
|
||||||
// already included in the queen-promotion.
|
// already included in the queen-promotion.
|
||||||
if (Type == QUIET_CHECKS && (StepAttacksBB[W_KNIGHT][to] & ci->ksq))
|
if (Type == QUIET_CHECKS && (StepAttacksBB[W_KNIGHT][to] & ci->ksq))
|
||||||
(*mlist++).move = make<PROMOTION>(to - Delta, to, KNIGHT);
|
(mlist++)->move = make<PROMOTION>(to - Delta, to, KNIGHT);
|
||||||
else
|
else
|
||||||
(void)ci; // Silence a warning under MSVC
|
(void)ci; // Silence a warning under MSVC
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,7 @@ namespace {
|
||||||
assert(b1);
|
assert(b1);
|
||||||
|
|
||||||
while (b1)
|
while (b1)
|
||||||
(*mlist++).move = make<ENPASSANT>(pop_lsb(&b1), pos.ep_square());
|
(mlist++)->move = make<ENPASSANT>(pop_lsb(&b1), pos.ep_square());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue