mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Fix a warning under gcc
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>
This commit is contained in:
parent
cb1709ef5e
commit
30418a3cfc
1 changed files with 11 additions and 11 deletions
22
src/book.cpp
22
src/book.cpp
|
@ -458,30 +458,30 @@ Move Book::probe(const Position& pos, const string& fName, bool pickBest) {
|
||||||
|
|
||||||
void Book::binary_search(uint64_t key) {
|
void Book::binary_search(uint64_t key) {
|
||||||
|
|
||||||
size_t left, right, mid;
|
size_t low, high, mid;
|
||||||
BookEntry e;
|
BookEntry e;
|
||||||
|
|
||||||
left = 0;
|
low = 0;
|
||||||
right = size - 1;
|
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);
|
seekg(mid * sizeof(BookEntry), ios_base::beg);
|
||||||
*this >> e;
|
*this >> e;
|
||||||
|
|
||||||
if (key <= e.key)
|
if (key <= e.key)
|
||||||
right = mid;
|
high = mid;
|
||||||
else
|
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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue