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>
static Book book; // Defined static to initialize the PRNG only once
static Book book; // Defined static to initialize the PRNG only once
Position& pos = RootPosition;
Chess960 = pos.is_chess960();
elapsed_time(true);
Position& pos = RootPosition;
Chess960 = pos.is_chess960();
elapsed_time(true);
- if ( Options["OwnBook"]
- && (bm = book.probe(pos, Options["Book File"], Options["Best Book Move"])) != MOVE_NONE
- && count(RootMoves.begin(), RootMoves.end(), bm))
+ if (Options["OwnBook"])
- std::swap(RootMoves[0], *find(RootMoves.begin(), RootMoves.end(), bm));
- goto finalize;
+ 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;
+ }
}
// Read UCI options: GUI could change UCI parameters during the game
}
// Read UCI options: GUI could change UCI parameters during the game