From 4aa166ba297a6c115b5c93a7238db6c1a494e89a Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 2 Jul 2012 18:40:30 +0200 Subject: [PATCH] Fixed compilation warnings on Windows. --- base/ringbuffer.cpp | 4 ++-- base/ringbuffer.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/base/ringbuffer.cpp b/base/ringbuffer.cpp index 88a094884..1d91f7ff2 100644 --- a/base/ringbuffer.cpp +++ b/base/ringbuffer.cpp @@ -2,7 +2,7 @@ using namespace icinga; -Ringbuffer::Ringbuffer(int slots) +Ringbuffer::Ringbuffer(long slots) : m_Slots(slots, 0), m_Offset(0) { } @@ -13,7 +13,7 @@ int Ringbuffer::GetLength(void) const void Ringbuffer::InsertValue(long tv, int num) { - int offsetTarget = tv % m_Slots.size(); + vector::size_type offsetTarget = tv % m_Slots.size(); /* walk towards the target offset, resetting slots to 0 */ while (m_Offset != offsetTarget) { diff --git a/base/ringbuffer.h b/base/ringbuffer.h index 5806c461b..c4c16bfed 100644 --- a/base/ringbuffer.h +++ b/base/ringbuffer.h @@ -7,7 +7,7 @@ namespace icinga class I2_BASE_API Ringbuffer { public: - Ringbuffer(int slots); + Ringbuffer(long slots); int GetLength(void) const; void InsertValue(long tv, int num); @@ -15,7 +15,7 @@ public: private: vector m_Slots; - int m_Offset; + vector::size_type m_Offset; }; }