X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=46d9151ff1401add0287b416770108a729abf606;hp=02ca6d350402d280770970e40fded39022ad5f1e;hb=b84af67f4c88f3e3f7b61bf2035475f79fb3e62e;hpb=5f5d056c8fb9996748b742c9d5102c9202b0bd2c diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 02ca6d35..46d9151f 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -435,8 +435,8 @@ Value do_evaluate(const Position& pos, Value& margin) { && sf == SCALE_FACTOR_NORMAL) { // Only the two bishops ? - if ( pos.non_pawn_material(WHITE) == BishopValueMidgame - && pos.non_pawn_material(BLACK) == BishopValueMidgame) + if ( pos.non_pawn_material(WHITE) == BishopValueMg + && pos.non_pawn_material(BLACK) == BishopValueMg) { // Check for KBP vs KB with only a single pawn that is almost // certainly a draw or at least two pawns. @@ -492,7 +492,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // Init king safety tables only if we are going to use them if ( pos.piece_count(Us, QUEEN) - && pos.non_pawn_material(Us) >= QueenValueMidgame + RookValueMidgame) + && pos.non_pawn_material(Us) >= QueenValueMg + RookValueMg) { ei.kingRing[Them] = (b | (Us == WHITE ? b >> 8 : b << 8)); b &= ei.attackedBy[Us][PAWN]; @@ -582,7 +582,7 @@ Value do_evaluate(const Position& pos, Value& margin) { assert(b); if (!more_than_one(b) && (b & pos.pieces(Them))) - score += ThreatBonus[Piece][type_of(pos.piece_on(first_1(b)))]; + score += ThreatBonus[Piece][type_of(pos.piece_on(lsb(b)))]; } // Decrease score if we are attacked by an enemy pawn. Remaining part @@ -870,7 +870,7 @@ Value do_evaluate(const Position& pos, Value& margin) { return SCORE_ZERO; do { - Square s = pop_1st_bit(&b); + Square s = pop_lsb(&b); assert(pos.pawn_is_passed(Us, s)); @@ -938,7 +938,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // value if the other side has a rook or queen. if (file_of(s) == FILE_A || file_of(s) == FILE_H) { - if (pos.non_pawn_material(Them) <= KnightValueMidgame) + if (pos.non_pawn_material(Them) <= KnightValueMg) ebonus += ebonus / 4; else if (pos.pieces(Them, ROOK, QUEEN)) ebonus -= ebonus / 4; @@ -976,7 +976,7 @@ Value do_evaluate(const Position& pos, Value& margin) { while (b) { - s = pop_1st_bit(&b); + s = pop_lsb(&b); queeningSquare = relative_square(c, file_of(s) | RANK_8); queeningPath = forward_bb(c, s); @@ -1017,7 +1017,7 @@ Value do_evaluate(const Position& pos, Value& margin) { while (b) { - s = pop_1st_bit(&b); + s = pop_lsb(&b); // Compute plies from queening queeningSquare = relative_square(loserSide, file_of(s) | RANK_8); @@ -1039,7 +1039,7 @@ Value do_evaluate(const Position& pos, Value& margin) { while (b) { - s = pop_1st_bit(&b); + s = pop_lsb(&b); sacptg = blockersCount = 0; minKingDist = kingptg = 256; @@ -1058,7 +1058,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // How many plies does it take to remove all the blocking pawns? while (blockers) { - blockSq = pop_1st_bit(&blockers); + blockSq = pop_lsb(&blockers); movesToGo = 256; // Check pawns that can give support to overcome obstacle, for instance @@ -1069,7 +1069,7 @@ Value do_evaluate(const Position& pos, Value& margin) { while (b2) // This while-loop could be replaced with LSB/MSB (depending on color) { - d = square_distance(blockSq, pop_1st_bit(&b2)) - 2; + d = square_distance(blockSq, pop_lsb(&b2)) - 2; movesToGo = std::min(movesToGo, d); } } @@ -1079,7 +1079,7 @@ Value do_evaluate(const Position& pos, Value& margin) { while (b2) // This while-loop could be replaced with LSB/MSB (depending on color) { - d = square_distance(blockSq, pop_1st_bit(&b2)) - 2; + d = square_distance(blockSq, pop_lsb(&b2)) - 2; movesToGo = std::min(movesToGo, d); } @@ -1172,7 +1172,7 @@ Value do_evaluate(const Position& pos, Value& margin) { // A couple of little helpers used by tracing code, to_cp() converts a value to // a double in centipawns scale, trace_add() stores white and black scores. - double to_cp(Value v) { return double(v) / double(PawnValueMidgame); } + double to_cp(Value v) { return double(v) / double(PawnValueMg); } void trace_add(int idx, Score wScore, Score bScore) {