minor fixes
This commit is contained in:
@@ -233,7 +233,7 @@ int RageFileObjDeflate::WriteInternal( const void *pBuffer, size_t iBytes )
|
|||||||
if( err != Z_OK )
|
if( err != Z_OK )
|
||||||
FAIL_M( ssprintf("deflate: err %i", err) );
|
FAIL_M( ssprintf("deflate: err %i", err) );
|
||||||
|
|
||||||
if( m_pDeflate->avail_out > 0 )
|
if( m_pDeflate->avail_out < sizeof(buf) )
|
||||||
{
|
{
|
||||||
int iRet = m_pFile->Write( buf, sizeof(buf)-m_pDeflate->avail_out );
|
int iRet = m_pFile->Write( buf, sizeof(buf)-m_pDeflate->avail_out );
|
||||||
if( iRet == -1 )
|
if( iRet == -1 )
|
||||||
@@ -247,6 +247,9 @@ int RageFileObjDeflate::WriteInternal( const void *pBuffer, size_t iBytes )
|
|||||||
return iBytes;
|
return iBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Note that flushing clears compression state, so (unlike most Flush() calls)
|
||||||
|
* calling this *does* change the result of the output if you continue writing
|
||||||
|
* data. */
|
||||||
int RageFileObjDeflate::FlushInternal()
|
int RageFileObjDeflate::FlushInternal()
|
||||||
{
|
{
|
||||||
m_pDeflate->avail_in = 0;
|
m_pDeflate->avail_in = 0;
|
||||||
@@ -272,7 +275,7 @@ int RageFileObjDeflate::FlushInternal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( err == Z_STREAM_END )
|
if( err == Z_STREAM_END )
|
||||||
return 0;
|
return m_pFile->Flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public:
|
|||||||
int GetFileSize() const { return m_pFile->GetFileSize(); }
|
int GetFileSize() const { return m_pFile->GetFileSize(); }
|
||||||
void DeleteFileWhenFinished() { m_bFileOwned = true; }
|
void DeleteFileWhenFinished() { m_bFileOwned = true; }
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
int ReadInternal( void *pBuffer, size_t iBytes ) { SetError( "Not implemented" ); return -1; }
|
int ReadInternal( void *pBuffer, size_t iBytes ) { SetError( "Not implemented" ); return -1; }
|
||||||
int WriteInternal( const void *pBuffer, size_t iBytes );
|
int WriteInternal( const void *pBuffer, size_t iBytes );
|
||||||
int FlushInternal();
|
int FlushInternal();
|
||||||
|
|||||||
Reference in New Issue
Block a user