diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-07-31 20:22:08 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-07-31 23:27:25 +0200 |
commit | 93e90309b36faa384eeebfaa6d685073c26a1975 (patch) | |
tree | 33bdb9b541e89aae4c10c5685feeefca809f59c5 /package/source/zipapi | |
parent | 748e3efcfe4c7298545ab8230118f90b1b9f30a7 (diff) |
Use ZLIB_CONST to avoid const_cast
It is available since 2011 [1]. CentOS 7, which is the baseline,
included zlib 1.2.7, which was released in 2012, and included [1].
[1] https://github.com/madler/zlib/commit/5ab9f47745fe9353291b217f705086b6070575d5,
Change-Id: Ie6cf2e934579620787426d95380f8ff6d6423b7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119627
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'package/source/zipapi')
-rw-r--r-- | package/source/zipapi/Deflater.cxx | 2 | ||||
-rw-r--r-- | package/source/zipapi/Inflater.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/package/source/zipapi/Deflater.cxx b/package/source/zipapi/Deflater.cxx index ac0ae57cc6a1..5c0fd70121fe 100644 --- a/package/source/zipapi/Deflater.cxx +++ b/package/source/zipapi/Deflater.cxx @@ -69,7 +69,7 @@ Deflater::Deflater(sal_Int32 nSetLevel, bool bNowrap) sal_Int32 Deflater::doDeflateBytes (uno::Sequence < sal_Int8 > &rBuffer, sal_Int32 nNewOffset, sal_Int32 nNewLength) { sal_Int32 nResult; - pStream->next_in = const_cast<unsigned char*>(reinterpret_cast<const unsigned char*>( sInBuffer.getConstArray() + nOffset )); + pStream->next_in = reinterpret_cast<const unsigned char*>( sInBuffer.getConstArray() + nOffset ); pStream->next_out = reinterpret_cast<unsigned char*>(rBuffer.getArray())+nNewOffset; pStream->avail_in = nLength; pStream->avail_out = nNewLength; diff --git a/package/source/zipapi/Inflater.cxx b/package/source/zipapi/Inflater.cxx index 7f8319038512..d03fed8c0968 100644 --- a/package/source/zipapi/Inflater.cxx +++ b/package/source/zipapi/Inflater.cxx @@ -98,7 +98,7 @@ sal_Int32 Inflater::doInflateBytes (Sequence < sal_Int8 > &rBuffer, sal_Int32 n nLastInflateError = 0; - pStream->next_in = const_cast<unsigned char*>(reinterpret_cast<const unsigned char*>( sInBuffer.getConstArray() + nOffset )); + pStream->next_in = reinterpret_cast<const unsigned char*>( sInBuffer.getConstArray() + nOffset ); pStream->avail_in = nLength; pStream->next_out = reinterpret_cast < unsigned char* > ( rBuffer.getArray() + nNewOffset ); pStream->avail_out = nNewLength; |