From f02b98efe7b95a1ecf8e961d5b5e1836d945b647 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 7 Oct 2017 18:58:04 +0300 Subject: [PATCH] Fix clang warnings and job comparison bug. --- CMakeLists.txt | 2 +- src/api/ApiState.h | 1 - src/net/Job.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37a00912e..e861f26aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,7 +186,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC) elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes -Wall") - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants -Wno-missing-braces") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes -Wall -fno-exceptions -fno-rtti") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants") diff --git a/src/api/ApiState.h b/src/api/ApiState.h index 72a332aad..7ecca36d6 100644 --- a/src/api/ApiState.h +++ b/src/api/ApiState.h @@ -57,7 +57,6 @@ private: double m_highestHashrate; double m_totalHashrate[3]; int m_threads; - mutable char m_buf[4096]; NetworkState m_network; }; diff --git a/src/net/Job.cpp b/src/net/Job.cpp index 7295d943f..c3d33739a 100644 --- a/src/net/Job.cpp +++ b/src/net/Job.cpp @@ -171,5 +171,5 @@ void Job::toHex(const unsigned char* in, unsigned int len, char* out) bool Job::operator==(const Job &other) const { - return m_id == other.m_id && memcmp(m_blob, other.m_blob, sizeof(m_blob) == 0); + return m_id == other.m_id && memcmp(m_blob, other.m_blob, sizeof(m_blob)) == 0; }