diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2008-08-13 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:56 +0300 |
commit | 173c07e166fdf6fcd20f18ea73008f1b628945df (patch) | |
tree | 13ebea85cdc4c16ae93714ff0627ee9f91ad7e08 /CPP/7zip/Compress/Rar/Rar3Decoder.cpp | |
parent | 3901bf0ab88106a5b031cba7bc18d60cdebf7eef (diff) |
4.59 beta
Diffstat (limited to 'CPP/7zip/Compress/Rar/Rar3Decoder.cpp')
-rwxr-xr-x | CPP/7zip/Compress/Rar/Rar3Decoder.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/CPP/7zip/Compress/Rar/Rar3Decoder.cpp b/CPP/7zip/Compress/Rar/Rar3Decoder.cpp index 5ba13646..c2b18fc9 100755 --- a/CPP/7zip/Compress/Rar/Rar3Decoder.cpp +++ b/CPP/7zip/Compress/Rar/Rar3Decoder.cpp @@ -1,5 +1,5 @@ // Rar3Decoder.cpp -// According to unRAR license, this code may not be used to develop +// According to unRAR license, this code may not be used to develop // a program that creates RAR archives #include "StdAfx.h" @@ -19,7 +19,7 @@ static const UInt32 kSymbolLen2 = kSymbolRep + kNumReps; static const Byte kLenStart[kLenTableSize] = {0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224}; static const Byte kLenDirectBits[kLenTableSize] = {0,0,0,0,0,0,0,0,1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5}; -static const Byte kDistDirectBits[kDistTableSize] = +static const Byte kDistDirectBits[kDistTableSize] = {0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15, 16,16,16,16,16,16,16,16,16,16,16,16,16,16, 18,18,18,18,18,18,18,18,18,18,18,18}; @@ -32,12 +32,12 @@ static const Byte kLen2DistDirectBits[kNumLen2Symbols]={2,2,3, 4, 5, 6, 6, 6}; static const UInt32 kDistLimit3 = 0x2000 - 2; static const UInt32 kDistLimit4 = 0x40000 - 2; -static const UInt32 kNormalMatchMinLen = 3; +static const UInt32 kNormalMatchMinLen = 3; static const UInt32 kVmDataSizeMax = 1 << 16; static const UInt32 kVmCodeSizeMax = 1 << 16; -CDecoder::CDecoder(): +CDecoder::CDecoder(): _window(0), _winPos(0), _wrPtr(0), @@ -382,7 +382,7 @@ HRESULT CDecoder::InitPPM() // SubAlloc.StartSubAllocator(MaxMB+1); // StartModelRare(maxOrder); - if (!_ppm.SubAllocator.StartSubAllocator((maxMB + 1) << 20)) + if (!_ppm.SubAllocator.StartSubAllocator((maxMB + 1) << 20)) return E_OUTOFMEMORY; _ppm.MaxOrder = 0; _ppm.StartModelRare(maxOrder); @@ -667,7 +667,7 @@ HRESULT CDecoder::DecodeLZ(bool &keepDecompressing) return S_FALSE; length = 2 + kLenStart[number] + m_InBitStream.ReadBits(kLenDirectBits[number]); } - else + else { rep3 = rep2; rep2 = rep1; @@ -709,7 +709,7 @@ HRESULT CDecoder::DecodeLZ(bool &keepDecompressing) PrevAlignCount = kNumAlignReps; rep0 += PrevAlignBits; } - else + else return S_FALSE; } } @@ -784,8 +784,8 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress) { - try - { + try + { if (inSize == NULL || outSize == NULL) return E_INVALIDARG; @@ -815,11 +815,11 @@ STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, CCoderReleaser coderReleaser(this); _unpackSize = *outSize; - return CodeReal(progress); + return CodeReal(progress); } catch(const CInBufferException &e) { return e.ErrorCode; } catch(...) { return S_FALSE; } - // CNewException is possible here. But probably CNewException is caused + // CNewException is possible here. But probably CNewException is caused // by error in data stream. } |