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 Sep 23, 2020
1 parent 2b68eb5 commit 80d8f0a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 20 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 @@ -256,10 +256,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 @@ -318,14 +318,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 @@ -93,7 +93,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/Benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,3 @@ uint64_t Benchmark::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 @@ -262,12 +262,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);
}
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.3.4-mo1"
#define APP_VERSION "6.3.4-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 80d8f0a

Please sign in to comment.