[Libreoffice-commits] .: 5 commits - filter/source registry/source registry/tools unodevtools/source xmloff/source xmlsecurity/source

Arnaud Versini aversini at kemper.freedesktop.org
Sat Aug 4 09:08:28 PDT 2012


 filter/source/pdf/impdialog.cxx                                       |    5 +-
 registry/source/keyimpl.cxx                                           |   21 +++++-----
 registry/source/reflwrit.cxx                                          |    2 
 registry/source/regimpl.cxx                                           |    4 -
 registry/tools/regcompare.cxx                                         |    2 
 unodevtools/source/unodevtools/typeblob.cxx                           |   20 +++++----
 xmloff/source/core/attrlist.cxx                                       |    4 -
 xmloff/source/core/unoatrcn.cxx                                       |    4 -
 xmloff/source/core/xmlexp.cxx                                         |    4 +
 xmloff/source/core/xmlimp.cxx                                         |    5 +-
 xmloff/source/style/StyleMap.cxx                                      |    5 +-
 xmloff/source/transform/MutableAttrList.cxx                           |    5 +-
 xmloff/source/transform/OOo2Oasis.cxx                                 |    2 
 xmloff/source/transform/Oasis2OOo.cxx                                 |    2 
 xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx |    7 +--
 xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx     |    4 +
 xmlsecurity/source/xmlsec/nss/ciphercontext.cxx                       |   14 +++---
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx         |    2 
 xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx             |    2 
 xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx            |    3 -
 20 files changed, 64 insertions(+), 53 deletions(-)

New commits:
commit 9d314ab71ed25a4bc5b4b1b6720cc24577137f04
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sat Aug 4 16:42:11 2012 +0200

    Replace usage of rtl/memory.h in unodevtools with equivalent from string.h
    
    Change-Id: Id13d0be47071345508ea1ddd3a8c4b8e656fcfe8

diff --git a/unodevtools/source/unodevtools/typeblob.cxx b/unodevtools/source/unodevtools/typeblob.cxx
index b2377b1..d877e44 100644
--- a/unodevtools/source/unodevtools/typeblob.cxx
+++ b/unodevtools/source/unodevtools/typeblob.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <string.h>
+
 #include "rtl/alloc.h"
 #include "registry/writer.hxx"
 
@@ -316,7 +318,7 @@ void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr,
 
         const void* p = writer.getBlob(blobsize);
         pBlob = (sal_uInt8*)rtl_allocateMemory(*blobsize);
-        rtl_copyMemory(pBlob, p, *blobsize);
+        memcpy(pBlob, p, *blobsize);
     }
     break;
     case TypeClass_MODULE:
@@ -358,7 +360,7 @@ void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr,
 
         const void* p = writer.getBlob(blobsize);
         pBlob = (sal_uInt8*)rtl_allocateMemory(*blobsize);
-        rtl_copyMemory(pBlob, p, *blobsize);
+        memcpy(pBlob, p, *blobsize);
     }
     break;
     case TypeClass_INTERFACE:
@@ -470,7 +472,7 @@ void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr,
 
         const void* p = writer.getBlob(blobsize);
         pBlob = (sal_uInt8*)rtl_allocateMemory(*blobsize);
-        rtl_copyMemory(pBlob, p, *blobsize);
+        memcpy(pBlob, p, *blobsize);
     }
     break;
     case TypeClass_STRUCT:
@@ -530,7 +532,7 @@ void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr,
 
         const void* p = writer.getBlob(blobsize);
         pBlob = (sal_uInt8*)rtl_allocateMemory(*blobsize);
-        rtl_copyMemory(pBlob, p, *blobsize);
+        memcpy(pBlob, p, *blobsize);
         }
     break;
     case TypeClass_EXCEPTION:
@@ -572,7 +574,7 @@ void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr,
 
         const void* p = writer.getBlob(blobsize);
         pBlob = (sal_uInt8*)rtl_allocateMemory(*blobsize);
-        rtl_copyMemory(pBlob, p, *blobsize);
+        memcpy(pBlob, p, *blobsize);
     }
     break;
     case TypeClass_ENUM:
@@ -603,7 +605,7 @@ void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr,
 
         const void* p = writer.getBlob(blobsize);
         pBlob = (sal_uInt8*)rtl_allocateMemory(*blobsize);
-        rtl_copyMemory(pBlob, p, *blobsize);
+        memcpy(pBlob, p, *blobsize);
     }
     break;
     case TypeClass_TYPEDEF:
