mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Misc coding style fixes
a few comment and blank fixes. No functional change Closes #1141
This commit is contained in:
parent
b73016bb41
commit
2c237da546
6 changed files with 11 additions and 11 deletions
|
@ -186,7 +186,7 @@ inline Bitboard forward_bb(Color c, Square s) {
|
||||||
/// pawn_attack_span() returns a bitboard representing all the squares that can be
|
/// pawn_attack_span() returns a bitboard representing all the squares that can be
|
||||||
/// attacked by a pawn of the given color when it moves along its file, starting
|
/// attacked by a pawn of the given color when it moves along its file, starting
|
||||||
/// from the given square:
|
/// from the given square:
|
||||||
/// PawnAttackSpan[c][s] = in_front_bb(c, rank_of(s)) & adjacent_files_bb(s);
|
/// PawnAttackSpan[c][s] = in_front_bb(c, rank_of(s)) & adjacent_files_bb(file_of(s));
|
||||||
|
|
||||||
inline Bitboard pawn_attack_span(Color c, Square s) {
|
inline Bitboard pawn_attack_span(Color c, Square s) {
|
||||||
return PawnAttackSpan[c][s];
|
return PawnAttackSpan[c][s];
|
||||||
|
@ -251,7 +251,7 @@ inline Bitboard attacks_bb(PieceType pt, Square s, Bitboard occupied) {
|
||||||
switch (pt)
|
switch (pt)
|
||||||
{
|
{
|
||||||
case BISHOP: return attacks_bb<BISHOP>(s, occupied);
|
case BISHOP: return attacks_bb<BISHOP>(s, occupied);
|
||||||
case ROOK : return attacks_bb<ROOK>(s, occupied);
|
case ROOK : return attacks_bb< ROOK>(s, occupied);
|
||||||
case QUEEN : return attacks_bb<BISHOP>(s, occupied) | attacks_bb<ROOK>(s, occupied);
|
case QUEEN : return attacks_bb<BISHOP>(s, occupied) | attacks_bb<ROOK>(s, occupied);
|
||||||
default : return PseudoAttacks[pt][s];
|
default : return PseudoAttacks[pt][s];
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ namespace {
|
||||||
};
|
};
|
||||||
|
|
||||||
const Score ThreatByRook[PIECE_TYPE_NB] = {
|
const Score ThreatByRook[PIECE_TYPE_NB] = {
|
||||||
S(0, 0), S(0, 25), S(40, 62), S(40, 59), S( 0, 34), S(35, 48)
|
S(0, 0), S(0, 25), S(40, 62), S(40, 59), S(0, 34), S(35, 48)
|
||||||
};
|
};
|
||||||
|
|
||||||
// ThreatByKing[on one/on many] contains bonuses for king attacks on
|
// ThreatByKing[on one/on many] contains bonuses for king attacks on
|
||||||
|
@ -433,7 +433,7 @@ namespace {
|
||||||
safe = ~pos.pieces(Them);
|
safe = ~pos.pieces(Them);
|
||||||
safe &= ~ei.attackedBy[Us][ALL_PIECES] | (undefended & ei.attackedBy2[Them]);
|
safe &= ~ei.attackedBy[Us][ALL_PIECES] | (undefended & ei.attackedBy2[Them]);
|
||||||
|
|
||||||
b1 = pos.attacks_from<ROOK >(ksq);
|
b1 = pos.attacks_from< ROOK>(ksq);
|
||||||
b2 = pos.attacks_from<BISHOP>(ksq);
|
b2 = pos.attacks_from<BISHOP>(ksq);
|
||||||
|
|
||||||
// Enemy queen safe checks
|
// Enemy queen safe checks
|
||||||
|
@ -632,7 +632,7 @@ namespace {
|
||||||
|
|
||||||
// Adjust bonus based on the king's proximity
|
// Adjust bonus based on the king's proximity
|
||||||
ebonus += distance(pos.square<KING>(Them), blockSq) * 5 * rr
|
ebonus += distance(pos.square<KING>(Them), blockSq) * 5 * rr
|
||||||
- distance(pos.square<KING>(Us ), blockSq) * 2 * rr;
|
- distance(pos.square<KING>( Us), blockSq) * 2 * rr;
|
||||||
|
|
||||||
// If blockSq is not the queening square then consider also a second push
|
// If blockSq is not the queening square then consider also a second push
|
||||||
if (relative_rank(Us, blockSq) != RANK_8)
|
if (relative_rank(Us, blockSq) != RANK_8)
|
||||||
|
|
|
@ -105,7 +105,7 @@ namespace {
|
||||||
Score score = SCORE_ZERO;
|
Score score = SCORE_ZERO;
|
||||||
const Square* pl = pos.squares<PAWN>(Us);
|
const Square* pl = pos.squares<PAWN>(Us);
|
||||||
|
|
||||||
Bitboard ourPawns = pos.pieces(Us , PAWN);
|
Bitboard ourPawns = pos.pieces( Us, PAWN);
|
||||||
Bitboard theirPawns = pos.pieces(Them, PAWN);
|
Bitboard theirPawns = pos.pieces(Them, PAWN);
|
||||||
|
|
||||||
e->passedPawns[Us] = e->pawnAttacksSpan[Us] = 0;
|
e->passedPawns[Us] = e->pawnAttacksSpan[Us] = 0;
|
||||||
|
|
|
@ -477,7 +477,7 @@ Bitboard Position::slider_blockers(Bitboard sliders, Square s, Bitboard& pinners
|
||||||
pinners = 0;
|
pinners = 0;
|
||||||
|
|
||||||
// Snipers are sliders that attack 's' when a piece is removed
|
// Snipers are sliders that attack 's' when a piece is removed
|
||||||
Bitboard snipers = ( (PseudoAttacks[ROOK ][s] & pieces(QUEEN, ROOK))
|
Bitboard snipers = ( (PseudoAttacks[ ROOK][s] & pieces(QUEEN, ROOK))
|
||||||
| (PseudoAttacks[BISHOP][s] & pieces(QUEEN, BISHOP))) & sliders;
|
| (PseudoAttacks[BISHOP][s] & pieces(QUEEN, BISHOP))) & sliders;
|
||||||
|
|
||||||
while (snipers)
|
while (snipers)
|
||||||
|
@ -504,7 +504,7 @@ Bitboard Position::attackers_to(Square s, Bitboard occupied) const {
|
||||||
return (attacks_from<PAWN>(s, BLACK) & pieces(WHITE, PAWN))
|
return (attacks_from<PAWN>(s, BLACK) & pieces(WHITE, PAWN))
|
||||||
| (attacks_from<PAWN>(s, WHITE) & pieces(BLACK, PAWN))
|
| (attacks_from<PAWN>(s, WHITE) & pieces(BLACK, PAWN))
|
||||||
| (attacks_from<KNIGHT>(s) & pieces(KNIGHT))
|
| (attacks_from<KNIGHT>(s) & pieces(KNIGHT))
|
||||||
| (attacks_bb<ROOK >(s, occupied) & pieces(ROOK, QUEEN))
|
| (attacks_bb< ROOK>(s, occupied) & pieces( ROOK, QUEEN))
|
||||||
| (attacks_bb<BISHOP>(s, occupied) & pieces(BISHOP, QUEEN))
|
| (attacks_bb<BISHOP>(s, occupied) & pieces(BISHOP, QUEEN))
|
||||||
| (attacks_from<KING>(s) & pieces(KING));
|
| (attacks_from<KING>(s) & pieces(KING));
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ namespace {
|
||||||
|
|
||||||
// History and stats update bonus, based on depth
|
// History and stats update bonus, based on depth
|
||||||
int stat_bonus(Depth depth) {
|
int stat_bonus(Depth depth) {
|
||||||
int d = depth / ONE_PLY ;
|
int d = depth / ONE_PLY;
|
||||||
return d > 17 ? 0 : d * d + 2 * d - 2;
|
return d > 17 ? 0 : d * d + 2 * d - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1107,7 +1107,7 @@ void do_init(Entry& e, T& p, uint8_t* data) {
|
||||||
for (File f = FILE_A; f <= MaxFile; ++f)
|
for (File f = FILE_A; f <= MaxFile; ++f)
|
||||||
for (int i = 0; i < Sides; i++) {
|
for (int i = 0; i < Sides; i++) {
|
||||||
(d = item(p, i, f).precomp)->sparseIndex = (SparseEntry*)data;
|
(d = item(p, i, f).precomp)->sparseIndex = (SparseEntry*)data;
|
||||||
data += d->sparseIndexSize * sizeof(SparseEntry) ;
|
data += d->sparseIndexSize * sizeof(SparseEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (File f = FILE_A; f <= MaxFile; ++f)
|
for (File f = FILE_A; f <= MaxFile; ++f)
|
||||||
|
|
Loading…
Add table
Reference in a new issue