diff options
-rw-r--r-- | include/tools/zcodec.hxx | 3 | ||||
-rw-r--r-- | tools/source/zcodec/zcodec.cxx | 12 |
2 files changed, 8 insertions, 7 deletions
diff --git a/include/tools/zcodec.hxx b/include/tools/zcodec.hxx index 97f3ad09cbe6..5dc67239cb1b 100644 --- a/include/tools/zcodec.hxx +++ b/include/tools/zcodec.hxx @@ -50,6 +50,8 @@ private: void ImplInitBuf( bool nIOFlag ); void ImplWriteBack(); + void UpdateCRC( sal_uInt8* pSource, long nDatSize ); + public: ZCodec( sal_uIntPtr nInBuf = 0x8000UL, sal_uIntPtr nOutBuf = 0x8000UL ); ~ZCodec(); @@ -67,7 +69,6 @@ public: void SetBreak( sal_uIntPtr ); sal_uIntPtr GetBreak(); void SetCRC( sal_uIntPtr nCurrentCRC ); - sal_uIntPtr UpdateCRC( sal_uIntPtr nLatestCRC, sal_uInt8* pSource, long nDatSize ); sal_uIntPtr GetCRC(); }; diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index a672e7669a1a..23abb0b0880d 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -159,7 +159,7 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm ) mnInToRead -= nInToRead; if ( mbUpdateCrc ) - mnCRC = UpdateCRC( mnCRC, mpInBuf, nInToRead ); + UpdateCRC( mpInBuf, nInToRead ); } err = inflate( PZSTREAM, Z_NO_FLUSH ); @@ -228,7 +228,7 @@ long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize ) mnInToRead -= nInToRead; if ( mbUpdateCrc ) - mnCRC = UpdateCRC( mnCRC, mpInBuf, nInToRead ); + UpdateCRC( mpInBuf, nInToRead ); } err = inflate( PZSTREAM, Z_NO_FLUSH ); @@ -282,7 +282,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize mnInToRead -= nInToRead; if ( mbUpdateCrc ) - mnCRC = UpdateCRC( mnCRC, mpInBuf, nInToRead ); + UpdateCRC( mpInBuf, nInToRead ); } err = inflate( PZSTREAM, Z_NO_FLUSH ); @@ -309,7 +309,7 @@ void ZCodec::ImplWriteBack() if ( nAvail ) { if ( mbInit & 2 && mbUpdateCrc ) - mnCRC = UpdateCRC( mnCRC, mpOutBuf, nAvail ); + UpdateCRC( mpOutBuf, nAvail ); mpOStm->Write( PZSTREAM->next_out = mpOutBuf, nAvail ); PZSTREAM->avail_out = mnOutBufSize; } @@ -408,9 +408,9 @@ void ZCodec::ImplInitBuf ( bool nIOFlag ) } } -sal_uIntPtr ZCodec::UpdateCRC ( sal_uIntPtr nLatestCRC, sal_uInt8* pSource, long nDatSize) +void ZCodec::UpdateCRC ( sal_uInt8* pSource, long nDatSize) { - return rtl_crc32( nLatestCRC, pSource, nDatSize ); + mnCRC = rtl_crc32( mnCRC, pSource, nDatSize ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |