Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Misc coding style fixes
a few comment and blank fixes.

No functional change

Closes official-stockfish#1141
  • Loading branch information
Rocky640 authored and zamar committed Jun 17, 2017
1 parent b73016b commit 2c237da
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/bitboard.h
Expand Up @@ -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
/// attacked by a pawn of the given color when it moves along its file, starting
/// 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) {
return PawnAttackSpan[c][s];
Expand Down Expand Up @@ -251,7 +251,7 @@ inline Bitboard attacks_bb(PieceType pt, Square s, Bitboard occupied) {
switch (pt)
{
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);
default : return PseudoAttacks[pt][s];
}
Expand Down
6 changes: 3 additions & 3 deletions src/evaluate.cpp
Expand Up @@ -154,7 +154,7 @@ namespace {
};

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
Expand Down Expand Up @@ -433,7 +433,7 @@ namespace {
safe = ~pos.pieces(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);

// Enemy queen safe checks
Expand Down Expand Up @@ -632,7 +632,7 @@ namespace {

// Adjust bonus based on the king's proximity
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 (relative_rank(Us, blockSq) != RANK_8)
Expand Down
2 changes: 1 addition & 1 deletion src/pawns.cpp
Expand Up @@ -105,7 +105,7 @@ namespace {
Score score = SCORE_ZERO;
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);

e->passedPawns[Us] = e->pawnAttacksSpan[Us] = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/position.cpp
Expand Up @@ -477,7 +477,7 @@ Bitboard Position::slider_blockers(Bitboard sliders, Square s, Bitboard& pinners
pinners = 0;

// 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;

while (snipers)
Expand All @@ -504,7 +504,7 @@ Bitboard Position::attackers_to(Square s, Bitboard occupied) const {
return (attacks_from<PAWN>(s, BLACK) & pieces(WHITE, PAWN))
| (attacks_from<PAWN>(s, WHITE) & pieces(BLACK, PAWN))
| (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_from<KING>(s) & pieces(KING));
}
Expand Down
2 changes: 1 addition & 1 deletion src/search.cpp
Expand Up @@ -85,7 +85,7 @@ namespace {

// History and stats update bonus, based on 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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/syzygy/tbprobe.cpp
Expand Up @@ -673,7 +673,7 @@ int map_score(DTZEntry* entry, File f, int value, WDLScore wdl) {
// idx = Binomial[1][s1] + Binomial[2][s2] + ... + Binomial[k][sk]
//
template<typename Entry, typename T = typename Ret<Entry>::type>
T do_probe_table(const Position& pos, Entry* entry, WDLScore wdl, ProbeState* result) {
T do_probe_table(const Position& pos, Entry* entry, WDLScore wdl, ProbeState* result) {

const bool IsWDL = std::is_same<Entry, WDLEntry>::value;

Expand Down Expand Up @@ -1107,7 +1107,7 @@ void do_init(Entry& e, T& p, uint8_t* data) {
for (File f = FILE_A; f <= MaxFile; ++f)
for (int i = 0; i < Sides; i++) {
(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)
Expand Down

0 comments on commit 2c237da

Please sign in to comment.