From f08f4dcc3c02464c17753b3feafcfe5243b9e236 Mon Sep 17 00:00:00 2001 From: Igor Pavlov Date: Sun, 23 Nov 2014 00:00:00 +0000 Subject: 9.34 --- CPP/Common/MyMap.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) mode change 100755 => 100644 CPP/Common/MyMap.cpp (limited to 'CPP/Common/MyMap.cpp') diff --git a/CPP/Common/MyMap.cpp b/CPP/Common/MyMap.cpp old mode 100755 new mode 100644 index 0ee11e8c..db95169e --- a/CPP/Common/MyMap.cpp +++ b/CPP/Common/MyMap.cpp @@ -6,7 +6,7 @@ static const unsigned kNumBitsMax = sizeof(UInt32) * 8; -static UInt32 GetSubBits(UInt32 value, unsigned startPos, unsigned numBits) +static UInt32 GetSubBits(UInt32 value, unsigned startPos, unsigned numBits) throw() { if (startPos == sizeof(value) * 8) return 0; @@ -33,7 +33,7 @@ bool CMap32::Find(UInt32 key, UInt32 &valueRes) const } } - int cur = 0; + unsigned cur = 0; unsigned bitPos = kNumBitsMax; for (;;) { @@ -47,7 +47,7 @@ bool CMap32::Find(UInt32 key, UInt32 &valueRes) const valueRes = n.Values[bit]; return (key == n.Keys[bit]); } - cur = (int)n.Keys[bit]; + cur = (unsigned)n.Keys[bit]; } } @@ -74,7 +74,7 @@ bool CMap32::Set(UInt32 key, UInt32 value) return true; } unsigned i = kNumBitsMax - 1; - for (;GetSubBit(key, i) == GetSubBit(n.Key, i); i--); + for (; GetSubBit(key, i) == GetSubBit(n.Key, i); i--); n.Len = (UInt16)(kNumBitsMax - (1 + i)); unsigned newBit = GetSubBit(key, i); n.Values[newBit] = value; @@ -83,7 +83,7 @@ bool CMap32::Set(UInt32 key, UInt32 value) } } - int cur = 0; + unsigned cur = 0; unsigned bitPos = kNumBitsMax; for (;;) { @@ -117,7 +117,7 @@ bool CMap32::Set(UInt32 key, UInt32 value) return true; } unsigned i = bitPos - 1; - for (;GetSubBit(key, i) == GetSubBit(n.Keys[bit], i); i--); + for (; GetSubBit(key, i) == GetSubBit(n.Keys[bit], i); i--); CNode e2; @@ -135,6 +135,6 @@ bool CMap32::Set(UInt32 key, UInt32 value) Nodes.Add(e2); return false; } - cur = (int)n.Keys[bit]; + cur = (unsigned)n.Keys[bit]; } } -- cgit v1.2.3