diff options
Diffstat (limited to 'CPP/7zip/Compress/Lzx')
-rwxr-xr-x | CPP/7zip/Compress/Lzx/LzxDecoder.cpp | 12 | ||||
-rwxr-xr-x | CPP/7zip/Compress/Lzx/LzxDecoder.h | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/CPP/7zip/Compress/Lzx/LzxDecoder.cpp b/CPP/7zip/Compress/Lzx/LzxDecoder.cpp index 5ed05b53..94ce6fc9 100755 --- a/CPP/7zip/Compress/Lzx/LzxDecoder.cpp +++ b/CPP/7zip/Compress/Lzx/LzxDecoder.cpp @@ -38,7 +38,7 @@ STDMETHODIMP CDecoder::Flush() return m_x86ConvertOutStreamSpec->Flush(); } -UInt32 CDecoder::ReadBits(UInt32 numBits) { return m_InBitStream.ReadBits(numBits); } +UInt32 CDecoder::ReadBits(int numBits) { return m_InBitStream.ReadBits(numBits); } #define RIF(x) { if (!(x)) return false; } @@ -63,12 +63,12 @@ bool CDecoder::ReadTable(Byte *lastLevels, Byte *newLevels, UInt32 numSymbols) UInt32 number = m_LevelDecoder.DecodeSymbol(&m_InBitStream); if (number == kLevelSymbolZeros) { - num = kLevelSymbolZerosStartValue + ReadBits(kLevelSymbolZerosNumBits); + num = kLevelSymbolZerosStartValue + (int)ReadBits(kLevelSymbolZerosNumBits); symbol = 0; } else if (number == kLevelSymbolZerosBig) { - num = kLevelSymbolZerosBigStartValue + ReadBits(kLevelSymbolZerosBigNumBits); + num = kLevelSymbolZerosBigStartValue + (int)ReadBits(kLevelSymbolZerosBigNumBits); symbol = 0; } else if (number == kLevelSymbolSame || number <= kNumHuffmanBits) @@ -77,7 +77,7 @@ bool CDecoder::ReadTable(Byte *lastLevels, Byte *newLevels, UInt32 numSymbols) num = 1; else { - num = kLevelSymbolSameStartValue + ReadBits(kLevelSymbolSameNumBits); + num = kLevelSymbolSameStartValue + (int)ReadBits(kLevelSymbolSameNumBits); number = m_LevelDecoder.DecodeSymbol(&m_InBitStream); if (number > kNumHuffmanBits) return false; @@ -262,7 +262,7 @@ HRESULT CDecoder::CodeSpec(UInt32 curSize) int numDirectBits; if (posSlot < kNumPowerPosSlots) { - numDirectBits = (posSlot >> 1) - 1; + numDirectBits = (int)(posSlot >> 1) - 1; distance = ((2 | (posSlot & 1)) << numDirectBits); } else @@ -297,7 +297,7 @@ HRESULT CDecoder::CodeSpec(UInt32 curSize) next -= locLen; if (len != 0) { - _remainLen = len; + _remainLen = (int)len; return S_OK; } } diff --git a/CPP/7zip/Compress/Lzx/LzxDecoder.h b/CPP/7zip/Compress/Lzx/LzxDecoder.h index 777067e0..4a577d38 100755 --- a/CPP/7zip/Compress/Lzx/LzxDecoder.h +++ b/CPP/7zip/Compress/Lzx/LzxDecoder.h @@ -63,7 +63,7 @@ public: void MovePos(UInt32 numBits) { - m_BitPos += numBits; + m_BitPos += (int)numBits; Normalize(); } @@ -76,8 +76,8 @@ public: UInt32 ReadBitsBig(int numBits) { - UInt32 numBits0 = numBits / 2; - UInt32 numBits1 = numBits - numBits0; + int numBits0 = numBits / 2; + int numBits1 = numBits - numBits0; UInt32 res = ReadBits(numBits0) << numBits1; return res + ReadBits(numBits1); } @@ -128,7 +128,7 @@ class CDecoder : bool _wimMode; - UInt32 ReadBits(UInt32 numBits); + UInt32 ReadBits(int numBits); bool ReadTable(Byte *lastLevels, Byte *newLevels, UInt32 numSymbols); bool ReadTables(); void ClearPrevLevels(); |