From 6d121122f85e5e797424a65df5f39edfba7ff178 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Tue, 24 May 2022 15:18:09 +0200 Subject: [PATCH] Fixed compiler warnings in tests --- src/log.h | 16 ++++++++-------- tests/src/hash_tests.cpp | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/log.h b/src/log.h index 944b986..a0802e6 100644 --- a/src/log.h +++ b/src/log.h @@ -470,14 +470,6 @@ namespace { #define CONCAT(a, b) CONCAT2(a, b) #define CONCAT2(a, b) a##b -#ifdef P2POOL_LOG_DISABLE - -#define LOGINFO(level, ...) -#define LOGWARN(level, ...) -#define LOGERR(level, ...) - -#else - // This is to check that LOG() call doesn't modify variables in scope, making program behavior dependent on the log level: // // int some_func(int& n) { return ++n; } @@ -508,6 +500,14 @@ struct DummyStream } \ } while (0) +#ifdef P2POOL_LOG_DISABLE + +#define LOGINFO(level, ...) SIDE_EFFECT_CHECK(level, __VA_ARGS__) +#define LOGWARN(level, ...) SIDE_EFFECT_CHECK(level, __VA_ARGS__) +#define LOGERR(level, ...) SIDE_EFFECT_CHECK(level, __VA_ARGS__) + +#else + #define LOG(level, severity, ...) \ do { \ SIDE_EFFECT_CHECK(level, __VA_ARGS__); \ diff --git a/tests/src/hash_tests.cpp b/tests/src/hash_tests.cpp index 50fd83f..1d8a845 100644 --- a/tests/src/hash_tests.cpp +++ b/tests/src/hash_tests.cpp @@ -55,7 +55,7 @@ TEST(hash, empty) hash h; ASSERT_EQ(h.empty(), true); - for (int i = 0; i < HASH_SIZE; ++i) { + for (size_t i = 0; i < HASH_SIZE; ++i) { hash h2; h2.h[i] = 1; ASSERT_EQ(h2.empty(), false);