]> granicus.if.org Git - icinga2/commitdiff
Fixed compilation warnings on Windows.
authorGunnar Beutner <gunnar@beutner.name>
Mon, 2 Jul 2012 16:40:30 +0000 (18:40 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 2 Jul 2012 16:40:30 +0000 (18:40 +0200)
base/ringbuffer.cpp
base/ringbuffer.h

index 88a0948844edee1bbe7f0380f36a7ecb1b88cad7..1d91f7ff27d7e400f94327e7846e9db40a7c7d13 100644 (file)
@@ -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<int>::size_type offsetTarget = tv % m_Slots.size();
 
        /* walk towards the target offset, resetting slots to 0 */
        while (m_Offset != offsetTarget) {
index 5806c461bd8d2b4d635defb141f9fb71ca5cacde..c4c16bfed46b2dda83a818aab300570e26900a40 100644 (file)
@@ -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<int> m_Slots;
-       int m_Offset;
+       vector<int>::size_type m_Offset;
 };
 
 }