diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2012-07-28 22:01:59 +0200 |
---|---|---|
committer | Arnaud Versini <arnaud.versini@gmail.com> | 2012-07-29 15:01:55 +0200 |
commit | 4be123fed2b8d7e10bb98cd753e3b5cbc1d7293a (patch) | |
tree | bef4471311bb3b1c3a6b5594fe1a08bb9f8ac091 /package/source/zipapi | |
parent | e2b7dc3fcd8cc926d54ddcca0d268fbd3b123a7f (diff) |
Use memcpy & memcmp insteadof rtl_copyMemory & rtl_compareMemory in package
Change-Id: Ia24406ff31949e00725db74bbe5b016894a22f50
Diffstat (limited to 'package/source/zipapi')
-rw-r--r-- | package/source/zipapi/XUnbufferedStream.cxx | 4 | ||||
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 18 |
2 files changed, 11 insertions, 11 deletions
diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx index 961cfff17dc9..7ef9b09e505e 100644 --- a/package/source/zipapi/XUnbufferedStream.cxx +++ b/package/source/zipapi/XUnbufferedStream.cxx @@ -182,7 +182,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa { sal_Int16 nHeadRead = static_cast< sal_Int16 >(( nRequestedBytes > mnHeaderToRead ? mnHeaderToRead : nRequestedBytes )); - rtl_copyMemory ( aData.getArray(), maHeader.getConstArray() + maHeader.getLength() - mnHeaderToRead, nHeadRead ); + memcpy ( aData.getArray(), maHeader.getConstArray() + maHeader.getLength() - mnHeaderToRead, nHeadRead ); mnHeaderToRead = mnHeaderToRead - nHeadRead; if ( nHeadRead < nRequestedBytes ) @@ -275,7 +275,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa { sal_Int32 nOldLen = maCompBuffer.getLength(); maCompBuffer.realloc( nOldLen + aSuffix.getLength() ); - rtl_copyMemory( maCompBuffer.getArray() + nOldLen, aSuffix.getConstArray(), aSuffix.getLength() ); + memcpy( maCompBuffer.getArray() + nOldLen, aSuffix.getConstArray(), aSuffix.getLength() ); } } } diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index e67b07e7beee..81f1793e6c55 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -276,19 +276,19 @@ void ZipFile::StaticFillHeader( const ::rtl::Reference< EncryptionData >& rData, *(pHeader++) = static_cast< sal_Int8 >(( nMediaTypeLength >> 8 ) & 0xFF); // Then the salt content - rtl_copyMemory ( pHeader, rData->m_aSalt.getConstArray(), nSaltLength ); + memcpy ( pHeader, rData->m_aSalt.getConstArray(), nSaltLength ); pHeader += nSaltLength; // Then the IV content - rtl_copyMemory ( pHeader, rData->m_aInitVector.getConstArray(), nIVLength ); + memcpy ( pHeader, rData->m_aInitVector.getConstArray(), nIVLength ); pHeader += nIVLength; // Then the digest content - rtl_copyMemory ( pHeader, rData->m_aDigest.getConstArray(), nDigestLength ); + memcpy ( pHeader, rData->m_aDigest.getConstArray(), nDigestLength ); pHeader += nDigestLength; // Then the mediatype itself - rtl_copyMemory ( pHeader, aMediaType.getStr(), nMediaTypeLength ); + memcpy ( pHeader, aMediaType.getStr(), nMediaTypeLength ); pHeader += nMediaTypeLength; } @@ -356,15 +356,15 @@ sal_Bool ZipFile::StaticFillData ( ::rtl::Reference< BaseEncryptionData > & rDa if ( nSaltLength == rStream->readBytes ( aBuffer, nSaltLength ) ) { rData->m_aSalt.realloc ( nSaltLength ); - rtl_copyMemory ( rData->m_aSalt.getArray(), aBuffer.getConstArray(), nSaltLength ); + memcpy ( rData->m_aSalt.getArray(), aBuffer.getConstArray(), nSaltLength ); if ( nIVLength == rStream->readBytes ( aBuffer, nIVLength ) ) { rData->m_aInitVector.realloc ( nIVLength ); - rtl_copyMemory ( rData->m_aInitVector.getArray(), aBuffer.getConstArray(), nIVLength ); + memcpy ( rData->m_aInitVector.getArray(), aBuffer.getConstArray(), nIVLength ); if ( nDigestLength == rStream->readBytes ( aBuffer, nDigestLength ) ) { rData->m_aDigest.realloc ( nDigestLength ); - rtl_copyMemory ( rData->m_aDigest.getArray(), aBuffer.getConstArray(), nDigestLength ); + memcpy ( rData->m_aDigest.getArray(), aBuffer.getConstArray(), nDigestLength ); if ( nMediaTypeLength == rStream->readBytes ( aBuffer, nMediaTypeLength ) ) { @@ -464,7 +464,7 @@ sal_Bool ZipFile::StaticHasValidPassword( const uno::Reference< lang::XMultiServ { sal_Int32 nOldLen = aDecryptBuffer.getLength(); aDecryptBuffer.realloc( nOldLen + aDecryptBuffer2.getLength() ); - rtl_copyMemory( aDecryptBuffer.getArray() + nOldLen, aDecryptBuffer2.getArray(), aDecryptBuffer2.getLength() ); + memcpy( aDecryptBuffer.getArray() + nOldLen, aDecryptBuffer2.getArray(), aDecryptBuffer2.getLength() ); } if ( aDecryptBuffer.getLength() > n_ConstDigestLength ) @@ -479,7 +479,7 @@ sal_Bool ZipFile::StaticHasValidPassword( const uno::Reference< lang::XMultiServ // If we don't have a digest, then we have to assume that the password is correct if ( rData->m_aDigest.getLength() != 0 && ( aDigestSeq.getLength() != rData->m_aDigest.getLength() || - 0 != rtl_compareMemory ( aDigestSeq.getConstArray(), + 0 != memcmp ( aDigestSeq.getConstArray(), rData->m_aDigest.getConstArray(), aDigestSeq.getLength() ) ) ) { |