From e8ed852d143f5e18172a060b86af822585464c9a Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Thu, 26 Dec 2013 23:26:56 +0200 Subject: [PATCH] Fix signed(enum)/unsigned(u32) warnings that leak into code bases using kNet. --- include/kNet/VLEPacker.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/kNet/VLEPacker.h b/include/kNet/VLEPacker.h index 706ee05..8fefc62 100644 --- a/include/kNet/VLEPacker.h +++ b/include/kNet/VLEPacker.h @@ -34,8 +34,8 @@ class VLEType2 // For compatibility when inter-using with VLEType3 static const int numBits3 = 0; - static const u32 maxValue1 = LSBT::val; - static const u32 maxValue2 = LSBT::val; + static const u32 maxValue1 = static_cast(LSBT::val); + static const u32 maxValue2 = static_cast(LSBT::val); static const u32 maxValue = maxValue2; @@ -44,8 +44,8 @@ class VLEType2 static const u32 maxBits = bitsValue2; - static const u32 bitMask1 = BitMaskT<0, numBits1>::val; - static const u32 bitMask2 = BitMaskT::val;// == ((1 << numBits2) - 1) << bitsValue1; + static const u32 bitMask1 = static_cast(BitMaskT<0, numBits1>::val); + static const u32 bitMask2 = static_cast(BitMaskT::val);// == ((1 << numBits2) - 1) << bitsValue1; static int GetEncodedBitLength(u32 value) { @@ -96,9 +96,9 @@ class VLEType3 static const int numBits2 = bits2; static const int numBits3 = bits3; - static const u32 maxValue1 = LSBT::val; - static const u32 maxValue2 = LSBT::val; - static const u32 maxValue3 = LSBT::val; + static const u32 maxValue1 = static_cast(LSBT::val); + static const u32 maxValue2 = static_cast(LSBT::val); + static const u32 maxValue3 = static_cast(LSBT::val); static const u32 maxValue = maxValue3; @@ -108,9 +108,9 @@ class VLEType3 static const u32 maxBits = bitsValue3; - static const u32 bitMask1 = BitMaskT<0, numBits1>::val; - static const u32 bitMask2 = BitMaskT::val; // == ((1 << numBits2) - 1) << bitsValue1; - static const u32 bitMask3 = BitMaskT::val; // == ((1 << numBits3) - 1) << bitsValue2; + static const u32 bitMask1 = static_cast(BitMaskT<0, numBits1>::val); + static const u32 bitMask2 = static_cast(BitMaskT::val); // == ((1 << numBits2) - 1) << bitsValue1; + static const u32 bitMask3 = static_cast(BitMaskT::val); // == ((1 << numBits3) - 1) << bitsValue2; static int GetEncodedBitLength(u32 value) {