Skip to content

Commit

Permalink
Cleanup useless code, rearrange
Browse files Browse the repository at this point in the history
  • Loading branch information
Spudz76 committed Oct 19, 2020
1 parent 127236a commit 5676105
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 25 deletions.
4 changes: 0 additions & 4 deletions src/backend/common/Tags.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ const char *ocl_tag();
const char *cuda_tag();
#endif

#ifdef XMRIG_FEATURE_BENCHMARK
const char *bm_tag();
#endif


} // namespace xmrig

Expand Down
4 changes: 2 additions & 2 deletions src/base/kernel/config/BaseConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ bool xmrig::BaseConfig::read(const IJsonReader &reader, const char *fileName)
m_autoSave = reader.getBool(kAutosave, m_autoSave);
m_background = reader.getBool(kBackground, m_background);
m_dryRun = reader.getBool(kDryRun, m_dryRun);
m_pauseOnBattery = reader.getBool(kPauseOnBattery, m_pauseOnBattery);
# ifdef XMRIG_FEATURE_BENCHMARK
m_rebenchAlgo = reader.getBool(kRebenchAlgo, m_rebenchAlgo);
m_rebenchAlgo = reader.getBool(kRebenchAlgo, m_rebenchAlgo);
# endif
m_syslog = reader.getBool(kSyslog, m_syslog);
m_watch = reader.getBool(kWatch, m_watch);
m_pauseOnBattery = reader.getBool(kPauseOnBattery, m_pauseOnBattery);
m_logFile = reader.getString(kLogFile);
m_userAgent = reader.getString(kUserAgent);
m_printTime = std::min(reader.getUint(kPrintTime, m_printTime), 3600U);
Expand Down
8 changes: 4 additions & 4 deletions src/base/kernel/config/BaseTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
case IConfig::DaemonKey: /* --daemon */
# endif
case IConfig::VerboseKey: /* --verbose */
case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
# ifdef XMRIG_FEATURE_BENCHMARK
case IConfig::RebenchAlgoKey: /* --rebench-algo */
# endif
case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
return transformBoolean(doc, key, true);

case IConfig::ColorKey: /* --no-color */
Expand Down Expand Up @@ -333,14 +333,14 @@ void xmrig::BaseTransform::transformBoolean(rapidjson::Document &doc, int key, b
case IConfig::NoTitleKey: /* --no-title */
return set(doc, BaseConfig::kTitle, enable);

case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
return set(doc, BaseConfig::kPauseOnBattery, enable);

# ifdef XMRIG_FEATURE_BENCHMARK
case IConfig::RebenchAlgoKey: /* --rebench-algo */
return set(doc, BaseConfig::kRebenchAlgo, enable);
# endif

case IConfig::PauseOnBatteryKey: /* --pause-on-battery */
return set(doc, BaseConfig::kPauseOnBattery, enable);

default:
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"user-agent": null,
"verbose": 0,
"watch": true,
"pause-on-battery": false,
"rebench-algo": false,
"bench-algo-time": 20,
"pause-on-battery": false
"bench-algo-time": 20
}
5 changes: 0 additions & 5 deletions src/core/MoBenchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,3 @@ uint64_t MoBenchmark::get_now() const { // get current time in ms
}

} // namespace xmrig

const char *xmrig::bm_tag()
{
return Tags::benchmark();
}
3 changes: 1 addition & 2 deletions src/core/config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,11 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
doc.AddMember(StringRef(kUserAgent), m_userAgent.toJSON(), allocator);
doc.AddMember(StringRef(kVerbose), Log::verbose(), allocator);
doc.AddMember(StringRef(kWatch), m_watch, allocator);
doc.AddMember(StringRef(kPauseOnBattery), isPauseOnBattery(), allocator);

# ifdef XMRIG_FEATURE_BENCHMARK
doc.AddMember(StringRef(kRebenchAlgo), isRebenchAlgo(), allocator);
doc.AddMember(StringRef(kBenchAlgoTime), benchAlgoTime(), allocator);
doc.AddMember(StringRef(kAlgoPerf), m_benchmark.toJSON(doc), allocator);
# endif

