mirror of
https://github.com/SChernykh/p2pool.git
synced 2025-01-03 09:19:24 +00:00
More clang fixes
This commit is contained in:
parent
4a5691e349
commit
39a8c68ab7
5 changed files with 5 additions and 9 deletions
|
@ -39,7 +39,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${WARNING_FLAGS} ${SECURITY_FLAGS} /Ob1 /Ot /Zi /MT")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${WARNING_FLAGS} ${SECURITY_FLAGS} /Ob1 /Ot /Zi /MT")
|
||||||
|
|
||||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
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(OPTIMIZATION_FLAGS "-Ofast -funroll-loops -fmerge-all-constants")
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS}")
|
||||||
|
|
|
@ -23,8 +23,7 @@ static constexpr char log_category_prefix[] = "Mempool ";
|
||||||
|
|
||||||
namespace p2pool {
|
namespace p2pool {
|
||||||
|
|
||||||
Mempool::Mempool(p2pool* pool)
|
Mempool::Mempool()
|
||||||
: m_pool(pool)
|
|
||||||
{
|
{
|
||||||
uv_rwlock_init_checked(&m_lock);
|
uv_rwlock_init_checked(&m_lock);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,15 +26,12 @@ class p2pool;
|
||||||
class Mempool : public nocopy_nomove
|
class Mempool : public nocopy_nomove
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit Mempool(p2pool* pool);
|
Mempool();
|
||||||
~Mempool();
|
~Mempool();
|
||||||
|
|
||||||
void add(const TxMempoolData& tx);
|
void add(const TxMempoolData& tx);
|
||||||
void swap(std::vector<TxMempoolData>& transactions);
|
void swap(std::vector<TxMempoolData>& transactions);
|
||||||
|
|
||||||
private:
|
|
||||||
p2pool* m_pool;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
mutable uv_rwlock_t m_lock;
|
mutable uv_rwlock_t m_lock;
|
||||||
std::vector<TxMempoolData> m_transactions;
|
std::vector<TxMempoolData> m_transactions;
|
||||||
|
|
|
@ -65,7 +65,7 @@ p2pool::p2pool(int argc, char* argv[])
|
||||||
m_sideChain = new SideChain(this);
|
m_sideChain = new SideChain(this);
|
||||||
m_hasher = new RandomX_Hasher(this);
|
m_hasher = new RandomX_Hasher(this);
|
||||||
m_blockTemplate = new BlockTemplate(this);
|
m_blockTemplate = new BlockTemplate(this);
|
||||||
m_mempool = new Mempool(this);
|
m_mempool = new Mempool();
|
||||||
m_consoleCommands = new ConsoleCommands(this);
|
m_consoleCommands = new ConsoleCommands(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ void make_thread_background()
|
||||||
SetThreadPriorityBoost(GetCurrentThread(), true);
|
SetThreadPriorityBoost(GetCurrentThread(), true);
|
||||||
SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN);
|
SetThreadPriority(GetCurrentThread(), THREAD_MODE_BACKGROUND_BEGIN);
|
||||||
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);
|
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);
|
||||||
#else
|
#elif !defined(__APPLE__)
|
||||||
sched_param param;
|
sched_param param;
|
||||||
param.sched_priority = 0;
|
param.sched_priority = 0;
|
||||||
if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) {
|
if (sched_setscheduler(0, SCHED_IDLE, ¶m) != 0) {
|
||||||
|
|
Loading…
Reference in a new issue