@@ -623,7 +625,7 @@ void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr,
 
         const void* p = writer.getBlob(blobsize);
         pBlob = (sal_uInt8*)rtl_allocateMemory(*blobsize);
-        rtl_copyMemory(pBlob, p, *blobsize);
+        memcpy(pBlob, p, *blobsize);
     }
     break;
     case TypeClass_SERVICE:
@@ -760,7 +762,7 @@ void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr,
 
         const void* p = writer.getBlob(blobsize);
         pBlob = (sal_uInt8*)rtl_allocateMemory(*blobsize);
-        rtl_copyMemory(pBlob, p, *blobsize);
+        memcpy(pBlob, p, *blobsize);
     }
     break;
     case TypeClass_SINGLETON:
@@ -785,7 +787,7 @@ void* getTypeBlob(Reference< XHierarchicalNameAccess > xTDmgr,
 
         const void* p = writer.getBlob(blobsize);
         pBlob = (sal_uInt8*)rtl_allocateMemory(*blobsize);
-        rtl_copyMemory(pBlob, p, *blobsize);
+        memcpy(pBlob, p, *blobsize);
     }
     break;
     default:
commit 706e7b1e206b52aaf5aea359ce3b02d3aaa73ca8
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sat Aug 4 16:40:20 2012 +0200

    Replace usage of rtl/memory.h in filter with equivalent from string.h
    
    Change-Id: If8313df67e037f48c56d9d4e4251316fc99894e7

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 999da17..9f1bb2c 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -26,6 +26,7 @@
  *
  ************************************************************************/
 
+#include <string.h>
 
 #include "impdialog.hxx"
 #include "impdialog.hrc"
@@ -1317,8 +1318,8 @@ IMPL_LINK_NOARG(ImpPDFTabSecurityPage, ClickmaPbSetPwdHdl)
             maPreparedOwnerPassword = Sequence< NamedValue >();
 
         // trash clear text passwords string memory
-        rtl_zeroMemory( (void*)aUserPW.getStr(), aUserPW.getLength() );
-        rtl_zeroMemory( (void*)aOwnerPW.getStr(), aOwnerPW.getLength() );
+        memset( (void*)aUserPW.getStr(), 0, aUserPW.getLength() );
+        memset( (void*)aOwnerPW.getStr(), 0, aOwnerPW.getLength() );
     }
     enablePermissionControls();
     return 0;
commit f6acb53bb124e6f01e82ace35ce40f02da5a4e5d
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sat Aug 4 14:54:23 2012 +0200

    Replace usage of rtl/memory.h in registry with equivalent from string.h
    
    Change-Id: I3c442b7c3743684f62cc5ffc3c4b0926ff0db999

diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx
index e4c0325..8a1234f 100644
--- a/registry/source/keyimpl.cxx
+++ b/registry/source/keyimpl.cxx
@@ -18,11 +18,12 @@
  */
 
 
+#include <string.h>
+
 #include "keyimpl.hxx"
 
 #include "reflcnst.hxx"
 #include "rtl/alloc.h"
-#include "rtl/memory.h"
 #include "rtl/ustrbuf.hxx"
 
 using rtl::OUString;
@@ -316,14 +317,14 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal
 
     sal_uInt8 type = (sal_uInt8)vType;
     pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + size);
-    rtl_copyMemory(pBuffer, &type, 1);
+    memcpy(pBuffer, &type, 1);
 
     writeUINT32(pBuffer+VALUE_TYPEOFFSET, size);
 
     switch (vType)
     {
         case RG_VALUETYPE_NOT_DEFINED:
-            rtl_copyMemory(pBuffer+VALUE_HEADEROFFSET, value, size);
+            memcpy(pBuffer+VALUE_HEADEROFFSET, value, size);
             break;
         case RG_VALUETYPE_LONG:
             writeINT32(pBuffer+VALUE_HEADEROFFSET, *((sal_Int32*)value));
@@ -335,7 +336,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal
             writeString(pBuffer+VALUE_HEADEROFFSET, (const sal_Unicode*)value);
             break;
         case RG_VALUETYPE_BINARY:
-            rtl_copyMemory(pBuffer+VALUE_HEADEROFFSET, value, size);
+            memcpy(pBuffer+VALUE_HEADEROFFSET, value, size);
             break;
         default:
             OSL_ASSERT(false);
@@ -388,7 +389,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL
 
     sal_uInt8 type = (sal_uInt8)RG_VALUETYPE_LONGLIST;
     pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + size);
