mirror of
https://github.com/wownero/wownero.git
synced 2026-11-20 15:45:05 +01:00
Merge pull request #10842
fa91ae4common: remove dead code (Thomas)8701fc9blockchain_db: remove unused MDB_val_copy specializations (Thomas)00d21eeepee: remove dead code (Thomas) ACKs: selsta, jpk68
This commit is contained in:
@@ -106,36 +106,6 @@ private:
|
||||
T t_copy;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct MDB_val_copy<cryptonote::blobdata>: public MDB_val
|
||||
{
|
||||
MDB_val_copy(const cryptonote::blobdata &bd) :
|
||||
data(new char[bd.size()])
|
||||
{
|
||||
memcpy(data.get(), bd.data(), bd.size());
|
||||
mv_size = bd.size();
|
||||
mv_data = data.get();
|
||||
}
|
||||
private:
|
||||
std::unique_ptr<char[]> data;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct MDB_val_copy<const char*>: public MDB_val
|
||||
{
|
||||
MDB_val_copy(const char *s):
|
||||
size(strlen(s)+1), // include the NUL, makes it easier for compares
|
||||
data(new char[size])
|
||||
{
|
||||
mv_size = size;
|
||||
mv_data = data.get();
|
||||
memcpy(mv_data, s, size);
|
||||
}
|
||||
private:
|
||||
size_t size;
|
||||
std::unique_ptr<char[]> data;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace cryptonote
|
||||
|
||||
@@ -219,19 +219,6 @@ namespace command_line
|
||||
description.add_options()(arg.name, boost::program_options::bool_switch(), arg.description);
|
||||
}
|
||||
|
||||
template<typename charT>
|
||||
boost::program_options::basic_parsed_options<charT> parse_command_line(int argc, const charT* const argv[],
|
||||
const boost::program_options::options_description& desc, bool allow_unregistered = false)
|
||||
{
|
||||
auto parser = boost::program_options::command_line_parser(argc, argv);
|
||||
parser.options(desc);
|
||||
if (allow_unregistered)
|
||||
{
|
||||
parser.allow_unregistered();
|
||||
}
|
||||
return parser.run();
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
bool handle_error_helper(const boost::program_options::options_description& desc, F parser)
|
||||
{
|
||||
|
||||
@@ -274,20 +274,6 @@ namespace tools
|
||||
return control;
|
||||
}
|
||||
|
||||
bool download_finished(const download_async_handle &control)
|
||||
{
|
||||
CHECK_AND_ASSERT_MES(control != 0, false, "NULL async download handle");
|
||||
boost::lock_guard<boost::mutex> lock(control->mutex);
|
||||
return control->stopped;
|
||||
}
|
||||
|
||||
bool download_error(const download_async_handle &control)
|
||||
{
|
||||
CHECK_AND_ASSERT_MES(control != 0, false, "NULL async download handle");
|
||||
boost::lock_guard<boost::mutex> lock(control->mutex);
|
||||
return !control->success;
|
||||
}
|
||||
|
||||
bool download_wait(const download_async_handle &control)
|
||||
{
|
||||
CHECK_AND_ASSERT_MES(control != 0, false, "NULL async download handle");
|
||||
|
||||
@@ -46,8 +46,6 @@ namespace tools
|
||||
|
||||
bool download(const std::string &path, const std::string &url, std::function<bool(const std::string&, const std::string&, size_t, ssize_t)> progress = NULL);
|
||||
download_async_handle download_async(const std::string &path, const std::string &url, std::function<void(const std::string&, const std::string&, bool)> result, std::function<bool(const std::string&, const std::string&, size_t, ssize_t)> progress = NULL);
|
||||
bool download_error(const download_async_handle &h);
|
||||
bool download_finished(const download_async_handle &h);
|
||||
bool download_wait(const download_async_handle &h);
|
||||
bool download_cancel(const download_async_handle &h);
|
||||
}
|
||||
|
||||
@@ -97,17 +97,6 @@ el::Level performance_timer_log_level = el::Level::Info;
|
||||
static thread_local std::vector<LoggingPerformanceTimer*> *performance_timers = NULL;
|
||||
#endif
|
||||
|
||||
void set_performance_timer_log_level(el::Level level)
|
||||
{
|
||||
if (level != el::Level::Debug && level != el::Level::Trace && level != el::Level::Info
|
||||
&& level != el::Level::Warning && level != el::Level::Error && level != el::Level::Fatal)
|
||||
{
|
||||
MERROR("Wrong log level: " << el::LevelHelper::convertToString(level) << ", using Info");
|
||||
level = el::Level::Info;
|
||||
}
|
||||
performance_timer_log_level = level;
|
||||
}
|
||||
|
||||
PerformanceTimer::PerformanceTimer(bool paused): started(true), paused(paused)
|
||||
{
|
||||
if (paused)
|
||||
|
||||
@@ -75,8 +75,6 @@ private:
|
||||
el::Level level;
|
||||
};
|
||||
|
||||
void set_performance_timer_log_level(el::Level level);
|
||||
|
||||
#define PERF_TIMER_NAME(name) pt_##name
|
||||
#define PERF_TIMER_UNIT(name, unit) tools::LoggingPerformanceTimer PERF_TIMER_NAME(name)(#name, "perf." MONERO_DEFAULT_LOG_CATEGORY, unit, tools::performance_timer_log_level)
|
||||
#define PERF_TIMER_UNIT_L(name, unit, l) tools::LoggingPerformanceTimer PERF_TIMER_NAME(name)t_##name(#name, "perf." MONERO_DEFAULT_LOG_CATEGORY, unit, l)
|
||||
|
||||
Reference in New Issue
Block a user