summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortymyjan <tymyjan@yahoo.co.uk>2016-06-04 23:54:47 +0200
committerMichael Stahl <mstahl@redhat.com>2016-06-27 10:18:49 +0000
commit08fc0da4033b8ea2b3ae67aa06175e839771396b (patch)
treef4d64a97d2cf6052792f83414492de946a859a9b
parentf7c888994db744396c69aa1be720c2089ada5798 (diff)
tdf#75280 Cleaning up of sal_uIntPtr usage #1a
Change-Id: Ief2cc6ab03316c2530d386d662db21ca1c9ddb30 Reviewed-on: https://gerrit.libreoffice.org/25898 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--include/tools/zcodec.hxx23
-rw-r--r--tools/source/zcodec/zcodec.cxx20
2 files changed, 21 insertions, 22 deletions
diff --git a/include/tools/zcodec.hxx b/include/tools/zcodec.hxx
index 023811557d51..7cce2a4fe122 100644
--- a/include/tools/zcodec.hxx
+++ b/include/tools/zcodec.hxx
@@ -40,13 +40,13 @@ class TOOLS_DLLPUBLIC ZCodec
bool mbStatus;
bool mbFinish;
sal_uInt8* mpInBuf;
- sal_uIntPtr mnInBufSize;
- sal_uIntPtr mnInToRead;
+ size_t mnInBufSize;
+ size_t mnInToRead;
SvStream* mpOStm;
sal_uInt8* mpOutBuf;
- sal_uIntPtr mnOutBufSize;
+ size_t mnOutBufSize;
- sal_uIntPtr mnCRC;
+ sal_uInt32 mnCRC;
int mnCompressLevel;
bool mbUpdateCrc;
bool mbGzLib;
@@ -55,7 +55,6 @@ class TOOLS_DLLPUBLIC ZCodec
void InitCompress();
void InitDecompress(SvStream & inStream);
void ImplWriteBack();
-
void UpdateCRC( sal_uInt8* pSource, long nDatSize );
public:
@@ -69,14 +68,14 @@ public:
long Decompress( SvStream& rIStm, SvStream& rOStm );
bool AttemptDecompression( SvStream& rIStm, SvStream& rOStm );
- void Write( SvStream& rOStm, const sal_uInt8* pData, sal_uIntPtr nSize );
- long Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize );
- long ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize );
+ void Write( SvStream& rOStm, const sal_uInt8* pData, sal_uInt32 nSize );
+ long Read( SvStream& rIStm, sal_uInt8* pData, sal_uInt32 nSize );
+ long ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uInt32 nSize );
- void SetBreak( sal_uIntPtr );
- sal_uIntPtr GetBreak();
- void SetCRC( sal_uIntPtr nCurrentCRC );
- sal_uIntPtr GetCRC() { return mnCRC;}
+ void SetBreak( size_t );
+ size_t GetBreak();
+ void SetCRC( sal_uInt32 nCurrentCRC );
+ sal_uInt32 GetCRC() { return mnCRC;}
};
#endif
diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx
index e841888a54b7..839ef4cf35f8 100644
--- a/tools/source/zcodec/zcodec.cxx
+++ b/tools/source/zcodec/zcodec.cxx
@@ -134,7 +134,7 @@ void ZCodec::Compress( SvStream& rIStm, SvStream& rOStm )
long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
{
int err;
- sal_uIntPtr nInToRead;
+ size_t nInToRead;
long nOldTotal_Out = PZSTREAM->total_out;
assert(meState == STATE_INIT);
@@ -169,7 +169,7 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
return ( mbStatus ) ? (long)(PZSTREAM->total_out - nOldTotal_Out) : -1;
}
-void ZCodec::Write( SvStream& rOStm, const sal_uInt8* pData, sal_uIntPtr nSize )
+void ZCodec::Write( SvStream& rOStm, const sal_uInt8* pData, sal_uInt32 nSize )
{
if (meState == STATE_INIT)
{
@@ -194,10 +194,10 @@ void ZCodec::Write( SvStream& rOStm, const sal_uInt8* pData, sal_uIntPtr nSize )
}
}
-long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize )
+long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uInt32 nSize )
{
int err;
- sal_uIntPtr nInToRead;
+ size_t nInToRead;
if ( mbFinish )
return 0; // PZSTREAM->total_out;
@@ -238,10 +238,10 @@ long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize )
return (mbStatus ? (long)(nSize - PZSTREAM->avail_out) : -1);
}
-long ZCodec::ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize )
+long ZCodec::ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uInt32 nSize )
{
int err = 0;
- sal_uIntPtr nInToRead;
+ size_t nInToRead;
if ( mbFinish )
return 0; // PZSTREAM->total_out;
@@ -258,7 +258,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize
{
nInToRead = (mnInBufSize > mnInToRead) ? mnInToRead : mnInBufSize;
- sal_uInt64 const nRemaining = rIStm.remainingSize();
+ sal_uInt32 const nRemaining = rIStm.remainingSize();
if (nRemaining < nInToRead)
{
rIStm.SetError( ERRCODE_IO_PENDING );
@@ -305,17 +305,17 @@ void ZCodec::ImplWriteBack()
}
}
-void ZCodec::SetBreak( sal_uIntPtr nInToRead )
+void ZCodec::SetBreak( size_t nInToRead )
{
mnInToRead = nInToRead;
}
-sal_uIntPtr ZCodec::GetBreak()
+size_t ZCodec::GetBreak()
{
return ( mnInToRead + PZSTREAM->avail_in );
}
-void ZCodec::SetCRC( sal_uIntPtr nCRC )
+void ZCodec::SetCRC( sal_uInt32 nCRC )
{
mnCRC = nCRC;
}