]> git.sesse.net Git - stockfish/commitdiff
Fix a warning under MSVC
authorMarco Costalba <mcostalba@gmail.com>
Thu, 19 Feb 2015 09:18:24 +0000 (10:18 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 19 Feb 2015 09:18:24 +0000 (10:18 +0100)
Assignment of size_t to int.

No functional change.

src/search.cpp

index b1eac341f62dfb5d61998b1f1fb768577c0aafc8..76d0350c9c7284cf2e4ec400166174f63891c7f3 100644 (file)
@@ -1589,7 +1589,7 @@ void Thread::idle_loop() {
           // Try to late join to another split point if none of its slaves has
           // already finished.
           SplitPoint* bestSp = NULL;
           // Try to late join to another split point if none of its slaves has
           // already finished.
           SplitPoint* bestSp = NULL;
-          int bestThread = 0;
+          Thread* bestThread = NULL;
           int bestScore = INT_MAX;
 
           for (size_t i = 0; i < Threads.size(); ++i)
           int bestScore = INT_MAX;
 
           for (size_t i = 0; i < Threads.size(); ++i)
@@ -1615,7 +1615,7 @@ void Thread::idle_loop() {
                   if (score < bestScore)
                   {
                       bestSp = sp;
                   if (score < bestScore)
                   {
                       bestSp = sp;
-                      bestThread = i;
+                      bestThread = Threads[i];
                       bestScore = score;
                   }
               }
                       bestScore = score;
                   }
               }
@@ -1631,7 +1631,7 @@ void Thread::idle_loop() {
 
               if (   sp->allSlavesSearching
                   && sp->slavesCount < MAX_SLAVES_PER_SPLITPOINT
 
               if (   sp->allSlavesSearching
                   && sp->slavesCount < MAX_SLAVES_PER_SPLITPOINT
-                  && available_to(Threads[bestThread]))
+                  && available_to(bestThread))
               {
                   sp->slavesMask.set(idx);
                   sp->slavesCount++;
               {
                   sp->slavesMask.set(idx);
                   sp->slavesCount++;