diff options
author | jailletc36 <christophe.jaillet@wanadoo.fr> | 2012-11-11 11:51:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-11-14 16:48:17 +0000 |
commit | de51745f588a2e2aa933e4c33fae3d9a10385eb1 (patch) | |
tree | a15f8d5c02080f32df73bf2bbf13170bc7b8ac04 /sfx2/source | |
parent | 5b1fcd5262f087e3d1cabb240d1761064baeafc6 (diff) |
Turn some memmove into memcpy when it is safe to do so.
Most of the changes are related to newly allocated memory, so we are
sure it can not overlap with the source of the copy.
Change-Id: Ie6ccf1bbb07b792fb18601a38dfaa55755d14b7d
Signed-off-by: jailletc36 <christophe.jaillet@wanadoo.fr>
Reviewed-on: https://gerrit.libreoffice.org/1033
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/bastyp/minarray.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sfx2/source/bastyp/minarray.cxx b/sfx2/source/bastyp/minarray.cxx index 98225dce3c7d..23d2dbe66431 100644 --- a/sfx2/source/bastyp/minarray.cxx +++ b/sfx2/source/bastyp/minarray.cxx @@ -93,7 +93,7 @@ void SfxPtrArr::Append( void* aElem ) if ( pData ) { DBG_ASSERT( nUsed <= nNewSize, "" ); - memmove( pNewData, pData, sizeof(void*)*nUsed ); + memcpy( pNewData, pData, sizeof(void*)*nUsed ); delete [] pData; } nUnused = sal::static_int_cast< sal_uInt8 >(nNewSize-nUsed); @@ -139,11 +139,11 @@ sal_uInt16 SfxPtrArr::Remove( sal_uInt16 nPos, sal_uInt16 nLen ) if ( nPos > 0 ) { DBG_ASSERT( nPos <= nNewSize, "" ); - memmove( pNewData, pData, sizeof(void*)*nPos ); + memcpy( pNewData, pData, sizeof(void*)*nPos ); } if ( nNewUsed != nPos ) - memmove( pNewData+nPos, pData+nPos+nLen, - sizeof(void*)*(nNewUsed-nPos) ); + memcpy( pNewData+nPos, pData+nPos+nLen, + sizeof(void*)*(nNewUsed-nPos) ); delete [] pData; pData = pNewData; nUsed = nNewUsed; @@ -210,7 +210,7 @@ void SfxPtrArr::Insert( sal_uInt16 nPos, void* rElem ) if ( pData ) { DBG_ASSERT( nUsed < nNewSize, "" ); - memmove( pNewData, pData, sizeof(void*)*nUsed ); + memcpy( pNewData, pData, sizeof(void*)*nUsed ); delete [] pData; } nUnused = sal::static_int_cast< sal_uInt8 >(nNewSize-nUsed); |