]> git.sesse.net Git - stockfish/commitdiff
Use prefix operators wherever possible
authorLucas Braesch <lucas.braesch@gmail.com>
Thu, 3 Oct 2013 04:01:38 +0000 (12:01 +0800)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 5 Oct 2013 16:10:43 +0000 (18:10 +0200)
No functional change.

16 files changed:
src/bitbase.cpp
src/bitboard.cpp
src/evaluate.cpp
src/material.cpp
src/misc.cpp
src/movegen.cpp
src/movegen.h
src/movepick.cpp
src/pawns.cpp
src/position.cpp
src/search.cpp
src/thread.cpp
src/timeman.cpp
src/tt.cpp
src/tt.h
src/ucioption.cpp

index e4428d2d4aad5e7afb97e715a7b6570710d243a7..37b05649908e11f41462166a05d359443ab6fd01 100644 (file)
@@ -87,17 +87,17 @@ void Bitbases::init_kpk() {
   db.reserve(IndexMax);
 
   // Initialize db with known win / draw positions
   db.reserve(IndexMax);
 
   // Initialize db with known win / draw positions
-  for (idx = 0; idx < IndexMax; idx++)
+  for (idx = 0; idx < IndexMax; ++idx)
       db.push_back(KPKPosition(idx));
 
   // Iterate through the positions until no more of the unknown positions can be
   // changed to either wins or draws (15 cycles needed).
   while (repeat)
       db.push_back(KPKPosition(idx));
 
   // Iterate through the positions until no more of the unknown positions can be
   // changed to either wins or draws (15 cycles needed).
   while (repeat)
-      for (repeat = idx = 0; idx < IndexMax; idx++)
+      for (repeat = idx = 0; idx < IndexMax; ++idx)
           repeat |= (db[idx] == UNKNOWN && db[idx].classify(db) != UNKNOWN);
 
   // Map 32 results into one KPKBitbase[] entry
           repeat |= (db[idx] == UNKNOWN && db[idx].classify(db) != UNKNOWN);
 
   // Map 32 results into one KPKBitbase[] entry
-  for (idx = 0; idx < IndexMax; idx++)
+  for (idx = 0; idx < IndexMax; ++idx)
       if (db[idx] == WIN)
           KPKBitbase[idx / 32] |= 1 << (idx & 0x1F);
 }
       if (db[idx] == WIN)
           KPKBitbase[idx / 32] |= 1 << (idx & 0x1F);
 }
