diff options
Diffstat (limited to 'CPP/7zip/Compress/LzOutWindow.h')
-rw-r--r--[-rwxr-xr-x] | CPP/7zip/Compress/LzOutWindow.h | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/CPP/7zip/Compress/LzOutWindow.h b/CPP/7zip/Compress/LzOutWindow.h index d8d13c22..507aa7f4 100755..100644 --- a/CPP/7zip/Compress/LzOutWindow.h +++ b/CPP/7zip/Compress/LzOutWindow.h @@ -3,8 +3,6 @@ #ifndef __LZ_OUT_WINDOW_H #define __LZ_OUT_WINDOW_H -#include "../IStream.h" - #include "../Common/OutBuffer.h" #ifndef _NO_EXCEPTIONS @@ -14,7 +12,7 @@ typedef COutBufferException CLzOutWindowException; class CLzOutWindow: public COutBuffer { public: - void Init(bool solid = false); + void Init(bool solid = false) throw(); // distance >= 0, len > 0, bool CopyBlock(UInt32 distance, UInt32 len) @@ -22,34 +20,34 @@ public: UInt32 pos = _pos - distance - 1; if (distance >= _pos) { - if (!_overDict || distance >= _bufferSize) + if (!_overDict || distance >= _bufSize) return false; - pos += _bufferSize; + pos += _bufSize; } - if (_limitPos - _pos > len && _bufferSize - pos > len) + if (_limitPos - _pos > len && _bufSize - pos > len) { - const Byte *src = _buffer + pos; - Byte *dest = _buffer + _pos; + const Byte *src = _buf + pos; + Byte *dest = _buf + _pos; _pos += len; do *dest++ = *src++; - while(--len != 0); + while (--len != 0); } else do { - if (pos == _bufferSize) + if (pos == _bufSize) pos = 0; - _buffer[_pos++] = _buffer[pos++]; + _buf[_pos++] = _buf[pos++]; if (_pos == _limitPos) FlushWithCheck(); } - while(--len != 0); + while (--len != 0); return true; } void PutByte(Byte b) { - _buffer[_pos++] = b; + _buf[_pos++] = b; if (_pos == _limitPos) FlushWithCheck(); } @@ -57,9 +55,9 @@ public: Byte GetByte(UInt32 distance) const { UInt32 pos = _pos - distance - 1; - if (pos >= _bufferSize) - pos += _bufferSize; - return _buffer[pos]; + if (pos >= _bufSize) + pos += _bufSize; + return _buf[pos]; } }; |