mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Run clang-tidy 'modernize'
Some warnings after a run of: $ clang-tidy-3.8 -checks='modernize-*' *.cpp syzygy/*.cpp -header-filter=.* -- -std=c++11 I have not fixed all suggestions, for instance I still prefer to declare the type instead of a spread use of 'auto'. I also perfer good old 'typedef' to the new 'using' form. I have not fixed some warnings in the last functions of syzygy code because those are still the original functions and need to be completely rewritten anyhow. Thanks to erbsenzaehler for the original idea. No functional change.
This commit is contained in:
parent
df6cb446ea
commit
c3e964f35e
5 changed files with 9 additions and 9 deletions
|
@ -85,7 +85,7 @@ template<EndgameCode E, typename T = eg_type<E>>
|
||||||
struct Endgame : public EndgameBase<T> {
|
struct Endgame : public EndgameBase<T> {
|
||||||
|
|
||||||
explicit Endgame(Color c) : EndgameBase<T>(c) {}
|
explicit Endgame(Color c) : EndgameBase<T>(c) {}
|
||||||
T operator()(const Position&) const;
|
T operator()(const Position&) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -63,10 +63,10 @@ struct Tie: public streambuf { // MSVC requires split streambuf for cin and cout
|
||||||
|
|
||||||
Tie(streambuf* b, streambuf* l) : buf(b), logBuf(l) {}
|
Tie(streambuf* b, streambuf* l) : buf(b), logBuf(l) {}
|
||||||
|
|
||||||
int sync() { return logBuf->pubsync(), buf->pubsync(); }
|
int sync() override { return logBuf->pubsync(), buf->pubsync(); }
|
||||||
int overflow(int c) { return log(buf->sputc((char)c), "<< "); }
|
int overflow(int c) override { return log(buf->sputc((char)c), "<< "); }
|
||||||
int underflow() { return buf->sgetc(); }
|
int underflow() override { return buf->sgetc(); }
|
||||||
int uflow() { return log(buf->sbumpc(), ">> "); }
|
int uflow() override { return log(buf->sbumpc(), ">> "); }
|
||||||
|
|
||||||
streambuf *buf, *logBuf;
|
streambuf *buf, *logBuf;
|
||||||
|
|
||||||
|
|
|
@ -253,7 +253,7 @@ void MainThread::search() {
|
||||||
|
|
||||||
if (rootMoves.empty())
|
if (rootMoves.empty())
|
||||||
{
|
{
|
||||||
rootMoves.push_back(RootMove(MOVE_NONE));
|
rootMoves.emplace_back(MOVE_NONE);
|
||||||
sync_cout << "info depth 0 score "
|
sync_cout << "info depth 0 score "
|
||||||
<< UCI::value(rootPos.checkers() ? -VALUE_MATE : VALUE_DRAW)
|
<< UCI::value(rootPos.checkers() ? -VALUE_MATE : VALUE_DRAW)
|
||||||
<< sync_endl;
|
<< sync_endl;
|
||||||
|
|
|
@ -489,8 +489,8 @@ void HashTable::insert(const std::vector<PieceType>& pieces) {
|
||||||
|
|
||||||
MaxCardinality = std::max((int)pieces.size(), MaxCardinality);
|
MaxCardinality = std::max((int)pieces.size(), MaxCardinality);
|
||||||
|
|
||||||
wdlTable.push_back(WDLEntry(code));
|
wdlTable.emplace_back(code);
|
||||||
dtzTable.push_back(DTZEntry(wdlTable.back()));
|
dtzTable.emplace_back(wdlTable.back());
|
||||||
|
|
||||||
insert(wdlTable.back().key , &wdlTable.back(), &dtzTable.back());
|
insert(wdlTable.back().key , &wdlTable.back(), &dtzTable.back());
|
||||||
insert(wdlTable.back().key2, &wdlTable.back(), &dtzTable.back());
|
insert(wdlTable.back().key2, &wdlTable.back(), &dtzTable.back());
|
||||||
|
|
|
@ -78,7 +78,7 @@ struct MainThread : public Thread {
|
||||||
|
|
||||||
using Thread::Thread;
|
using Thread::Thread;
|
||||||
|
|
||||||
virtual void search();
|
void search() override;
|
||||||
void check_time();
|
void check_time();
|
||||||
|
|
||||||
bool easyMovePlayed, failedLow;
|
bool easyMovePlayed, failedLow;
|
||||||
|
|
Loading…
Add table
Reference in a new issue