summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/CPP/7zip/Common/OffsetStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/lzma/CPP/7zip/Common/OffsetStream.cpp')
-rw-r--r--3rdparty/lzma/CPP/7zip/Common/OffsetStream.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/3rdparty/lzma/CPP/7zip/Common/OffsetStream.cpp b/3rdparty/lzma/CPP/7zip/Common/OffsetStream.cpp
index 368d39b6514..a6b005e4ff6 100644
--- a/3rdparty/lzma/CPP/7zip/Common/OffsetStream.cpp
+++ b/3rdparty/lzma/CPP/7zip/Common/OffsetStream.cpp
@@ -2,38 +2,36 @@
#include "StdAfx.h"
-#include "../../Common/Defs.h"
-
#include "OffsetStream.h"
HRESULT COffsetOutStream::Init(IOutStream *stream, UInt64 offset)
{
_offset = offset;
_stream = stream;
- return _stream->Seek(offset, STREAM_SEEK_SET, NULL);
+ return _stream->Seek((Int64)offset, STREAM_SEEK_SET, NULL);
}
-STDMETHODIMP COffsetOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+Z7_COM7F_IMF(COffsetOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize))
{
return _stream->Write(data, size, processedSize);
}
-STDMETHODIMP COffsetOutStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+Z7_COM7F_IMF(COffsetOutStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition))
{
- UInt64 absoluteNewPosition;
if (seekOrigin == STREAM_SEEK_SET)
{
if (offset < 0)
return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
offset += _offset;
}
- HRESULT result = _stream->Seek(offset, seekOrigin, &absoluteNewPosition);
+ UInt64 absoluteNewPosition = 0; // =0 for gcc-10
+ const HRESULT result = _stream->Seek(offset, seekOrigin, &absoluteNewPosition);
if (newPosition)
*newPosition = absoluteNewPosition - _offset;
return result;
}
-STDMETHODIMP COffsetOutStream::SetSize(UInt64 newSize)
+Z7_COM7F_IMF(COffsetOutStream::SetSize(UInt64 newSize))
{
return _stream->SetSize(_offset + newSize);
}