Code cleanup based on Clang-Tidy.

This commit is contained in:
XMRig 2021-08-25 18:45:15 +07:00
parent 3215403815
commit c7ac314110
No known key found for this signature in database
GPG key ID: 446A53638BE94409
133 changed files with 437 additions and 833 deletions

View file

@ -1,6 +1,6 @@
/* XMRig
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "core/Controller.h"
#include "backend/cpu/Cpu.h"
#include "core/config/Config.h"
@ -100,7 +99,7 @@ xmrig::Network *xmrig::Controller::network() const
}
void xmrig::Controller::execCommand(char command)
void xmrig::Controller::execCommand(char command) const
{
miner()->execCommand(command);
network()->execCommand(command);

View file

@ -1,6 +1,6 @@
/* XMRig
* Copyright 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -49,7 +49,7 @@ public:
Miner *miner() const;
Network *network() const;
void execCommand(char command);
void execCommand(char command) const;
private:
std::shared_ptr<Miner> m_miner;

View file

@ -78,7 +78,7 @@ public:
XMRIG_DISABLE_COPY_MOVE_DEFAULT(MinerPrivate)
inline MinerPrivate(Controller *controller) : controller(controller) {}
inline explicit MinerPrivate(Controller *controller) : controller(controller) {}
inline ~MinerPrivate()
@ -329,7 +329,7 @@ public:
# ifdef XMRIG_ALGO_RANDOMX
inline bool initRX() { return Rx::init(job, controller->config()->rx(), controller->config()->cpu()); }
inline bool initRX() const { return Rx::init(job, controller->config()->rx(), controller->config()->cpu()); }
# endif

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <cinttypes>
#include <cstring>
@ -112,7 +111,7 @@ public:
}
};
}
} // namespace xmrig
xmrig::Config::Config() :

View file

@ -16,7 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "core/config/ConfigTransform.h"
#include "base/kernel/interfaces/IConfig.h"
#include "base/net/stratum/Pool.h"
@ -354,6 +353,9 @@ void xmrig::ConfigTransform::transformBenchmark(rapidjson::Document &doc, int ke
case IConfig::UserKey: /* --user */
return set(doc, BenchConfig::kBenchmark, BenchConfig::kUser, arg);
default:
break;
}
}
#endif