PhysicsFS 2.0.3 imported.
This commit is contained in:
parent
bcc0937726
commit
993311d151
459 changed files with 87785 additions and 0 deletions
24
lib/physfs-2.0.3/lzma/CPP/7zip/Common/LimitedStreams.cpp
Normal file
24
lib/physfs-2.0.3/lzma/CPP/7zip/Common/LimitedStreams.cpp
Normal file
|
@ -0,0 +1,24 @@
|
|||
// LimitedStreams.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "LimitedStreams.h"
|
||||
#include "../../Common/Defs.h"
|
||||
|
||||
STDMETHODIMP CLimitedSequentialInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
|
||||
{
|
||||
UInt32 realProcessedSize = 0;
|
||||
UInt32 sizeToRead = (UInt32)MyMin((_size - _pos), (UInt64)size);
|
||||
HRESULT result = S_OK;
|
||||
if (sizeToRead > 0)
|
||||
{
|
||||
result = _stream->Read(data, sizeToRead, &realProcessedSize);
|
||||
_pos += realProcessedSize;
|
||||
if (realProcessedSize == 0)
|
||||
_wasFinished = true;
|
||||
}
|
||||
if(processedSize != NULL)
|
||||
*processedSize = realProcessedSize;
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue