X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fpawns.cpp;h=37db673f2ff2ede1b03e62808ce3db223d7f29c5;hp=0bd99f9b0e6d9058f9f9e49b6efd21cced6416a6;hb=f5727deee3823accf791984836f45db78e3a53e5;hpb=f99cb3dc27719021e126690b7fd5aa5f43663ed8 diff --git a/src/pawns.cpp b/src/pawns.cpp index 0bd99f9b..37db673f 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -124,7 +124,7 @@ namespace { // Test for backward pawn. // If the pawn is passed, isolated, or member of a pawn chain it cannot // be backward. If there are friendly pawns behind on adjacent files - // or if can capture an enemy pawn it cannot be backward either. + // or if it can capture an enemy pawn it cannot be backward either. if ( (passed | isolated | chain) || (ourPawns & pawn_attack_span(Them, s)) || (pos.attacks_from(s, Us) & theirPawns)) @@ -145,9 +145,9 @@ namespace { assert(opposed | passed | (pawn_attack_span(Us, s) & theirPawns)); - // A not passed pawn is a candidate to become passed, if it is free to + // A not-passed pawn is a candidate to become passed, if it is free to // advance and if the number of friendly pawns beside or behind this - // pawn on adjacent files is higher or equal than the number of + // pawn on adjacent files is higher than or equal to the number of // enemy pawns in the forward direction on the adjacent files. candidate = !(opposed | passed | backward | isolated) && (b = pawn_attack_span(Them, s + pawn_push(Us)) & ourPawns) != 0 @@ -188,7 +188,7 @@ namespace { namespace Pawns { -/// init() initializes some tables by formula instead of hard-code their values +/// init() initializes some tables by formula instead of hard-coding their values void init() { @@ -252,8 +252,9 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) { } -/// Entry::update_safety() calculates and caches a bonus for king safety. It is -/// called only when king square changes, about 20% of total king_safety() calls. +/// Entry::update_safety() calculates and caches a bonus for king safety. +/// It is called only when king square changes, which is about 20% of total +/// king_safety() calls. template Score Entry::update_safety(const Position& pos, Square ksq) {