diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2012-07-25 20:03:22 +0200 |
---|---|---|
committer | Arnaud Versini <arnaud.versini@gmail.com> | 2012-07-27 20:19:13 +0200 |
commit | d6c284e4b146a44ba69a96836c59a98d077bb934 (patch) | |
tree | 13f4f278cd9642eadcbadbc84581573aafb28c58 /sal/rtl/source | |
parent | 5dbbe223c8586bd653685d27c664aa8395632e4a (diff) |
Use memset and memcpy insteadof rtl_zeroMemory and rtl_copyMemory in sal
Change-Id: I4f9649ca61c988d425b59e41549d1c46bb808f2c
Diffstat (limited to 'sal/rtl/source')
-rw-r--r-- | sal/rtl/source/byteseq.cxx | 12 | ||||
-rw-r--r-- | sal/rtl/source/cipher.cxx | 8 | ||||
-rw-r--r-- | sal/rtl/source/digest.cxx | 72 | ||||
-rw-r--r-- | sal/rtl/source/strbuf.cxx | 10 | ||||
-rw-r--r-- | sal/rtl/source/string.cxx | 10 | ||||
-rw-r--r-- | sal/rtl/source/unload.cxx | 4 | ||||
-rw-r--r-- | sal/rtl/source/ustrbuf.cxx | 10 | ||||
-rw-r--r-- | sal/rtl/source/ustring.cxx | 20 |
8 files changed, 79 insertions, 67 deletions
diff --git a/sal/rtl/source/byteseq.cxx b/sal/rtl/source/byteseq.cxx index 76423f78f1f9..432483c1e3f5 100644 --- a/sal/rtl/source/byteseq.cxx +++ b/sal/rtl/source/byteseq.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <string.h> + #include <osl/diagnose.h> #include <osl/interlck.h> @@ -61,7 +63,7 @@ void SAL_CALL rtl_byte_sequence_reference2One( pNew = (sal_Sequence *)rtl_allocateMemory( SAL_SEQUENCE_HEADER_SIZE + nElements ); if ( pNew != 0 ) - rtl_copyMemory( pNew->elements, pSequence->elements, nElements ); + memcpy( pNew->elements, pSequence->elements, nElements ); if (! osl_decrementInterlockedCount( &pSequence->nRefCount )) rtl_freeMemory( pSequence ); @@ -103,12 +105,12 @@ void SAL_CALL rtl_byte_sequence_realloc( { if (nSize > nElements) { - rtl_copyMemory( pNew->elements, pSequence->elements, nElements ); - rtl_zeroMemory( pNew->elements + nElements, nSize - nElements ); + memcpy( pNew->elements, pSequence->elements, nElements ); + memset( pNew->elements + nElements, 0, nSize - nElements ); } else { - rtl_copyMemory( pNew->elements, pSequence->elements, nSize ); + memcpy( pNew->elements, pSequence->elements, nSize ); } } @@ -207,7 +209,7 @@ void SAL_CALL rtl_byte_sequence_constructFromArray( { rtl_byte_sequence_constructNoDefault( ppSequence , nLength ); if ( *ppSequence != 0 ) - rtl_copyMemory( (*ppSequence)->elements, pData, nLength ); + memcpy( (*ppSequence)->elements, pData, nLength ); } //================================================================================================== diff --git a/sal/rtl/source/cipher.cxx b/sal/rtl/source/cipher.cxx index 7a57ac0e9d4a..29408b362191 100644 --- a/sal/rtl/source/cipher.cxx +++ b/sal/rtl/source/cipher.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <string.h> + #include <sal/types.h> #include <rtl/alloc.h> #include <rtl/memory.h> @@ -668,8 +670,8 @@ static rtlCipherError __rtl_cipherBF_init ( key = &(ctx->m_key); - rtl_copyMemory (key, &__rtl_cipherBF_key, sizeof (CipherKeyBF)); - rtl_zeroMemory (&(ctx->m_iv), sizeof(ctx->m_iv)); + memcpy (key, &__rtl_cipherBF_key, sizeof (CipherKeyBF)); + memset (&(ctx->m_iv), 0, sizeof(ctx->m_iv)); ctx->m_offset = 0; for (i = 0, k = 0; i < CIPHER_ROUNDS_BF + 2; ++i) @@ -710,7 +712,7 @@ static rtlCipherError __rtl_cipherBF_init ( nArgLen = ((nArgLen < 8) ? nArgLen : 8); if (eMode == rtl_Cipher_ModeStream) { - rtl_copyMemory (ctx->m_iv.m_byte, pArgData, nArgLen); + memcpy (ctx->m_iv.m_byte, pArgData, nArgLen); } else { diff --git a/sal/rtl/source/digest.cxx b/sal/rtl/source/digest.cxx index feec3b4b832f..58a179b13c2f 100644 --- a/sal/rtl/source/digest.cxx +++ b/sal/rtl/source/digest.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <string.h> + #include <sal/types.h> #include <sal/macros.h> #include <osl/endian.h> @@ -298,7 +300,7 @@ static const Digest_Impl __rtl_digest_MD2 = */ static void __rtl_digest_initMD2 (DigestContextMD2 *ctx) { - rtl_zeroMemory (ctx, sizeof (DigestContextMD2)); + memset (ctx, 0, sizeof (DigestContextMD2)); } /* @@ -342,8 +344,8 @@ static void __rtl_digest_updateMD2 (DigestContextMD2 *ctx) t = ((t + i) & 0xff); } - rtl_copyMemory (sp1, state, 16 * sizeof(sal_uInt32)); - rtl_zeroMemory (state, 48 * sizeof(sal_uInt32)); + memcpy (sp1, state, 16 * sizeof(sal_uInt32)); + memset (state, 0, 48 * sizeof(sal_uInt32)); } /* @@ -390,7 +392,7 @@ rtlDigestError SAL_CALL rtl_digest_MD2 ( if (result == rtl_Digest_E_None) result = rtl_digest_getMD2 (&digest, pBuffer, nBufLen); - rtl_zeroMemory (&digest, sizeof (digest)); + memset (&digest, 0, sizeof (digest)); return (result); } @@ -439,13 +441,13 @@ rtlDigestError SAL_CALL rtl_digest_updateMD2 ( if (nDatLen < n) { - rtl_copyMemory (p, d, nDatLen); + memcpy (p, d, nDatLen); ctx->m_nDatLen += nDatLen; return rtl_Digest_E_None; } - rtl_copyMemory (p, d, n); + memcpy (p, d, n); d += n; nDatLen -= n; @@ -455,14 +457,14 @@ rtlDigestError SAL_CALL rtl_digest_updateMD2 ( while (nDatLen >= DIGEST_CBLOCK_MD2) { - rtl_copyMemory (ctx->m_pData, d, DIGEST_CBLOCK_MD2); + memcpy (ctx->m_pData, d, DIGEST_CBLOCK_MD2); d += DIGEST_CBLOCK_MD2; nDatLen -= DIGEST_CBLOCK_MD2; __rtl_digest_updateMD2 (ctx); } - rtl_copyMemory (ctx->m_pData, d, nDatLen); + memcpy (ctx->m_pData, d, nDatLen); ctx->m_nDatLen = nDatLen; return rtl_Digest_E_None; @@ -584,7 +586,7 @@ static const Digest_Impl __rtl_digest_MD5 = */ static void __rtl_digest_initMD5 (DigestContextMD5 *ctx) { - rtl_zeroMemory (ctx, sizeof (DigestContextMD5)); + memset (ctx, 0, sizeof (DigestContextMD5)); ctx->m_nA = (sal_uInt32)0x67452301L; ctx->m_nB = (sal_uInt32)0xefcdab89L; @@ -757,7 +759,7 @@ rtlDigestError SAL_CALL rtl_digest_MD5 ( if (result == rtl_Digest_E_None) result = rtl_digest_getMD5 (&digest, pBuffer, nBufLen); - rtl_zeroMemory (&digest, sizeof (digest)); + memset (&digest, 0, sizeof (digest)); return (result); } @@ -812,13 +814,13 @@ rtlDigestError SAL_CALL rtl_digest_updateMD5 ( if (nDatLen < n) { - rtl_copyMemory (p, d, nDatLen); + memcpy (p, d, nDatLen); ctx->m_nDatLen += nDatLen; return rtl_Digest_E_None; } - rtl_copyMemory (p, d, n); + memcpy (p, d, n); d += n; nDatLen -= n; @@ -832,7 +834,7 @@ rtlDigestError SAL_CALL rtl_digest_updateMD5 ( while (nDatLen >= DIGEST_CBLOCK_MD5) { - rtl_copyMemory (ctx->m_pData, d, DIGEST_CBLOCK_MD5); + memcpy (ctx->m_pData, d, DIGEST_CBLOCK_MD5); d += DIGEST_CBLOCK_MD5; nDatLen -= DIGEST_CBLOCK_MD5; @@ -843,7 +845,7 @@ rtlDigestError SAL_CALL rtl_digest_updateMD5 ( __rtl_digest_updateMD5 (ctx); } - rtl_copyMemory (ctx->m_pData, d, nDatLen); + memcpy (ctx->m_pData, d, nDatLen); ctx->m_nDatLen = nDatLen; return rtl_Digest_E_None; @@ -1012,7 +1014,7 @@ static void __rtl_digest_endSHA (DigestContextSHA *ctx); static void __rtl_digest_initSHA ( DigestContextSHA *ctx, DigestSHA_update_t *fct) { - rtl_zeroMemory (ctx, sizeof (DigestContextSHA)); + memset (ctx, 0, sizeof (DigestContextSHA)); ctx->m_update = fct; ctx->m_nA = (sal_uInt32)0x67452301L; @@ -1237,7 +1239,7 @@ rtlDigestError SAL_CALL rtl_digest_SHA ( if (result == rtl_Digest_E_None) result = rtl_digest_getSHA (&digest, pBuffer, nBufLen); - rtl_zeroMemory (&digest, sizeof (digest)); + memset (&digest, 0, sizeof (digest)); return (result); } @@ -1292,13 +1294,13 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA ( if (nDatLen < n) { - rtl_copyMemory (p, d, nDatLen); + memcpy (p, d, nDatLen); ctx->m_nDatLen += nDatLen; return rtl_Digest_E_None; } - rtl_copyMemory (p, d, n); + memcpy (p, d, n); d += n; nDatLen -= n; @@ -1312,7 +1314,7 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA ( while (nDatLen >= DIGEST_CBLOCK_SHA) { - rtl_copyMemory (ctx->m_pData, d, DIGEST_CBLOCK_SHA); + memcpy (ctx->m_pData, d, DIGEST_CBLOCK_SHA); d += DIGEST_CBLOCK_SHA; nDatLen -= DIGEST_CBLOCK_SHA; @@ -1323,7 +1325,7 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA ( __rtl_digest_updateSHA (ctx); } - rtl_copyMemory (ctx->m_pData, d, nDatLen); + memcpy (ctx->m_pData, d, nDatLen); ctx->m_nDatLen = nDatLen; return rtl_Digest_E_None; @@ -1427,7 +1429,7 @@ rtlDigestError SAL_CALL rtl_digest_SHA1 ( if (result == rtl_Digest_E_None) result = rtl_digest_getSHA1 (&digest, pBuffer, nBufLen); - rtl_zeroMemory (&digest, sizeof (digest)); + memset (&digest, 0, sizeof (digest)); return (result); } @@ -1482,13 +1484,13 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA1 ( if (nDatLen < n) { - rtl_copyMemory (p, d, nDatLen); + memcpy (p, d, nDatLen); ctx->m_nDatLen += nDatLen; return rtl_Digest_E_None; } - rtl_copyMemory (p, d, n); + memcpy (p, d, n); d += n; nDatLen -= n; @@ -1502,7 +1504,7 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA1 ( while (nDatLen >= DIGEST_CBLOCK_SHA) { - rtl_copyMemory (ctx->m_pData, d, DIGEST_CBLOCK_SHA); + memcpy (ctx->m_pData, d, DIGEST_CBLOCK_SHA); d += DIGEST_CBLOCK_SHA; nDatLen -= DIGEST_CBLOCK_SHA; @@ -1513,7 +1515,7 @@ rtlDigestError SAL_CALL rtl_digest_updateSHA1 ( __rtl_digest_updateSHA (ctx); } - rtl_copyMemory (ctx->m_pData, d, nDatLen); + memcpy (ctx->m_pData, d, nDatLen); ctx->m_nDatLen = nDatLen; return rtl_Digest_E_None; @@ -1615,7 +1617,7 @@ static void __rtl_digest_initHMAC_MD5 (ContextHMAC_MD5 * ctx) pImpl->m_digest = __rtl_digest_MD5; __rtl_digest_initMD5 (&(pImpl->m_context)); - rtl_zeroMemory (ctx->m_opad, DIGEST_CBLOCK_HMAC_MD5); + memset (ctx->m_opad, 0, DIGEST_CBLOCK_HMAC_MD5); } /* @@ -1670,7 +1672,7 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_MD5 ( result = rtl_digest_getHMAC_MD5 (&digest, pBuffer, nBufLen); } - rtl_zeroMemory (&digest, sizeof (digest)); + memset (&digest, 0, sizeof (digest)); return (result); } @@ -1719,7 +1721,7 @@ rtlDigestError SAL_CALL rtl_digest_initHMAC_MD5 ( else { /* Initialize 'opad' with plain 'KeyData' */ - rtl_copyMemory (ctx->m_opad, pKeyData, nKeyLen); + memcpy (ctx->m_opad, pKeyData, nKeyLen); } __rtl_digest_ipadHMAC_MD5 (ctx); @@ -1847,7 +1849,7 @@ static void __rtl_digest_initHMAC_SHA1 (ContextHMAC_SHA1 * ctx) pImpl->m_digest = __rtl_digest_SHA_1; __rtl_digest_initSHA (&(pImpl->m_context), __rtl_digest_updateSHA_1); - rtl_zeroMemory (ctx->m_opad, DIGEST_CBLOCK_HMAC_SHA1); + memset (ctx->m_opad, 0, DIGEST_CBLOCK_HMAC_SHA1); } /* @@ -1902,7 +1904,7 @@ rtlDigestError SAL_CALL rtl_digest_HMAC_SHA1 ( result = rtl_digest_getHMAC_SHA1 (&digest, pBuffer, nBufLen); } - rtl_zeroMemory (&digest, sizeof (digest)); + memset (&digest, 0, sizeof (digest)); return (result); } @@ -1951,7 +1953,7 @@ rtlDigestError SAL_CALL rtl_digest_initHMAC_SHA1 ( else { /* Initialize 'opad' with plain 'KeyData' */ - rtl_copyMemory (ctx->m_opad, pKeyData, nKeyLen); + memcpy (ctx->m_opad, pKeyData, nKeyLen); } __rtl_digest_ipadHMAC_SHA1 (ctx); @@ -2072,7 +2074,7 @@ static void __rtl_digest_updatePBKDF2 ( for (k = 0; k < DIGEST_CBLOCK_PBKDF2; k++) T[k] ^= U[k]; } - rtl_zeroMemory (U, DIGEST_CBLOCK_PBKDF2); + memset (U, 0, DIGEST_CBLOCK_PBKDF2); } /*======================================================================== @@ -2124,11 +2126,11 @@ rtlDigestError SAL_CALL rtl_digest_PBKDF2 ( nCount, OSL_NETDWORD(i)); /* DK ||= T_(i) */ - rtl_copyMemory (pKeyData, T, nKeyLen); - rtl_zeroMemory (T, DIGEST_CBLOCK_PBKDF2); + memcpy (pKeyData, T, nKeyLen); + memset (T, 0, DIGEST_CBLOCK_PBKDF2); } - rtl_zeroMemory (&digest, sizeof (digest)); + memset (&digest, 0, sizeof (digest)); return rtl_Digest_E_None; } diff --git a/sal/rtl/source/strbuf.cxx b/sal/rtl/source/strbuf.cxx index d4a5a75ba929..953e6302ccc3 100644 --- a/sal/rtl/source/strbuf.cxx +++ b/sal/rtl/source/strbuf.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <string.h> + #include <osl/interlck.h> #include <rtl/strbuf.hxx> #include <rtl/memory.h> @@ -45,7 +47,7 @@ void SAL_CALL rtl_stringbuffer_newFromStr_WithLength( rtl_String ** newStr, rtl_string_new_WithLength( newStr, count + 16 ); (*newStr)->length = count; - rtl_copyMemory( (*newStr)->buffer, value, count ); + memcpy( (*newStr)->buffer, value, count ); return; } @@ -64,7 +66,7 @@ sal_Int32 SAL_CALL rtl_stringbuffer_newFromStringBuffer( rtl_String ** newStr, rtl_string_new_WithLength( newStr, newCapacity ); if (oldStr->length > 0) { (*newStr)->length = oldStr->length; - rtl_copyMemory( (*newStr)->buffer, oldStr->buffer, oldStr->length ); + memcpy( (*newStr)->buffer, oldStr->buffer, oldStr->length ); } return newCapacity; } @@ -88,7 +90,7 @@ void SAL_CALL rtl_stringbuffer_ensureCapacity pNew->length = (*This)->length; *This = pNew; - rtl_copyMemory( (*This)->buffer, pTmp->buffer, pTmp->length ); + memcpy( (*This)->buffer, pTmp->buffer, pTmp->length ); rtl_string_release( pTmp ); } } @@ -131,7 +133,7 @@ void SAL_CALL rtl_stringbuffer_insert( rtl_String ** This, /* optimized for 1 character */ pBuf[offset] = *str; else if( n > 1 ) - rtl_copyMemory( pBuf + offset, str, len * sizeof(sal_Char) ); + memcpy( pBuf + offset, str, len * sizeof(sal_Char) ); (*This)->length = nOldLen + len; pBuf[ nOldLen + len ] = 0; } diff --git a/sal/rtl/source/string.cxx b/sal/rtl/source/string.cxx index 42c8ae2a3fdc..78874b668b38 100644 --- a/sal/rtl/source/string.cxx +++ b/sal/rtl/source/string.cxx @@ -93,7 +93,7 @@ sal_Int32 SAL_CALL rtl_str_valueOfFloat(sal_Char * pStr, float f) sal_True); nLen = pResult->length; OSL_ASSERT(nLen < RTL_STR_MAX_VALUEOFFLOAT); - rtl_copyMemory(pStr, pResult->buffer, (nLen + 1) * sizeof(sal_Char)); + memcpy(pStr, pResult->buffer, (nLen + 1) * sizeof(sal_Char)); rtl_string_release(pResult); return nLen; } @@ -109,7 +109,7 @@ sal_Int32 SAL_CALL rtl_str_valueOfDouble(sal_Char * pStr, double d) 0, sal_True); nLen = pResult->length; OSL_ASSERT(nLen < RTL_STR_MAX_VALUEOFDOUBLE); - rtl_copyMemory(pStr, pResult->buffer, (nLen + 1) * sizeof(sal_Char)); + memcpy(pStr, pResult->buffer, (nLen + 1) * sizeof(sal_Char)); rtl_string_release(pResult); return nLen; } @@ -362,9 +362,9 @@ void rtl_string_newReplaceFirst( if (n != 0) { (*newStr)->length = n; assert(i >= 0 && i < str->length); - rtl_copyMemory((*newStr)->buffer, str->buffer, i); - rtl_copyMemory((*newStr)->buffer + i, to, toLength); - rtl_copyMemory( + memcpy((*newStr)->buffer, str->buffer, i); + memcpy((*newStr)->buffer + i, to, toLength); + memcpy( (*newStr)->buffer + i + toLength, str->buffer + i + fromLength, str->length - i - fromLength); } diff --git a/sal/rtl/source/unload.cxx b/sal/rtl/source/unload.cxx index 9d30bb303c26..5e9cdf1e0482 100644 --- a/sal/rtl/source/unload.cxx +++ b/sal/rtl/source/unload.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <string.h> + #include <rtl/unload.h> #include <rtl/alloc.h> #include <rtl/ustring.hxx> @@ -203,7 +205,7 @@ extern "C" sal_Bool rtl_moduleCount_canUnload( rtl_StandardModuleCount * that, T MutexGuard guard( getUnloadingMutex()); if (libUnused && (that->counter == 0)) { - rtl_copyMemory(libUnused, &that->unusedSince, sizeof(TimeValue)); + memcpy(libUnused, &that->unusedSince, sizeof(TimeValue)); } } return (that->counter == 0); diff --git a/sal/rtl/source/ustrbuf.cxx b/sal/rtl/source/ustrbuf.cxx index 72cf4c47c041..23b6cb8f4e62 100644 --- a/sal/rtl/source/ustrbuf.cxx +++ b/sal/rtl/source/ustrbuf.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <string.h> + #include <osl/interlck.h> #include <rtl/ustrbuf.hxx> @@ -44,7 +46,7 @@ void SAL_CALL rtl_uStringbuffer_newFromStr_WithLength( rtl_uString ** newStr, rtl_uString_new_WithLength( newStr, count + 16 ); (*newStr)->length = count; - rtl_copyMemory( (*newStr)->buffer, value, count * sizeof(sal_Unicode)); + memcpy( (*newStr)->buffer, value, count * sizeof(sal_Unicode)); RTL_LOG_STRING_NEW( *newStr ); return; } @@ -84,7 +86,7 @@ sal_Int32 SAL_CALL rtl_uStringbuffer_newFromStringBuffer( rtl_uString ** newStr, if (oldStr->length > 0) { (*newStr)->length = oldStr->length; - rtl_copyMemory( (*newStr)->buffer, oldStr->buffer, oldStr->length * sizeof(sal_Unicode)); + memcpy( (*newStr)->buffer, oldStr->buffer, oldStr->length * sizeof(sal_Unicode)); } RTL_LOG_STRING_NEW( *newStr ); return newCapacity; @@ -106,7 +108,7 @@ void SAL_CALL rtl_uStringbuffer_ensureCapacity pNew->length = (*This)->length; *This = pNew; - rtl_copyMemory( (*This)->buffer, pTmp->buffer, pTmp->length * sizeof(sal_Unicode) ); + memcpy( (*This)->buffer, pTmp->buffer, pTmp->length * sizeof(sal_Unicode) ); RTL_LOG_STRING_NEW( pTmp ); // with accurate contents rtl_uString_release( pTmp ); @@ -147,7 +149,7 @@ void SAL_CALL rtl_uStringbuffer_insert( rtl_uString ** This, /* optimized for 1 character */ pBuf[offset] = *str; else if( len > 1 ) - rtl_copyMemory( pBuf + offset, str, len * sizeof(sal_Unicode) ); + memcpy( pBuf + offset, str, len * sizeof(sal_Unicode) ); (*This)->length = nOldLen + len; pBuf[ nOldLen + len ] = 0; } diff --git a/sal/rtl/source/ustring.cxx b/sal/rtl/source/ustring.cxx index 2909432345a2..23ec82b28f68 100644 --- a/sal/rtl/source/ustring.cxx +++ b/sal/rtl/source/ustring.cxx @@ -130,7 +130,7 @@ sal_Int32 SAL_CALL rtl_ustr_valueOfFloat(sal_Unicode * pStr, float f) 0, sal_True); nLen = pResult->length; OSL_ASSERT(nLen < RTL_USTR_MAX_VALUEOFFLOAT); - rtl_copyMemory(pStr, pResult->buffer, (nLen + 1) * sizeof(sal_Unicode)); + memcpy(pStr, pResult->buffer, (nLen + 1) * sizeof(sal_Unicode)); rtl_uString_release(pResult); return nLen; } @@ -146,7 +146,7 @@ sal_Int32 SAL_CALL rtl_ustr_valueOfDouble(sal_Unicode * pStr, double d) 0, sal_True); nLen = pResult->length; OSL_ASSERT(nLen < RTL_USTR_MAX_VALUEOFDOUBLE); - rtl_copyMemory(pStr, pResult->buffer, (nLen + 1) * sizeof(sal_Unicode)); + memcpy(pStr, pResult->buffer, (nLen + 1) * sizeof(sal_Unicode)); rtl_uString_release(pResult); return nLen; } @@ -1055,12 +1055,12 @@ void rtl_uString_newReplaceFirst( if (n != 0) { (*newStr)->length = n; assert(i >= 0 && i < str->length); - rtl_copyMemory( + memcpy( (*newStr)->buffer, str->buffer, i * sizeof (sal_Unicode)); - rtl_copyMemory( + memcpy( (*newStr)->buffer + i, to->buffer, to->length * sizeof (sal_Unicode)); - rtl_copyMemory( + memcpy( (*newStr)->buffer + i + to->length, str->buffer + i + from->length, (str->length - i - from->length) * sizeof (sal_Unicode)); @@ -1097,12 +1097,12 @@ void rtl_uString_newReplaceFirstAsciiL( rtl_uString_new_WithLength(newStr, n); (*newStr)->length = n; assert(i >= 0 && i < str->length); - rtl_copyMemory( + memcpy( (*newStr)->buffer, str->buffer, i * sizeof (sal_Unicode)); - rtl_copyMemory( + memcpy( (*newStr)->buffer + i, to->buffer, to->length * sizeof (sal_Unicode)); - rtl_copyMemory( + memcpy( (*newStr)->buffer + i + to->length, str->buffer + i + fromLength, (str->length - i - fromLength) * sizeof (sal_Unicode)); @@ -1140,13 +1140,13 @@ void rtl_uString_newReplaceFirstAsciiLAsciiL( rtl_uString_new_WithLength(newStr, n); (*newStr)->length = n; assert(i >= 0 && i < str->length); - rtl_copyMemory( + memcpy( (*newStr)->buffer, str->buffer, i * sizeof (sal_Unicode)); for (sal_Int32 j = 0; j != toLength; ++j) { assert(static_cast< unsigned char >(to[j]) <= 0x7F); (*newStr)->buffer[i + j] = to[j]; } - rtl_copyMemory( + memcpy( (*newStr)->buffer + i + toLength, str->buffer + i + fromLength, (str->length - i - fromLength) * sizeof (sal_Unicode)); |