Skip to content

Commit

Permalink
Merge pull request #15 from Stinkfist0/master
Browse files Browse the repository at this point in the history
Fix signed(enum)/unsigned(u32) conversion warnings on MSVC that leak into code bases using kNet
  • Loading branch information
juj committed Dec 26, 2013
2 parents 02d5b56 + e8ed852 commit 074dbfd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions include/kNet/VLEPacker.h
Expand Up @@ -34,8 +34,8 @@ class VLEType2
// For compatibility when inter-using with VLEType3
static const int numBits3 = 0;

static const u32 maxValue1 = LSBT<numBits1>::val;
static const u32 maxValue2 = LSBT<numBits1+numBits2>::val;
static const u32 maxValue1 = static_cast<u32>(LSBT<numBits1>::val);
static const u32 maxValue2 = static_cast<u32>(LSBT<numBits1+numBits2>::val);

static const u32 maxValue = maxValue2;

Expand All @@ -44,8 +44,8 @@ class VLEType2

static const u32 maxBits = bitsValue2;

static const u32 bitMask1 = BitMaskT<0, numBits1>::val;
static const u32 bitMask2 = BitMaskT<bitsValue1, numBits2>::val;// == ((1 << numBits2) - 1) << bitsValue1;
static const u32 bitMask1 = static_cast<u32>(BitMaskT<0, numBits1>::val);
static const u32 bitMask2 = static_cast<u32>(BitMaskT<bitsValue1, numBits2>::val);// == ((1 << numBits2) - 1) << bitsValue1;

static int GetEncodedBitLength(u32 value)
{
Expand Down Expand Up @@ -96,9 +96,9 @@ class VLEType3
static const int numBits2 = bits2;
static const int numBits3 = bits3;

static const u32 maxValue1 = LSBT<numBits1>::val;
static const u32 maxValue2 = LSBT<numBits1+numBits2>::val;
static const u32 maxValue3 = LSBT<numBits1+numBits2+numBits3>::val;
static const u32 maxValue1 = static_cast<u32>(LSBT<numBits1>::val);
static const u32 maxValue2 = static_cast<u32>(LSBT<numBits1+numBits2>::val);
static const u32 maxValue3 = static_cast<u32>(LSBT<numBits1+numBits2+numBits3>::val);

static const u32 maxValue = maxValue3;

Expand All @@ -108,9 +108,9 @@ class VLEType3

static const u32 maxBits = bitsValue3;

static const u32 bitMask1 = BitMaskT<0, numBits1>::val;
static const u32 bitMask2 = BitMaskT<bitsValue1, numBits2>::val; // == ((1 << numBits2) - 1) << bitsValue1;
static const u32 bitMask3 = BitMaskT<bitsValue2, numBits3>::val; // == ((1 << numBits3) - 1) << bitsValue2;
static const u32 bitMask1 = static_cast<u32>(BitMaskT<0, numBits1>::val);
static const u32 bitMask2 = static_cast<u32>(BitMaskT<bitsValue1, numBits2>::val); // == ((1 << numBits2) - 1) << bitsValue1;
static const u32 bitMask3 = static_cast<u32>(BitMaskT<bitsValue2, numBits3>::val); // == ((1 << numBits3) - 1) << bitsValue2;

static int GetEncodedBitLength(u32 value)
{
Expand Down

0 comments on commit 074dbfd

Please sign in to comment.