doc.AddMember(StringRef(kPauseOnBattery), isPauseOnBattery(), allocator);
}
6 changes: 4 additions & 2 deletions src/core/config/Config_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ static const option options[] = {
{ "keepalive", 0, nullptr, IConfig::KeepAliveKey },
{ "log-file", 1, nullptr, IConfig::LogFileKey },
{ "nicehash", 0, nullptr, IConfig::NicehashKey },
{ "rebench-algo", 0, nullptr, IConfig::RebenchAlgoKey },
{ "bench-algo-time", 1, nullptr, IConfig::BenchAlgoTimeKey },
# ifdef XMRIG_FEATURE_PERFCHK
{ "rechk-algo", 0, nullptr, IConfig::ReChkAlgoKey },
{ "perfchk-time", 1, nullptr, IConfig::PerfChkTimeKey },
# endif
{ "no-color", 0, nullptr, IConfig::ColorKey },
{ "no-huge-pages", 0, nullptr, IConfig::HugePagesKey },
{ "pass", 1, nullptr, IConfig::PasswordKey },
Expand Down
14 changes: 14 additions & 0 deletions src/crypto/randomx/randomx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ RandomX_ConfigurationKeva::RandomX_ConfigurationKeva()

RandomX_ConfigurationScala2::RandomX_ConfigurationScala2()
{
ArgonMemory = 131072;
ArgonIterations = 2;
ArgonSalt = "DefyXScala\x13";
CacheAccesses = 2;
DatasetBaseSize = 33554432;
ScratchpadL1_Size = 65536;
ScratchpadL2_Size = 131072;
ScratchpadL3_Size = 262144;
ProgramSize = 64;
ProgramIterations = 1024;
ProgramCount = 4;

RANDOMX_FREQ_IADD_RS = 25;
RANDOMX_FREQ_CBRANCH = 16;
}

RandomX_ConfigurationBase::RandomX_ConfigurationBase()
Expand Down
4 changes: 1 addition & 3 deletions src/crypto/randomx/randomx.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,13 @@ struct RandomX_ConfigurationWownero : public RandomX_ConfigurationBase { RandomX
struct RandomX_ConfigurationArqma : public RandomX_ConfigurationBase { RandomX_ConfigurationArqma(); };
struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); };
struct RandomX_ConfigurationKeva : public RandomX_ConfigurationBase { RandomX_ConfigurationKeva(); };
struct RandomX_ConfigurationScala : public RandomX_ConfigurationBase { RandomX_ConfigurationScala(); };
struct RandomX_ConfigurationScala2 : public RandomX_ConfigurationScala { RandomX_ConfigurationScala2(); };
struct RandomX_ConfigurationScala2 : public RandomX_ConfigurationBase { RandomX_ConfigurationScala2(); };

extern RandomX_ConfigurationMonero RandomX_MoneroConfig;
extern RandomX_ConfigurationWownero RandomX_WowneroConfig;
extern RandomX_ConfigurationArqma RandomX_ArqmaConfig;
extern RandomX_ConfigurationSafex RandomX_SafexConfig;
extern RandomX_ConfigurationKeva RandomX_KevaConfig;
extern RandomX_ConfigurationScala RandomX_ScalaConfig;
extern RandomX_ConfigurationScala2 RandomX_Scala2Config;

extern RandomX_ConfigurationBase RandomX_CurrentConfig;
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define APP_ID "xmrig"
#define APP_NAME "XMRig"
#define APP_DESC "XMRig miner"
#define APP_VERSION "6.4.0-mo1"
#define APP_VERSION "6.4.0-mo2"
#define APP_DOMAIN "xmrig.com"
#define APP_SITE "www.xmrig.com"
#define APP_COPYRIGHT "Copyright (C) 2016-2020 xmrig.com"
Expand Down

0 comments on commit 5676105

Please sign in to comment.