X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=6f652c0a150c209a27b2f84478951cda4f46fccf;hp=3d2248a53c042ac4e8a1de0cb5f72c4faeb29154;hb=78908b7aed41ba0a70c557182ab1b27792db9b0c;hpb=b05fbb3733df535a3fdf99e8d832001e57929699 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 3d2248a5..6f652c0a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -887,7 +887,7 @@ namespace { for (c = WHITE; c <= BLACK; c++) { // Skip if other side has non-pawn pieces - if (pos.non_pawn_material(flip(c))) + if (pos.non_pawn_material(~c)) continue; b = ei.pi->passed_pawns(c); @@ -900,7 +900,7 @@ namespace { // Compute plies to queening and check direct advancement movesToGo = rank_distance(s, queeningSquare) - int(relative_rank(c, s) == RANK_2); - oppMovesToGo = square_distance(pos.king_square(flip(c)), queeningSquare) - int(c != pos.side_to_move()); + oppMovesToGo = square_distance(pos.king_square(~c), queeningSquare) - int(c != pos.side_to_move()); pathDefended = ((ei.attackedBy[c][0] & queeningPath) == queeningPath); if (movesToGo >= oppMovesToGo && !pathDefended) @@ -928,7 +928,7 @@ namespace { return SCORE_ZERO; winnerSide = (pliesToQueen[WHITE] < pliesToQueen[BLACK] ? WHITE : BLACK); - loserSide = flip(winnerSide); + loserSide = ~winnerSide; // Step 3. Can the losing side possibly create a new passed pawn and thus prevent the loss? b = candidates = pos.pieces(PAWN, loserSide);