index cbece63c43d6bd7ac3938ac8bb3c986323fc99cb..ae653b1c2114540b997a4cb6b708a400c32a13e0 100644 (file)
@@ -197,7 +197,7 @@ void Bitboards::init() {
   for (Color c = WHITE; c <= BLACK; ++c)
       for (PieceType pt = PAWN; pt <= KING; ++pt)
           for (Square s = SQ_A1; s <= SQ_H8; ++s)
   for (Color c = WHITE; c <= BLACK; ++c)
       for (PieceType pt = PAWN; pt <= KING; ++pt)
           for (Square s = SQ_A1; s <= SQ_H8; ++s)
-              for (int k = 0; steps[pt][k]; k++)
+              for (int k = 0; steps[pt][k]; ++k)
               {
                   Square to = s + Square(c == WHITE ? steps[pt][k] : -steps[pt][k]);
 
               {
                   Square to = s + Square(c == WHITE ? steps[pt][k] : -steps[pt][k]);
 
index ec040f63a0bad5227e9813a9966f0b55e931e37b..558e7d1335476562a351f41e005cb80530ba882b 100644 (file)
@@ -499,7 +499,7 @@ Value do_evaluate(const Position& pos, Value& margin) {
 
         if (b & ei.kingRing[Them])
         {
 
         if (b & ei.kingRing[Them])
         {
-            ei.kingAttackersCount[Us]++;
+            ++ei.kingAttackersCount[Us];
             ei.kingAttackersWeight[Us] += KingAttackWeights[Piece];
             Bitboard bb = (b & ei.attackedBy[Them][KING]);
             if (bb)
             ei.kingAttackersWeight[Us] += KingAttackWeights[Piece];
             Bitboard bb = (b & ei.attackedBy[Them][KING]);
             if (bb)
index 0f1e19b9ee4a954f69bb84844e9227110f21709a..8d0b7f3a59097c7dfc8bc3b8027568b8b50eed9a 100644 (file)
@@ -113,7 +113,7 @@ namespace {
                 + RedundantQueen * pieceCount[Us][QUEEN];
 
     // Second-degree polynomial material imbalance by Tord Romstad
                 + RedundantQueen * pieceCount[Us][QUEEN];
 
     // Second-degree polynomial material imbalance by Tord Romstad
-    for (pt1 = NO_PIECE_TYPE; pt1 <= QUEEN; pt1++)
+    for (pt1 = NO_PIECE_TYPE; pt1 <= QUEEN; ++pt1)
     {
         pc = pieceCount[Us][pt1];
         if (!pc)
     {
         pc = pieceCount[Us][pt1];
         if (!pc)
@@ -121,7 +121,7 @@ namespace {
 
         v = LinearCoefficients[pt1];
 
 
         v = LinearCoefficients[pt1];
 
-        for (pt2 = NO_PIECE_TYPE; pt2 <= pt1; pt2++)
+        for (pt2 = NO_PIECE_TYPE; pt2 <= pt1; ++pt2)
             v +=  QuadraticCoefficientsSameColor[pt1][pt2] * pieceCount[Us][pt2]
                 + QuadraticCoefficientsOppositeColor[pt1][pt2] * pieceCount[Them][pt2];
 
             v +=  QuadraticCoefficientsSameColor[pt1][pt2] * pieceCount[Us][pt2]
                 + QuadraticCoefficientsOppositeColor[pt1][pt2] * pieceCount[Them][pt2];
 
index 5bf7bae8ede51276ac6f5263ac70781cc3f96972..a9b1f17eaea6514c19b0244cf2648c87b4921da0 100644 (file)
@@ -63,9 +63,9 @@ const string engine_info(bool to_uci) {
 
 static uint64_t hits[2], means[2];
 
 
 static uint64_t hits[2], means[2];
 
-void dbg_hit_on(bool b) { hits[0]++; if (b) hits[1]++; }
+void dbg_hit_on(bool b) { ++hits[0]; if (b) ++hits[1]; }
 void dbg_hit_on_c(bool c, bool b) { if (c) dbg_hit_on(b); }
 void dbg_hit_on_c(bool c, bool b) { if (c) dbg_hit_on(b); }
-void dbg_mean_of(int v) { means[0]++; means[1] += v; }
+void dbg_mean_of(int v) { ++means[0]; means[1] += v; }
 
 void dbg_print() {
 
 
 void dbg_print() {
 
index 03bc7a09fe23175054367231a14357b25c0e213b..96dd89c502f1e441e5e5edfa0b55fe1a8f7cbb8b 100644 (file)
@@ -62,7 +62,7 @@ namespace {
     (mlist++)->move = make<CASTLE>(kfrom, rfrom);
 
     if (Checks && !pos.gives_check((mlist - 1)->move, CheckInfo(pos)))
     (mlist++)->move = make<CASTLE>(kfrom, rfrom);
 
     if (Checks && !pos.gives_check((mlist - 1)->move, CheckInfo(pos)))
-        mlist--;
+        --mlist;
 
     return mlist;
   }
 
     return mlist;
   }
@@ -359,7 +359,7 @@ ExtMove* generate<EVASIONS>(const Position& pos, ExtMove* mlist) {
   // evasions so to skip known illegal moves avoiding useless legality check later.
   do
   {
   // evasions so to skip known illegal moves avoiding useless legality check later.
   do
   {
-      checkersCnt++;
+      ++checkersCnt;
       checksq = pop_lsb(&b);
 
       assert(color_of(pos.piece_on(checksq)) == ~us);
       checksq = pop_lsb(&b);
 
       assert(color_of(pos.piece_on(checksq)) == ~us);
@@ -417,7 +417,7 @@ ExtMove* generate<LEGAL>(const Position& pos, ExtMove* mlist) {
           && !pos.legal(cur->move, pinned))
           cur->move = (--end)->move;
       else
           && !pos.legal(cur->move, pinned))
           cur->move = (--end)->move;
       else
-          cur++;
+          ++cur;
 
   return end;
 }
 
   return end;
 }
index 2a4cda90dffef0117e450fdbe1a7491103f30bb8..c93252a731859edc9a2421ee303cfe722e4baf3e 100644 (file)
@@ -42,7 +42,7 @@ template<GenType T>
 struct MoveList {
 
   explicit MoveList(const Position& pos) : cur(mlist), last(generate<T>(pos, mlist)) { last->move = MOVE_NONE; }
 struct MoveList {
 
   explicit MoveList(const Position& pos) : cur(mlist), last(generate<T>(pos, mlist)) { last->move = MOVE_NONE; }
-  void operator++() { cur++; }
+  void operator++() { ++cur; }
   Move operator*() const { return cur->move; }
   size_t size() const { return last - mlist; }
   bool contains(Move m) const {
   Move operator*() const { return cur->move; }
   size_t size() const { return last - mlist; }
   bool contains(Move m) const {
index e2428554249c7a81e6cb6641ff2769715e11745f..8baf32a4cfa6e9c814c1c76684713206dbaab475 100644 (file)
@@ -299,7 +299,7 @@ Move MovePicker::next_move<false>() {
       switch (stage) {
 
       case MAIN_SEARCH: case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT:
       switch (stage) {
 
       case MAIN_SEARCH: case EVASION: case QSEARCH_0: case QSEARCH_1: case PROBCUT:
-          cur++;
+          ++cur;
           return ttMove;
 
       case CAPTURES_S1:
           return ttMove;
 
       case CAPTURES_S1:
index c5a48e930c134e361f3733391e1ee79f6e7f510a..37db2cf513e0babdc11b7235da701dfa3311c840 100644 (file)
@@ -227,7 +227,7 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) {
   Rank rkUs, rkThem;
   File kf = std::max(FILE_B, std::min(FILE_G, file_of(ksq)));
 
   Rank rkUs, rkThem;
   File kf = std::max(FILE_B, std::min(FILE_G, file_of(ksq)));
 
-  for (int f = kf - 1; f <= kf + 1; f++)
+  for (int f = kf - 1; f <= kf + 1; ++f)
   {
       b = ourPawns & FileBB[f];
       rkUs = b ? relative_rank(Us, backmost_sq(Us, b)) : RANK_1;
   {
       b = ourPawns & FileBB[f];
       rkUs = b ? relative_rank(Us, backmost_sq(Us, b)) : RANK_1;
index 28b39c8d50feda128a034bfbcb8ed065a616f6a1..bef7a0fe4732f5c34ccefa5e068a6d892a2272cb 100644 (file)
@@ -128,7 +128,7 @@ void Position::init() {
   for (File f = FILE_A; f <= FILE_H; ++f)
       Zobrist::enpassant[f] = rk.rand<Key>();
 
   for (File f = FILE_A; f <= FILE_H; ++f)
       Zobrist::enpassant[f] = rk.rand<Key>();
 
-  for (int cr = CASTLES_NONE; cr <= ALL_CASTLES; cr++)
+  for (int cr = CASTLES_NONE; cr <= ALL_CASTLES; ++cr)
   {
       Bitboard b = cr;
       while (b)
   {
       Bitboard b = cr;
       while (b)
@@ -345,7 +345,7 @@ const string Position::fen() const {
               int emptyCnt = 1;
 
               for ( ; file < FILE_H && empty(++sq); ++file)
               int emptyCnt = 1;
 
               for ( ; file < FILE_H && empty(++sq); ++file)
-                  emptyCnt++;
+                  ++emptyCnt;
 
               ss << emptyCnt;
           }
 
               ss << emptyCnt;
           }
@@ -718,7 +718,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
   assert(is_ok(m));
   assert(&newSt != st);
 
   assert(is_ok(m));
   assert(&newSt != st);
 
-  nodes++;
+  ++nodes;
   Key k = st->key;
 
   // Copy some fields of old state to our new StateInfo object except the ones
   Key k = st->key;
 
   // Copy some fields of old state to our new StateInfo object except the ones
@@ -734,9 +734,9 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
 
   // Increment ply counters.In particular rule50 will be later reset it to zero
   // in case of a capture or a pawn move.
 
   // Increment ply counters.In particular rule50 will be later reset it to zero
   // in case of a capture or a pawn move.
-  gamePly++;
-  st->rule50++;
-  st->pliesFromNull++;
+  ++gamePly;
+  ++st->rule50;
+  ++st->pliesFromNull;
 
   Color us = sideToMove;
   Color them = ~us;
 
   Color us = sideToMove;
   Color them = ~us;
@@ -978,7 +978,7 @@ void Position::undo_move(Move m) {
 
   // Finally point our state pointer back to the previous state
   st = st->previous;
 
   // Finally point our state pointer back to the previous state
   st = st->previous;
-  gamePly--;
+  --gamePly;
 
   assert(pos_is_ok());
 }
 
   assert(pos_is_ok());
 }
@@ -1019,7 +1019,7 @@ void Position::do_null_move(StateInfo& newSt) {
   st->key ^= Zobrist::side;
   prefetch((char*)TT.first_entry(st->key));
 
   st->key ^= Zobrist::side;
   prefetch((char*)TT.first_entry(st->key));
 
-  st->rule50++;
+  ++st->rule50;
   st->pliesFromNull = 0;
 
   sideToMove = ~sideToMove;
   st->pliesFromNull = 0;
 
   sideToMove = ~sideToMove;
@@ -1106,7 +1106,7 @@ int Position::see(Move m, int asymmThreshold) const {
 
       // Add the new entry to the swap list
       swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured];
 
       // Add the new entry to the swap list
       swapList[slIndex] = -swapList[slIndex - 1] + PieceValue[MG][captured];
-      slIndex++;
+      ++slIndex;
 
       // Locate and remove the next least valuable attacker
       captured = min_attacker<PAWN>(byTypeBB, to, stmAttackers, occupied, attackers);
 
       // Locate and remove the next least valuable attacker
       captured = min_attacker<PAWN>(byTypeBB, to, stmAttackers, occupied, attackers);
@@ -1150,7 +1150,7 @@ void Position::clear() {
   st = &startState;
 
   for (int i = 0; i < PIECE_TYPE_NB; ++i)
   st = &startState;
 
   for (int i = 0; i < PIECE_TYPE_NB; ++i)
-      for (int j = 0; j < 16; j++)
+      for (int j = 0; j < 16; ++j)
           pieceList[WHITE][i][j] = pieceList[BLACK][i][j] = SQ_NONE;
 }
 
           pieceList[WHITE][i][j] = pieceList[BLACK][i][j] = SQ_NONE;
 }
 
@@ -1368,7 +1368,7 @@ bool Position::pos_is_ok(int* failedStep) const {
 
       for (Square s = SQ_A1; s <= SQ_H8; ++s)
           if (type_of(piece_on(s)) == KING)
 
       for (Square s = SQ_A1; s <= SQ_H8; ++s)
           if (type_of(piece_on(s)) == KING)
-              kingCount[color_of(piece_on(s))]++;
+              ++kingCount[color_of(piece_on(s))];
 
       if (kingCount[0] != 1 || kingCount[1] != 1)
           return false;
 
       if (kingCount[0] != 1 || kingCount[1] != 1)
           return false;
index 5ef8bc7fbdd9571962138d8c751af038c9aec0ac..dcf3e6134a4a5d4c83c48a1542f85f8ec3ebb23f 100644 (file)
@@ -131,7 +131,7 @@ void Search::init() {
   int mc; // moveCount
 
   // Init reductions array
   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;
   {
       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
   }
 
   // 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
       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));
   {
       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
             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)
         {
             // 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
           splitPoint->mutex.unlock();
       }
       else
-          moveCount++;
+          ++moveCount;
 
       if (RootNode)
       {
 
       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))
       {
       // Check for legality only before to do the move
       if (!RootNode && !SpNode && !pos.legal(move, ci.pinned))
       {
-          moveCount--;
+          --moveCount;
           continue;
       }
 
           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)
               // 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
           }
           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
     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<unsigned>();
 
     // RootMoves are already sorted by score in descending order
         rk.rand<unsigned>();
 
     // 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";
 
           << " 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());
     }
 
             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)
       // 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];
 
           {
               SplitPoint& sp = Threads[i]->splitPoints[j];
 
index 782537d765dd6c567c22883b42764e38cb74a479..735cc97caef33aaed97c643ffadab1354d5b678c 100644 (file)
@@ -296,7 +296,7 @@ void Thread::split(Position& pos, const Stack* ss, Value alpha, Value beta, Valu
   Threads.mutex.lock();
   sp.mutex.lock();
 
   Threads.mutex.lock();
   sp.mutex.lock();
 
-  splitPointsSize++;
+  ++splitPointsSize;
   activeSplitPoint = &sp;
   activePosition = NULL;
 
   activeSplitPoint = &sp;
   activePosition = NULL;
 
@@ -336,7 +336,7 @@ void Thread::split(Position& pos, const Stack* ss, Value alpha, Value beta, Valu
   }
 
   searching = true;
   }
 
   searching = true;
-  splitPointsSize--;
+  --splitPointsSize;
   activeSplitPoint = sp.parentSplitPoint;
   activePosition = &pos;
   pos.set_nodes_searched(pos.nodes_searched() + sp.nodes);
   activeSplitPoint = sp.parentSplitPoint;
   activePosition = &pos;
   pos.set_nodes_searched(pos.nodes_searched() + sp.nodes);
index 62b7eb11432563d4f0f8471dfc904d772c68fd78..34dbcc6eb13598b0fdf57d4e37f6bdd7dba6c29b 100644 (file)
@@ -114,7 +114,7 @@ void TimeManager::init(const Search::LimitsType& limits, int currentPly, Color u
 
   // We calculate optimum time usage for different hypothetic "moves to go"-values and choose the
   // minimum of calculated search time values. Usually the greatest hypMTG gives the minimum values.
 
   // We calculate optimum time usage for different hypothetic "moves to go"-values and choose the
   // minimum of calculated search time values. Usually the greatest hypMTG gives the minimum values.
-  for (hypMTG = 1; hypMTG <= (limits.movestogo ? std::min(limits.movestogo, MoveHorizon) : MoveHorizon); hypMTG++)
+  for (hypMTG = 1; hypMTG <= (limits.movestogo ? std::min(limits.movestogo, MoveHorizon) : MoveHorizon); ++hypMTG)
   {
       // Calculate thinking time for hypothetic "moves to go"-value
       hypMyTime =  limits.time[us]
   {
       // Calculate thinking time for hypothetic "moves to go"-value
       hypMyTime =  limits.time[us]
index 11173e0a1243511e24618f82a4def19a67f925dd..d2ff8704072764821eadc49e12f02283d04f2b68 100644 (file)
@@ -73,7 +73,7 @@ const TTEntry* TranspositionTable::probe(const Key key) const {
   const TTEntry* tte = first_entry(key);
   uint32_t key32 = key >> 32;
 
   const TTEntry* tte = first_entry(key);
   uint32_t key32 = key >> 32;
 
-  for (unsigned i = 0; i < ClusterSize; ++i, tte++)
+  for (unsigned i = 0; i < ClusterSize; ++i, ++tte)
       if (tte->key() == key32)
           return tte;
 
       if (tte->key() == key32)
           return tte;
 
@@ -97,7 +97,7 @@ void TranspositionTable::store(const Key key, Value v, Bound b, Depth d, Move m,
 
   tte = replace = first_entry(key);
 
 
   tte = replace = first_entry(key);
 
-  for (unsigned i = 0; i < ClusterSize; ++i, tte++)
+  for (unsigned i = 0; i < ClusterSize; ++i, ++tte)
   {
       if (!tte->key() || tte->key() == key32) // Empty or overwrite old
       {
   {
       if (!tte->key() || tte->key() == key32) // Empty or overwrite old
       {
index 3113751adb938e868616efe6a8eb78c15e946b43..3953d1c90dabfcdb462484575c36d0a9963c9717 100644 (file)
--- a/src/tt.h
+++ b/src/tt.h
@@ -78,7 +78,7 @@ class TranspositionTable {
 
 public:
  ~TranspositionTable() { free(mem); }
 
 public:
  ~TranspositionTable() { free(mem); }
-  void new_search() { generation++; }
+  void new_search() { ++generation; }
 
   const TTEntry* probe(const Key key) const;
   TTEntry* first_entry(const Key key) const;
 
   const TTEntry* probe(const Key key) const;
   TTEntry* first_entry(const Key key) const;
index af2332bc27dc9b59adc1f1c57647daf505c82e7a..8e9a9233c39fff742a158f8f9b4eb0fe1374dbb6 100644 (file)
@@ -94,7 +94,7 @@ void init(OptionsMap& o) {
 
 std::ostream& operator<<(std::ostream& os, const OptionsMap& om) {
 
 
 std::ostream& operator<<(std::ostream& os, const OptionsMap& om) {
 
-  for (size_t idx = 0; idx < om.size(); idx++)
+  for (size_t idx = 0; idx < om.size(); ++idx)
       for (OptionsMap::const_iterator it = om.begin(); it != om.end(); ++it)
           if (it->second.idx == idx)
           {
       for (OptionsMap::const_iterator it = om.begin(); it != om.end(); ++it)
           if (it->second.idx == idx)
           {