X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=dcf3e6134a4a5d4c83c48a1542f85f8ec3ebb23f;hp=5ef8bc7fbdd9571962138d8c751af038c9aec0ac;hb=7f142d68179919a507204e7980fff4f79648dbbc;hpb=bd1c3ed7e32d3df0ceb29cb6959599e3cac2057c diff --git a/src/search.cpp b/src/search.cpp index 5ef8bc7f..dcf3e613 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -131,7 +131,7 @@ void Search::init() { int mc; // moveCount // Init reductions array - for (hd = 1; hd < 64; hd++) for (mc = 1; mc < 64; mc++) + for (hd = 1; hd < 64; ++hd) for (mc = 1; mc < 64; ++mc) { double pvRed = log(double(hd)) * log(double(mc)) / 3.0; double nonPVRed = 0.33 + log(double(hd)) * log(double(mc)) / 2.25; @@ -146,11 +146,11 @@ void Search::init() { } // Init futility margins array - for (d = 1; d < 16; d++) for (mc = 0; mc < 64; mc++) + for (d = 1; d < 16; ++d) for (mc = 0; mc < 64; ++mc) FutilityMargins[d][mc] = Value(112 * int(log(double(d * d) / 2) / log(2.0) + 1.001) - 8 * mc + 45); // Init futility move count array - for (d = 0; d < 32; d++) + for (d = 0; d < 32; ++d) { FutilityMoveCounts[0][d] = int(3 + 0.3 * pow(double(d ), 1.8)) * 3/4 + (2 < d && d < 5); FutilityMoveCounts[1][d] = int(3 + 0.3 * pow(double(d + 0.98), 1.8)); @@ -341,7 +341,7 @@ namespace { RootMoves[i].prevScore = RootMoves[i].score; // MultiPV loop. We perform a full root search for each PV line - for (PVIdx = 0; PVIdx < PVSize; PVIdx++) + for (PVIdx = 0; PVIdx < PVSize; ++PVIdx) { // Reset aspiration window starting size if (depth >= 5) @@ -810,7 +810,7 @@ moves_loop: // When in check and at SpNode search starts from here splitPoint->mutex.unlock(); } else - moveCount++; + ++moveCount; if (RootNode) { @@ -919,7 +919,7 @@ moves_loop: // When in check and at SpNode search starts from here // Check for legality only before to do the move if (!RootNode && !SpNode && !pos.legal(move, ci.pinned)) { - moveCount--; + --moveCount; continue; } @@ -1017,7 +1017,7 @@ moves_loop: // When in check and at SpNode search starts from here // iteration. This information is used for time management: When // the best move changes frequently, we allocate some more time. if (!pvMove) - BestMoveChanges++; + ++BestMoveChanges; } else // All other moves but the PV are set to the lowest value, this @@ -1443,7 +1443,7 @@ moves_loop: // When in check and at SpNode search starts from here static RKISS rk; // PRNG sequence should be not deterministic - for (int i = Time::now() % 50; i > 0; i--) + for (int i = Time::now() % 50; i > 0; --i) rk.rand(); // RootMoves are already sorted by score in descending order @@ -1514,7 +1514,7 @@ moves_loop: // When in check and at SpNode search starts from here << " multipv " << i + 1 << " pv"; - for (size_t j = 0; RootMoves[i].pv[j] != MOVE_NONE; j++) + for (size_t j = 0; RootMoves[i].pv[j] != MOVE_NONE; ++j) s << " " << move_to_uci(RootMoves[i].pv[j], pos.is_chess960()); } @@ -1730,7 +1730,7 @@ void check_time() { // Loop across all split points and sum accumulated SplitPoint nodes plus // all the currently active positions nodes. for (size_t i = 0; i < Threads.size(); ++i) - for (int j = 0; j < Threads[i]->splitPointsSize; j++) + for (int j = 0; j < Threads[i]->splitPointsSize; ++j) { SplitPoint& sp = Threads[i]->splitPoints[j];