X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=396fd97637fe8f6f12f3e47462908475684e57bc;hp=0b5c59d3fae0df6048f7852f872557af5274f16b;hb=3017e8c60401ecd92468a9ede3368002c4ddd440;hpb=0da7295795448fc826cb5b2613ac64a6e0c4adcd diff --git a/src/pawns.cpp b/src/pawns.cpp index 0b5c59d3..396fd976 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -149,7 +149,7 @@ namespace { isolated = !neighbours; // Test for backward pawn. - // If the pawn is passed, isolated, lever or connected it cannot be + // If the pawn is passed, isolated, connected or a lever it cannot be // backward. If there are friendly pawns behind on adjacent files // it cannot be backward either. if ( (passed | isolated | lever | connected) @@ -294,14 +294,14 @@ Score Entry::do_king_safety(const Position& pos, Square ksq) { kingSquares[Us] = ksq; castlingRights[Us] = pos.can_castle(Us); - minKingPawnDistance[Us] = 0; + int minKingPawnDistance = 0; Bitboard pawns = pos.pieces(Us, PAWN); if (pawns) - while (!(DistanceRingBB[ksq][minKingPawnDistance[Us]++] & pawns)) {} + while (!(DistanceRingBB[ksq][minKingPawnDistance++] & pawns)) {} if (relative_rank(Us, ksq) > RANK_4) - return make_score(0, -16 * minKingPawnDistance[Us]); + return make_score(0, -16 * minKingPawnDistance); Value bonus = shelter_storm(pos, ksq); @@ -312,7 +312,7 @@ Score Entry::do_king_safety(const Position& pos, Square ksq) { if (pos.can_castle(MakeCastling::right)) bonus = std::max(bonus, shelter_storm(pos, relative_square(Us, SQ_C1))); - return make_score(bonus, -16 * minKingPawnDistance[Us]); + return make_score(bonus, -16 * minKingPawnDistance); } // Explicit template instantiation