]> git.sesse.net Git - stockfish/commitdiff
Fix a warning under gcc
authorMarco Costalba <mcostalba@gmail.com>
Tue, 3 Jan 2012 07:56:29 +0000 (08:56 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 3 Jan 2012 18:01:47 +0000 (19:01 +0100)
Locals left and right shadow two same named
variables in the std::ifstream base class.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/book.cpp

index 98e9e155b4330341996872979930a50743e89e49..d5bab90b3f144cf167b3e8726905c938298c1fd9 100644 (file)
@@ -458,30 +458,30 @@ Move Book::probe(const Position& pos, const string& fName, bool pickBest) {
 
 void Book::binary_search(uint64_t key) {
 
-  size_t left, right, mid;
+  size_t low, high, mid;
   BookEntry e;
 
-  left = 0;
-  right = size - 1;
+  low = 0;
+  high = size - 1;
 
-  assert(left <= right);
+  assert(low <= high);
 
-  while (left < right && good())
+  while (low < high && good())
   {
-      mid = (left + right) / 2;
+      mid = (low + high) / 2;
 
-      assert(mid >= left && mid < right);
+      assert(mid >= low && mid < high);
 
       seekg(mid * sizeof(BookEntry), ios_base::beg);
       *this >> e;
 
       if (key <= e.key)
-          right = mid;
+          high = mid;
       else
-          left = mid + 1;
+          low = mid + 1;
   }
 
-  assert(left == right);
+  assert(low == high);
 
-  seekg(left * sizeof(BookEntry), ios_base::beg);
+  seekg(low * sizeof(BookEntry), ios_base::beg);
 }