mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-14 10:11:38 -06:00
9.34
This commit is contained in:
committed by
Kornel Lesiński
parent
83f8ddcc5b
commit
f08f4dcc3c
30
CPP/7zip/Compress/LzOutWindow.h
Executable file → Normal file
30
CPP/7zip/Compress/LzOutWindow.h
Executable file → Normal file
@@ -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];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user