mirror of
https://github.com/sockspls/badfish
synced 2025-05-03 10:09:35 +00:00
Fix a (bogus) warning with gcc 4.4
Fix an incorrect warning: 'bm may be used uninitialized' with the old but still commonly used gcc 4.4 No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
4a4513d126
commit
db57b5f8f4
1 changed files with 8 additions and 6 deletions
|
@ -249,7 +249,6 @@ void Search::think() {
|
||||||
|
|
||||||
static Book book; // Defined static to initialize the PRNG only once
|
static Book book; // Defined static to initialize the PRNG only once
|
||||||
|
|
||||||
Move bm;
|
|
||||||
Position& pos = RootPosition;
|
Position& pos = RootPosition;
|
||||||
Chess960 = pos.is_chess960();
|
Chess960 = pos.is_chess960();
|
||||||
elapsed_time(true);
|
elapsed_time(true);
|
||||||
|
@ -266,13 +265,16 @@ void Search::think() {
|
||||||
goto finalize;
|
goto finalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( Options["OwnBook"]
|
if (Options["OwnBook"])
|
||||||
&& (bm = book.probe(pos, Options["Book File"], Options["Best Book Move"])) != MOVE_NONE
|
|
||||||
&& count(RootMoves.begin(), RootMoves.end(), bm))
|
|
||||||
{
|
{
|
||||||
std::swap(RootMoves[0], *find(RootMoves.begin(), RootMoves.end(), bm));
|
Move bookMove = book.probe(pos, Options["Book File"], Options["Best Book Move"]);
|
||||||
|
|
||||||
|
if (bookMove && count(RootMoves.begin(), RootMoves.end(), bookMove))
|
||||||
|
{
|
||||||
|
std::swap(RootMoves[0], *find(RootMoves.begin(), RootMoves.end(), bookMove));
|
||||||
goto finalize;
|
goto finalize;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Read UCI options: GUI could change UCI parameters during the game
|
// Read UCI options: GUI could change UCI parameters during the game
|
||||||
read_evaluation_uci_options(pos.side_to_move());
|
read_evaluation_uci_options(pos.side_to_move());
|
||||||
|
|
Loading…
Add table
Reference in a new issue