-    rtl_copyMemory(pBuffer, &type, 1);
+    memcpy(pBuffer, &type, 1);
 
     writeUINT32(pBuffer+VALUE_TYPEOFFSET, size);
     writeUINT32(pBuffer+VALUE_HEADEROFFSET, len);
@@ -451,7 +452,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu
 
     sal_uInt8 type = (sal_uInt8)RG_VALUETYPE_STRINGLIST;
     pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + size);
-    rtl_copyMemory(pBuffer, &type, 1);
+    memcpy(pBuffer, &type, 1);
 
     writeUINT32(pBuffer+VALUE_TYPEOFFSET, size);
     writeUINT32(pBuffer+VALUE_HEADEROFFSET, len);
@@ -519,7 +520,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p
 
     sal_uInt8 type = (sal_uInt8)RG_VALUETYPE_UNICODELIST;
     pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + size);
-    rtl_copyMemory(pBuffer, &type, 1);
+    memcpy(pBuffer, &type, 1);
 
     writeUINT32(pBuffer+VALUE_TYPEOFFSET, size);
     writeUINT32(pBuffer+VALUE_HEADEROFFSET, len);
@@ -621,7 +622,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
     switch (valueType)
     {
         case RG_VALUETYPE_NOT_DEFINED:
-            rtl_copyMemory(value, pBuffer, valueSize);
+            memcpy(value, pBuffer, valueSize);
             break;
         case RG_VALUETYPE_LONG:
             readINT32(pBuffer, *((sal_Int32*)value));
@@ -633,12 +634,12 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
             readString(pBuffer, (sal_Unicode*)value, valueSize);
             break;
         case RG_VALUETYPE_BINARY:
-            rtl_copyMemory(value, pBuffer, valueSize);
+            memcpy(value, pBuffer, valueSize);
             break;
         case RG_VALUETYPE_LONGLIST:
         case RG_VALUETYPE_STRINGLIST:
         case RG_VALUETYPE_UNICODELIST:
-            rtl_copyMemory(value, pBuffer, valueSize);
+            memcpy(value, pBuffer, valueSize);
             break;
     }
 
diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index fca4023..1c644e9 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -403,7 +403,7 @@ void FieldEntry::setData(const OString&    name,
     if (constValueType == RT_TYPE_STRING && constValue.aString != 0) {
         sal_Int32 n = rtl_ustr_getLength(constValue.aString) + 1;
         newValue = new sal_Unicode[n];
-        rtl_copyMemory(newValue, constValue.aString, n * sizeof (sal_Unicode));
+        memcpy(newValue, constValue.aString, n * sizeof (sal_Unicode));
     }
 
     m_name = name;
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
index d6bd017..d51aafd 100644
--- a/registry/source/regimpl.cxx
+++ b/registry/source/regimpl.cxx
@@ -1311,9 +1311,9 @@ RegError ORegistry::mergeModuleValue(OStoreStream& rTargetValue,
         sal_uInt8   type = (sal_uInt8)RG_VALUETYPE_BINARY;
         sal_uInt8*  pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE + aBlopSize);
 
-        rtl_copyMemory(pBuffer, &type, 1);
+        memcpy(pBuffer, &type, 1);
         writeUINT32(pBuffer+VALUE_TYPEOFFSET, aBlopSize);
-        rtl_copyMemory(pBuffer+VALUE_HEADEROFFSET, pBlop, aBlopSize);
+        memcpy(pBuffer+VALUE_HEADEROFFSET, pBlop, aBlopSize);
 
         sal_uInt32  rwBytes;
         if (rTargetValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+aBlopSize, rwBytes))
diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx
index 46c9824..f9a72d7 100644
--- a/registry/tools/regcompare.cxx
+++ b/registry/tools/regcompare.cxx
@@ -1407,7 +1407,7 @@ static sal_uInt32 checkValueDifference(
             std::vector< sal_uInt8 > value2(size2);
             key2.getValue(tmpName, &value2[0]);
 
-            bEqual = (rtl_compareMemory(&value1[0], &value2[0], value1.size()) == 0 );
+            bEqual = (memcmp(&value1[0], &value2[0], value1.size()) == 0 );
             if ( !bEqual && valueType1 == RG_VALUETYPE_BINARY && valueType2 == RG_VALUETYPE_BINARY )
             {
                 typereg::Reader reader1(&value1[0], value1.size(), false, TYPEREG_VERSION_1);
commit 7378c5cb16959aafa32c101d96f32557598d7493
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sat Aug 4 12:00:20 2012 +0200

    Replace usage of rtl/memory.h in xmloff with  equivalent from string.h
    
    Change-Id: Ie4747a424bb688263dd578905b44c849e3cac08d

diff --git a/xmloff/source/core/attrlist.cxx b/xmloff/source/core/attrlist.cxx
index cf60e26..a086a14 100644
--- a/xmloff/source/core/attrlist.cxx
+++ b/xmloff/source/core/attrlist.cxx
@@ -27,10 +27,10 @@
  ************************************************************************/
 
 
+#include <string.h>
 #include <vector>
 #include <osl/mutex.hxx>
 #include <xmloff/xmltoken.hxx>
-#include <rtl/memory.h>
 #include <comphelper/servicehelper.hxx>
 
 #include <xmloff/attrlist.hxx>
@@ -276,7 +276,7 @@ SvXMLAttributeList* SvXMLAttributeList::getImplementation( uno::Reference< uno::
 sal_Int64 SAL_CALL SvXMLAttributeList::getSomething( const uno::Sequence< sal_Int8 >& rId )
     throw( uno::RuntimeException )
 {
-    if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+    if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
                                                          rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
diff --git a/xmloff/source/core/unoatrcn.cxx b/xmloff/source/core/unoatrcn.cxx
index b29473b..da57811 100644
--- a/xmloff/source/core/unoatrcn.cxx
+++ b/xmloff/source/core/unoatrcn.cxx
@@ -26,9 +26,9 @@
  *
  ************************************************************************/
 
+#include <string.h>
 #include <com/sun/star/xml/AttributeData.hpp>
 #include <rtl/ustrbuf.hxx>
-#include <rtl/memory.h>
 #include <comphelper/servicehelper.hxx>
 #include <limits.h>
 
@@ -119,7 +119,7 @@ const ::com::sun::star::uno::Sequence< sal_Int8 > & SvUnoAttributeContainer::get
 
 sal_Int64 SAL_CALL SvUnoAttributeContainer::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw(::com::sun::star::uno::RuntimeException)
 {
-    if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+    if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
                                                          rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index cbf9ef3..e3bdf9f 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -26,6 +26,8 @@
  *
  ************************************************************************/
 
+#include <string.h>
+
 #include "sal/config.h"
 
 #include <officecfg/Office/Common.hxx>
@@ -2093,7 +2095,7 @@ SvXMLExport* SvXMLExport::getImplementation( uno::Reference< uno::XInterface > x
 sal_Int64 SAL_CALL SvXMLExport::getSomething( const uno::Sequence< sal_Int8 >& rId )
     throw( uno::RuntimeException )
 {
-    if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+    if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
                                                          rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index e4a55d1..93c49f1 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -26,11 +26,12 @@
  *
  ************************************************************************/
 
+#include <string.h>
+
 #include <com/sun/star/beans/XPropertySetInfo.hpp>
 #include <tools/debug.hxx>
 #include <tools/urlobj.hxx>
 #include <osl/mutex.hxx>
-#include <rtl/memory.h>
 #include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
 #include <xmloff/nmspmap.hxx>
 #include <xmloff/xmluconv.hxx>
@@ -419,7 +420,7 @@ const uno::Sequence< sal_Int8 > & SvXMLImport::getUnoTunnelId() throw()
 sal_Int64 SAL_CALL SvXMLImport::getSomething( const uno::Sequence< sal_Int8 >& rId )
     throw( uno::RuntimeException )
 {
-    if( rId.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+    if( rId.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(),
                                                          rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
diff --git a/xmloff/source/style/StyleMap.cxx b/xmloff/source/style/StyleMap.cxx
index 7964da3..b4c5051 100644
--- a/xmloff/source/style/StyleMap.cxx
+++ b/xmloff/source/style/StyleMap.cxx
@@ -26,8 +26,9 @@
  *
  ************************************************************************/
 
+#include <string.h>
+
 #include <osl/mutex.hxx>
-#include <rtl/memory.h>
 #include <comphelper/servicehelper.hxx>
 
 #include "StyleMap.hxx"
@@ -74,7 +75,7 @@ sal_Int64 SAL_CALL StyleMap::getSomething(
     throw( RuntimeException )
 {
     if( rId.getLength() == 16 &&
-        0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+        0 == memcmp( getUnoTunnelId().getConstArray(),
                                              rId.getConstArray(), 16 ) )
     {
         return reinterpret_cast<sal_Int64>( this );
diff --git a/xmloff/source/transform/MutableAttrList.cxx b/xmloff/source/transform/MutableAttrList.cxx
index 9b4919a..424f241 100644
--- a/xmloff/source/transform/MutableAttrList.cxx
+++ b/xmloff/source/transform/MutableAttrList.cxx
@@ -26,9 +26,10 @@
  *
  ************************************************************************/
 
+#include <string.h>
+
 #include <osl/mutex.hxx>
 #include <xmloff/xmltoken.hxx>
-#include <rtl/memory.h>
 #include <xmloff/attrlist.hxx>
 #include <comphelper/servicehelper.hxx>
 #include "MutableAttrList.hxx"
@@ -89,7 +90,7 @@ sal_Int64 SAL_CALL XMLMutableAttributeList::getSomething(
     throw( RuntimeException )
 {
     if( rId.getLength() == 16 &&
-        0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+        0 == memcmp( getUnoTunnelId().getConstArray(),
                                 rId.getConstArray(), 16 ) )
     {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index 35824f8..07e6185 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -2033,7 +2033,7 @@ sal_Int64 SAL_CALL OOo2OasisTransformer::getSomething( const Sequence< sal_Int8
     throw(RuntimeException)
 {
     if( rId.getLength() == 16
-        && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+        && 0 == memcmp( getUnoTunnelId().getConstArray(),
                                         rId.getConstArray(), 16 ) )
     {
         return reinterpret_cast< sal_Int64 >( this );
diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx
index 0f12574..ccafd05 100644
--- a/xmloff/source/transform/Oasis2OOo.cxx
+++ b/xmloff/source/transform/Oasis2OOo.cxx
@@ -2018,7 +2018,7 @@ sal_Int64 SAL_CALL Oasis2OOoTransformer::getSomething( const Sequence< sal_Int8
     throw(RuntimeException)
 {
     if( rId.getLength() == 16
-        && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+        && 0 == memcmp( getUnoTunnelId().getConstArray(),
                                         rId.getConstArray(), 16 ) )
     {
         return reinterpret_cast< sal_Int64 >( this );
commit 9b2e6d45369afbd72ace364adb15e7c8c30a9c9c
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sat Aug 4 11:56:03 2012 +0200

    Replace usage of rtl/memory.h in xmlsecurity their equivalent from string.h
    
    Change-Id: Id4a088864ee28163160d6ac408592952fe6c797d

diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 69634fe..1420b02 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <string.h>
 
 #ifdef _MSC_VER
 #pragma warning(push,1)
@@ -48,8 +49,6 @@
 #include <osl/nlsupport.h>
 #include <osl/process.h>
 
-#include <rtl/memory.h>
-
 #include "../diagnose.hxx"
 
 using namespace xmlsecurity;
@@ -211,7 +210,7 @@ Reference< XSingleServiceFactory > SecurityEnvironment_MSCryptImpl :: impl_creat
 sal_Int64 SAL_CALL SecurityEnvironment_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
     throw( RuntimeException )
 {
-    if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+    if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
         return ( sal_Int64 )this ;
     }
     return 0 ;
@@ -947,7 +946,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl :: verifyCertificate(
     CERT_ENHKEY_USAGE   enhKeyUsage ;
     CERT_USAGE_MATCH    certUsage ;
     CERT_CHAIN_PARA     chainPara ;
-    rtl_zeroMemory(&chainPara, sizeof(CERT_CHAIN_PARA));
+    memset(&chainPara, 0, sizeof(CERT_CHAIN_PARA));
 
     //Prepare parameter for CertGetCertificateChain
     enhKeyUsage.cUsageIdentifier = 0 ;
diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
index fc770ff..23363e7 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <string.h>
+
 #include <sal/config.h>
 #include <comphelper/servicehelper.hxx>
 #include "x509certificate_mscryptimpl.hxx"
@@ -471,7 +473,7 @@ void X509Certificate_MSCryptImpl :: setRawCert( Sequence< sal_Int8 > rawCert ) t
 
 /* XUnoTunnel */
 sal_Int64 SAL_CALL X509Certificate_MSCryptImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) throw( RuntimeException ) {
-    if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+    if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
         return ( sal_Int64 )this ;
     }
     return 0 ;
diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
index 22a3793..0f562b4 100644
--- a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
+++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
@@ -130,23 +130,23 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c
         if ( nToConvertLen == 0 )
         {
             m_aLastBlock.realloc( nOldLastBlockLen + aData.getLength() );
-            rtl_copyMemory( m_aLastBlock.getArray() + nOldLastBlockLen, aData.getConstArray(), aData.getLength() );
+            memcpy( m_aLastBlock.getArray() + nOldLastBlockLen, aData.getConstArray(), aData.getLength() );
             // aToConvert stays empty
         }
         else if ( nToConvertLen < nOldLastBlockLen )
         {
-            rtl_copyMemory( aToConvert.getArray(), m_aLastBlock.getConstArray(), nToConvertLen );
-            rtl_copyMemory( m_aLastBlock.getArray(), m_aLastBlock.getConstArray() + nToConvertLen, nOldLastBlockLen - nToConvertLen );
+            memcpy( aToConvert.getArray(), m_aLastBlock.getConstArray(), nToConvertLen );
+            memcpy( m_aLastBlock.getArray(), m_aLastBlock.getConstArray() + nToConvertLen, nOldLastBlockLen - nToConvertLen );
             m_aLastBlock.realloc( nOldLastBlockLen - nToConvertLen + aData.getLength() );
-            rtl_copyMemory( m_aLastBlock.getArray() + nOldLastBlockLen - nToConvertLen, aData.getConstArray(), aData.getLength() );
+            memcpy( m_aLastBlock.getArray() + nOldLastBlockLen - nToConvertLen, aData.getConstArray(), aData.getLength() );
         }
         else
         {
-            rtl_copyMemory( aToConvert.getArray(), m_aLastBlock.getConstArray(), nOldLastBlockLen );
+            memcpy( aToConvert.getArray(), m_aLastBlock.getConstArray(), nOldLastBlockLen );
             if ( nToConvertLen > nOldLastBlockLen )
-                rtl_copyMemory( aToConvert.getArray() + nOldLastBlockLen, aData.getConstArray(), nToConvertLen - nOldLastBlockLen );
+                memcpy( aToConvert.getArray() + nOldLastBlockLen, aData.getConstArray(), nToConvertLen - nOldLastBlockLen );
             m_aLastBlock.realloc( nAvailableData - nToConvertLen );
-            rtl_copyMemory( m_aLastBlock.getArray(), aData.getConstArray() + nToConvertLen - nOldLastBlockLen, nAvailableData - nToConvertLen );
+            memcpy( m_aLastBlock.getArray(), aData.getConstArray() + nToConvertLen - nOldLastBlockLen, nAvailableData - nToConvertLen );
         }
     }
 
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index a547b12..5213627 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -223,7 +223,7 @@ Reference< XSingleServiceFactory > SecurityEnvironment_NssImpl :: impl_createFac
 sal_Int64 SAL_CALL SecurityEnvironment_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier )
     throw( RuntimeException )
 {
-    if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+    if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
     }
     return 0 ;
diff --git a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
index 9f42c25..1b02955 100644
--- a/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/x509certificate_nssimpl.cxx
@@ -304,7 +304,7 @@ void X509Certificate_NssImpl :: setRawCert( Sequence< sal_Int8 > rawCert ) throw
 
 /* XUnoTunnel */
 sal_Int64 SAL_CALL X509Certificate_NssImpl :: getSomething( const Sequence< sal_Int8 >& aIdentifier ) throw( RuntimeException ) {
-    if( aIdentifier.getLength() == 16 && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
+    if( aIdentifier.getLength() == 16 && 0 == memcmp( getUnoTunnelId().getConstArray(), aIdentifier.getConstArray(), 16 ) ) {
         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_uIntPtr>(this));
     }
     return 0 ;
diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
index f46ae4c..57c90a6 100644
--- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <string.h>
 
 #include "xmlelementwrapper_xmlsecimpl.hxx"
 #include <cppuhelper/typeprovider.hxx>
@@ -56,7 +57,7 @@ sal_Int64 SAL_CALL XMLElementWrapper_XmlSecImpl::getSomething( const cssu::Seque
     throw (cssu::RuntimeException)
 {
     if (aIdentifier.getLength() == 16 &&
-        0 == rtl_compareMemory(
+        0 == memcmp(
             getUnoTunnelImplementationId().getConstArray(),
             aIdentifier.getConstArray(),
             16 ))


More information about the Libreoffice-commits mailing list