]> git.sesse.net Git - stockfish/blobdiff - src/pawns.cpp
NUMA for 9 threads or more
[stockfish] / src / pawns.cpp
index 7cc71ca6ae8606df53fcc89c9e3ce5333fbdf6cf..36b10f32f6e1606a91f69bda1964bda11a51b4cb 100644 (file)
@@ -32,9 +32,9 @@ namespace {
   #define S(mg, eg) make_score(mg, eg)
 
   // Pawn penalties
constexpr Score Isolated = S( 5, 15);
constexpr Score Backward = S( 9, 24);
constexpr Score Doubled  = S(11, 56);
 constexpr Score Backward = S( 9, 24);
 constexpr Score Doubled  = S(11, 56);
 constexpr Score Isolated = S( 5, 15);
 
   // Connected pawn bonus by opposed, phalanx, #support and rank
   Score Connected[2][2][3][RANK_NB];
@@ -245,15 +245,15 @@ Score Entry::do_king_safety(const Position& pos, Square ksq) {
 
   Bitboard pawns = pos.pieces(Us, PAWN);
   if (pawns)
-      while (!(DistanceRingBB[ksq][minKingPawnDistance++] & pawns)) {}
+      while (!(DistanceRingBB[ksq][++minKingPawnDistance] & pawns)) {}
 
   Value bonus = evaluate_shelter<Us>(pos, ksq);
 
   // If we can castle use the bonus after the castling if it is bigger
-  if (pos.can_castle(MakeCastling<Us, KING_SIDE>::right))
+  if (pos.can_castle(Us | KING_SIDE))
       bonus = std::max(bonus, evaluate_shelter<Us>(pos, relative_square(Us, SQ_G1)));
 
-  if (pos.can_castle(MakeCastling<Us, QUEEN_SIDE>::right))
+  if (pos.can_castle(Us | QUEEN_SIDE))
       bonus = std::max(bonus, evaluate_shelter<Us>(pos, relative_square(Us, SQ_C1)));
 
   return make_score(bonus, -16 * minKingPawnDistance);