mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-15 02:11:43 -06:00
4.25 beta
This commit is contained in:
committed by
Kornel Lesiński
parent
47f4915611
commit
af1fe52701
@@ -5,6 +5,7 @@
|
||||
#ifndef _WIN32
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#endif
|
||||
|
||||
#include "FileStreams.h"
|
||||
|
||||
@@ -59,9 +59,9 @@ public:
|
||||
if(_pos >= _bufferSize)
|
||||
WriteBlock();
|
||||
}
|
||||
void WriteBytes(const void *data, UInt32 size)
|
||||
void WriteBytes(const void *data, size_t size)
|
||||
{
|
||||
for (UInt32 i = 0; i < size; i++)
|
||||
for (size_t i = 0; i < size; i++)
|
||||
WriteByte(((const Byte *)data)[i]);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,5 +4,6 @@
|
||||
#define __STDAFX_H
|
||||
|
||||
#include "../../Common/MyWindows.h"
|
||||
#include "../../Common/NewHandler.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -88,7 +88,7 @@ STDMETHODIMP CSequentialOutStreamImp2::Write(const void *data, UInt32 size, UInt
|
||||
{
|
||||
UInt32 newSize = size;
|
||||
if (_pos + size > _size)
|
||||
newSize = _size - _pos;
|
||||
newSize = (UInt32)(_size - _pos);
|
||||
memmove(_buffer + _pos, data, newSize);
|
||||
if(processedSize != NULL)
|
||||
*processedSize = newSize;
|
||||
@@ -148,9 +148,9 @@ STDMETHODIMP CSequentialInStreamRollback::ReadPart(void *data, UInt32 size, UInt
|
||||
{
|
||||
if (_currentPos != _currentSize)
|
||||
{
|
||||
UInt32 curSize = _currentSize - _currentPos;
|
||||
size_t curSize = _currentSize - _currentPos;
|
||||
if (size > curSize)
|
||||
size = curSize;
|
||||
size = (UInt32)curSize;
|
||||
memmove(data, _buffer + _currentPos, size);
|
||||
_currentPos += size;
|
||||
if (processedSize != 0)
|
||||
@@ -159,7 +159,7 @@ STDMETHODIMP CSequentialInStreamRollback::ReadPart(void *data, UInt32 size, UInt
|
||||
}
|
||||
UInt32 realProcessedSize;
|
||||
if (size > _bufferSize)
|
||||
size = _bufferSize;
|
||||
size = (UInt32)_bufferSize;
|
||||
HRESULT result = _stream->ReadPart(_buffer, size, &realProcessedSize);
|
||||
memmove(data, _buffer, realProcessedSize);
|
||||
_size += realProcessedSize;
|
||||
|
||||
Reference in New Issue
Block a user