From 147bdbf591cec0b789667c6236bec44e736cff43 Mon Sep 17 00:00:00 2001 From: knowledge4igor Date: Wed, 25 Oct 2017 00:40:42 +0300 Subject: [PATCH] Fix warnings which are caused by C style cast --- include/spdlog/details/mpmc_bounded_q.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/spdlog/details/mpmc_bounded_q.h b/include/spdlog/details/mpmc_bounded_q.h index afd4c881..d8a9188e 100644 --- a/include/spdlog/details/mpmc_bounded_q.h +++ b/include/spdlog/details/mpmc_bounded_q.h @@ -88,7 +88,7 @@ public: { cell = &buffer_[pos & buffer_mask_]; size_t seq = cell->sequence_.load(std::memory_order_acquire); - intptr_t dif = (intptr_t)seq - (intptr_t)pos; + intptr_t dif = static_cast(seq) - static_cast(pos); if (dif == 0) { if (enqueue_pos_.compare_exchange_weak(pos, pos + 1, std::memory_order_relaxed)) @@ -117,7 +117,7 @@ public: cell = &buffer_[pos & buffer_mask_]; size_t seq = cell->sequence_.load(std::memory_order_acquire); - intptr_t dif = (intptr_t)seq - (intptr_t)(pos + 1); + intptr_t dif = static_cast(seq) - static_cast(pos + 1); if (dif == 0) { if (dequeue_pos_.compare_exchange_weak(pos, pos + 1, std::memory_order_relaxed))