mirror of
https://github.com/xmrig/xmrig.git
synced 2024-12-23 12:09:22 +00:00
Make Process::location static.
This commit is contained in:
parent
c44ae06d54
commit
bdf12bca0f
4 changed files with 13 additions and 7 deletions
|
@ -127,7 +127,7 @@ private:
|
|||
return config.release();
|
||||
}
|
||||
|
||||
chain.addFile(process->location(Process::ExeLocation, "config.json"));
|
||||
chain.addFile(Process::location(Process::ExeLocation, "config.json"));
|
||||
|
||||
if (read(chain, config)) {
|
||||
return config.release();
|
||||
|
|
|
@ -101,9 +101,9 @@ static int showVersion()
|
|||
|
||||
|
||||
#ifdef XMRIG_FEATURE_HWLOC
|
||||
static int exportTopology(const Process &process)
|
||||
static int exportTopology(const Process &)
|
||||
{
|
||||
const String path = process.location(Process::ExeLocation, "topology.xml");
|
||||
const String path = Process::location(Process::ExeLocation, "topology.xml");
|
||||
|
||||
hwloc_topology_t topology;
|
||||
hwloc_topology_init(&topology);
|
||||
|
|
|
@ -31,7 +31,10 @@
|
|||
#include "base/tools/Chrono.h"
|
||||
|
||||
|
||||
static size_t location(xmrig::Process::Location location, char *buf, size_t max)
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static size_t getLocation(Process::Location location, char *buf, size_t max)
|
||||
{
|
||||
using namespace xmrig;
|
||||
|
||||
|
@ -48,6 +51,9 @@ static size_t location(xmrig::Process::Location location, char *buf, size_t max)
|
|||
}
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
xmrig::Process::Process(int argc, char **argv) :
|
||||
m_arguments(argc, argv)
|
||||
{
|
||||
|
@ -55,12 +61,12 @@ xmrig::Process::Process(int argc, char **argv) :
|
|||
}
|
||||
|
||||
|
||||
xmrig::String xmrig::Process::location(Location location, const char *fileName) const
|
||||
xmrig::String xmrig::Process::location(Location location, const char *fileName)
|
||||
{
|
||||
constexpr const size_t max = 520;
|
||||
|
||||
char *buf = new char[max]();
|
||||
size_t size = ::location(location, buf, max);
|
||||
size_t size = getLocation(location, buf, max);
|
||||
|
||||
if (size == 0) {
|
||||
delete [] buf;
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
|
||||
Process(int argc, char **argv);
|
||||
|
||||
String location(Location location, const char *fileName = nullptr) const;
|
||||
static String location(Location location, const char *fileName = nullptr);
|
||||
|
||||
inline const Arguments &arguments() const { return m_arguments; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue