X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=ada15a1615a9c015ead4668ffb494460b46bc254;hp=a16fc3592453b588ac5c4e1bfb95d9a8512f4e15;hb=21cbfafc0362ff83895226f318580f766f8d35f4;hpb=fc17d0de7748b68bddc5cd7f97a6c15ebc7adaac diff --git a/src/evaluate.cpp b/src/evaluate.cpp index a16fc359..ada15a16 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -288,7 +288,7 @@ namespace Eval { const int MaxSlope = 30; const int Peak = 1280; - for (int t = 0, i = 1; i < 100; i++) + for (int t = 0, i = 1; i < 100; ++i) { t = std::min(Peak, std::min(int(0.4 * i * i), t + MaxSlope)); @@ -622,11 +622,11 @@ Value do_evaluate(const Position& pos, Value& margin) { // type of attacking piece, from knights to queens. Kings are not // considered because are already handled in king evaluation. if (weakEnemies) - for (PieceType pt1 = KNIGHT; pt1 < KING; pt1++) + for (PieceType pt1 = KNIGHT; pt1 < KING; ++pt1) { b = ei.attackedBy[Us][pt1] & weakEnemies; if (b) - for (PieceType pt2 = PAWN; pt2 < KING; pt2++) + for (PieceType pt2 = PAWN; pt2 < KING; ++pt2) if (b & pos.pieces(pt2)) score += Threat[pt1][pt2]; } @@ -810,8 +810,8 @@ Value do_evaluate(const Position& pos, Value& margin) { Square blockSq = s + pawn_push(Us); // Adjust bonus based on kings proximity - ebonus += Value(square_distance(pos.king_square(Them), blockSq) * 5 * rr); - ebonus -= Value(square_distance(pos.king_square(Us), blockSq) * 2 * rr); + ebonus += Value(square_distance(pos.king_square(Them), blockSq) * 5 * rr) + - Value(square_distance(pos.king_square(Us ), blockSq) * 2 * rr); // If blockSq is not the queening square then consider also a second push if (relative_rank(Us, blockSq) != RANK_8) @@ -908,7 +908,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // Step 1. Hunt for unstoppable passed pawns. If we find at least one, // record how many plies are required for promotion. - for (c = WHITE; c <= BLACK; c++) + for (c = WHITE; c <= BLACK; ++c) { // Skip if other side has non-pawn pieces if (pos.non_pawn_material(~c))