From 39a8c68ab73e2affae11b0b4a39e8d251e61aa4e Mon Sep 17 00:00:00 2001 From: SChernykh Date: Mon, 23 Aug 2021 11:44:26 +0200 Subject: [PATCH] More clang fixes --- cmake/flags.cmake | 2 +- src/mempool.cpp | 3 +-- src/mempool.h | 5 +---- src/p2pool.cpp | 2 +- src/util.cpp | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 1b4436f..ec92dd9 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -39,7 +39,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${WARNING_FLAGS} ${SECURITY_FLAGS} /Ob1 /Ot /Zi /MT") elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) - set(WARNING_FLAGS "-Wall -Wextra -Werror") + set(WARNING_FLAGS "-Wall -Wextra") set(OPTIMIZATION_FLAGS "-Ofast -funroll-loops -fmerge-all-constants") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}") diff --git a/src/mempool.cpp b/src/mempool.cpp index 31d841b..5ba4f3f 100644 --- a/src/mempool.cpp +++ b/src/mempool.cpp @@ -23,8 +23,7 @@ static constexpr char log_category_prefix[] = "Mempool "; namespace p2pool { -Mempool::Mempool(p2pool* pool) - : m_pool(pool) +Mempool::Mempool() { uv_rwlock_init_checked(&m_lock); } diff --git a/src/mempool.h b/src/mempool.h index bb79d07..8a4c035 100644 --- a/src/mempool.h +++ b/src/mempool.h @@ -26,15 +26,12 @@ class p2pool; class Mempool : public nocopy_nomove { public: - explicit Mempool(p2pool* pool); + Mempool(); ~Mempool(); void add(const TxMempoolData& tx); void swap(std::vector& transactions); -private: - p2pool* m_pool; - public: mutable uv_rwlock_t m_lock; std::vector m_transactions; diff --git a/src/p2pool.cpp b/src/p2pool.cpp index 892cac2..1c8ec18 100644 --- a/src/p2pool.cpp +++ b/src/p2pool.cpp @@ -65,7 +65,7 @@ p2pool::p2pool(int argc, char* argv[]) m_sideChain = new SideChain(this); m_hasher = new RandomX_Hasher(this); m_blockTemplate = new BlockTemplate(this); - m_mempool = new Mempool(this); + m_mempool = new Mempool(); m_consoleCommands = new ConsoleCommands(this); } diff --git a/src/util.cpp b/src/util.cpp index 8b41004..d687759 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -50,7 +50,7 @@ void make_thread_background() SetThreadPriorityBoost(GetCurrentThread(), true); SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE); -#else +#elif !defined(__APPLE__) sched_param param; param.sched_priority = 0; if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) {