[Libreoffice-commits] .: cppu/source
Arnaud Versini
aversini at kemper.freedesktop.org
Tue Jul 24 11:36:28 PDT 2012
cppu/source/typelib/typelib.cxx | 6 ++++--
cppu/source/uno/constr.hxx | 4 ++--
cppu/source/uno/eq.hxx | 12 ++++++------
cppu/source/uno/sequence.cxx | 21 ++++++++++++++-------
4 files changed, 26 insertions(+), 17 deletions(-)
New commits:
commit b8d562018155d7bb961198dc1f1dfd5e7a0d1d62
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date: Mon Jul 23 21:17:15 2012 +0200
Use memset and memcmp insteadof rtl_zeroMemory and rtl_compareMemory in cppu
Change-Id: I88976b215bc23ce5001916ccf123bc3561c2a33a
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index 06b0b9f..90f7ba6 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -1735,8 +1735,10 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_register(
pTDR->pType->nSize = (*ppNewDescription)->nSize;
pTDR->pType->nAlignment = (*ppNewDescription)->nAlignment;
- ::rtl_zeroMemory(
- *ppNewDescription +1, nSize - sizeof( typelib_TypeDescription ) );
+ memset(
+ *ppNewDescription +1,
+ 0,
+ nSize - sizeof( typelib_TypeDescription ) );
if( pTDR->pType->bOnDemand && !(*ppNewDescription)->bOnDemand )
{
diff --git a/cppu/source/uno/constr.hxx b/cppu/source/uno/constr.hxx
index 06107ca..dd0343a 100644
--- a/cppu/source/uno/constr.hxx
+++ b/cppu/source/uno/constr.hxx
@@ -19,9 +19,9 @@
#ifndef CONSTR_HXX
#define CONSTR_HXX
+#include <string.h>
#include "prim.hxx"
-
namespace cppu
{
@@ -90,7 +90,7 @@ inline void _defaultConstructArray(
case typelib_TypeClass_FLOAT:
case typelib_TypeClass_DOUBLE:
case typelib_TypeClass_INTERFACE:
- ::rtl_zeroMemory(pMem, nElementSize * nTotalElements);
+ memset(pMem, 0, nElementSize * nTotalElements);
break;
case typelib_TypeClass_STRING:
diff --git a/cppu/source/uno/eq.hxx b/cppu/source/uno/eq.hxx
index 396a8dc..a270f6e 100644
--- a/cppu/source/uno/eq.hxx
+++ b/cppu/source/uno/eq.hxx
@@ -127,7 +127,7 @@ inline sal_Bool _equalSequence(
switch (pElementType->eTypeClass)
{
case typelib_TypeClass_CHAR:
- return (0 == ::rtl_compareMemory( pDestElements, pSourceElements, sizeof(sal_Unicode) * nElements ));
+ return (0 == memcmp( pDestElements, pSourceElements, sizeof(sal_Unicode) * nElements ));
case typelib_TypeClass_BOOLEAN:
{
for ( sal_Int32 nPos = nElements; nPos--; )
@@ -141,16 +141,16 @@ inline sal_Bool _equalSequence(
return sal_True;
}
case typelib_TypeClass_BYTE:
- return (0 == ::rtl_compareMemory( pDestElements, pSourceElements, sizeof(sal_Int8) * nElements ));
+ return (0 == memcmp( pDestElements, pSourceElements, sizeof(sal_Int8) * nElements ));
case typelib_TypeClass_SHORT:
case typelib_TypeClass_UNSIGNED_SHORT:
- return (0 == ::rtl_compareMemory( pDestElements, pSourceElements, sizeof(sal_Int16) * nElements ));
+ return (0 == memcmp( pDestElements, pSourceElements, sizeof(sal_Int16) * nElements ));
case typelib_TypeClass_LONG:
case typelib_TypeClass_UNSIGNED_LONG:
- return (0 == ::rtl_compareMemory( pDestElements, pSourceElements, sizeof(sal_Int32) * nElements ));
+ return (0 == memcmp( pDestElements, pSourceElements, sizeof(sal_Int32) * nElements ));
case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER:
- return (0 == ::rtl_compareMemory( pDestElements, pSourceElements, sizeof(sal_Int64) * nElements ));
+ return (0 == memcmp( pDestElements, pSourceElements, sizeof(sal_Int64) * nElements ));
case typelib_TypeClass_FLOAT:
{
for ( sal_Int32 nPos = nElements; nPos--; )
@@ -206,7 +206,7 @@ inline sal_Bool _equalSequence(
return sal_True;
}
case typelib_TypeClass_ENUM:
- return (0 == ::rtl_compareMemory( pDestElements, pSourceElements, sizeof(sal_Int32) * nElements ));
+ return (0 == memcmp( pDestElements, pSourceElements, sizeof(sal_Int32) * nElements ));
case typelib_TypeClass_STRUCT:
case typelib_TypeClass_EXCEPTION:
{
diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx
index a431973..1397a89 100644
--- a/cppu/source/uno/sequence.cxx
+++ b/cppu/source/uno/sequence.cxx
@@ -78,8 +78,9 @@ static inline bool idefaultConstructElements(
pSeq = reallocSeq( pSeq, sizeof(sal_Unicode), nAlloc );
if (pSeq != 0)
{
- ::rtl_zeroMemory(
+ memset(
pSeq->elements + (sizeof(sal_Unicode) * nStartIndex),
+ 0,
sizeof(sal_Unicode) * (nStopIndex - nStartIndex) );
}
break;
@@ -88,8 +89,9 @@ static inline bool idefaultConstructElements(
pSeq = reallocSeq( pSeq, sizeof(sal_Bool), nAlloc );
if (pSeq != 0)
{
- ::rtl_zeroMemory(
+ memset(
pSeq->elements + (sizeof(sal_Bool) * nStartIndex),
+ 0,
sizeof(sal_Bool) * (nStopIndex - nStartIndex) );
}
break;
@@ -98,8 +100,9 @@ static inline bool idefaultConstructElements(
pSeq = reallocSeq( pSeq, sizeof(sal_Int8), nAlloc );
if (pSeq != 0)
{
- ::rtl_zeroMemory(
+ memset(
pSeq->elements + (sizeof(sal_Int8) * nStartIndex),
+ 0,
sizeof(sal_Int8) * (nStopIndex - nStartIndex) );
}
break;
@@ -109,8 +112,9 @@ static inline bool idefaultConstructElements(
pSeq = reallocSeq( pSeq, sizeof(sal_Int16), nAlloc );
if (pSeq != 0)
{
- ::rtl_zeroMemory(
+ memset(
pSeq->elements + (sizeof(sal_Int16) * nStartIndex),
+ 0,
sizeof(sal_Int16) * (nStopIndex - nStartIndex) );
}
break;
@@ -120,8 +124,9 @@ static inline bool idefaultConstructElements(
pSeq = reallocSeq( pSeq, sizeof(sal_Int32), nAlloc );
if (pSeq != 0)
{
- ::rtl_zeroMemory(
+ memset(
pSeq->elements + (sizeof(sal_Int32) * nStartIndex),
+ 0,
sizeof(sal_Int32) * (nStopIndex - nStartIndex) );
}
break;
@@ -131,8 +136,9 @@ static inline bool idefaultConstructElements(
pSeq = reallocSeq( pSeq, sizeof(sal_Int64), nAlloc );
if (pSeq != 0)
{
- ::rtl_zeroMemory(
+ memset(
pSeq->elements + (sizeof(sal_Int64) * nStartIndex),
+ 0,
sizeof(sal_Int64) * (nStopIndex - nStartIndex) );
}
break;
@@ -334,8 +340,9 @@ static inline bool idefaultConstructElements(
pSeq = reallocSeq( pSeq, sizeof(void *), nAlloc );
if (pSeq != 0)
{
- ::rtl_zeroMemory(
+ memset(
pSeq->elements + (sizeof(void *) * nStartIndex),
+ 0,
sizeof(void *) * (nStopIndex - nStartIndex) );
}
break;
More information about the Libreoffice-commits
mailing list