From c543985cf4a060c4c038b303c3c8bcc6db13657c Mon Sep 17 00:00:00 2001 From: Luiz Siqueira Date: Tue, 14 Aug 2018 09:21:52 -0300 Subject: [PATCH] use size_t instead of int for overrun counter --- include/spdlog/details/circular_q.h | 4 ++-- include/spdlog/details/mpmc_blocking_q.h | 2 +- include/spdlog/details/thread_pool.h | 2 +- tests/test_async.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/spdlog/details/circular_q.h b/include/spdlog/details/circular_q.h index cea12174..b78af247 100644 --- a/include/spdlog/details/circular_q.h +++ b/include/spdlog/details/circular_q.h @@ -54,7 +54,7 @@ public: return ((tail_ + 1) % max_items_) == head_; } - int overrun_counter() const + size_t overrun_counter() const { return overrun_counter_; } @@ -66,7 +66,7 @@ private: std::vector v_; - int overrun_counter_ = 0; + size_t overrun_counter_ = 0; }; } // namespace details } // namespace spdlog diff --git a/include/spdlog/details/mpmc_blocking_q.h b/include/spdlog/details/mpmc_blocking_q.h index 3aa9fa1b..9a922e04 100644 --- a/include/spdlog/details/mpmc_blocking_q.h +++ b/include/spdlog/details/mpmc_blocking_q.h @@ -30,7 +30,7 @@ public: { } - int overrun_counter() const + size_t overrun_counter() const { return q_.overrun_counter(); } diff --git a/include/spdlog/details/thread_pool.h b/include/spdlog/details/thread_pool.h index fd47eed2..aab089f4 100644 --- a/include/spdlog/details/thread_pool.h +++ b/include/spdlog/details/thread_pool.h @@ -157,7 +157,7 @@ public: post_async_msg_(async_msg(std::move(worker_ptr), async_msg_type::flush), overflow_policy); } - int overrun_counter() const + size_t overrun_counter() const { return q_.overrun_counter(); } diff --git a/tests/test_async.cpp b/tests/test_async.cpp index 91be8bd9..6f86cf6c 100644 --- a/tests/test_async.cpp +++ b/tests/test_async.cpp @@ -7,7 +7,7 @@ TEST_CASE("basic async test ", "[async]") { using namespace spdlog; auto test_sink = std::make_shared(); - int overrun_counter = 0; + size_t overrun_counter = 0; size_t queue_size = 128; size_t messages = 256; {