diff options
author | Arnaud Versini <arnaud.versini@gmail.com> | 2012-08-04 14:54:23 +0200 |
---|---|---|
committer | Arnaud Versini <arnaud.versini@gmail.com> | 2012-08-04 17:46:59 +0200 |
commit | f6acb53bb124e6f01e82ace35ce40f02da5a4e5d (patch) | |
tree | c840aa69bf185723a3dd5ab9a930ad854e9f30b8 /registry | |
parent | 7378c5cb16959aafa32c101d96f32557598d7493 (diff) |
Replace usage of rtl/memory.h in registry with equivalent from string.h
Change-Id: I3c442b7c3743684f62cc5ffc3c4b0926ff0db999
Diffstat (limited to 'registry')
-rw-r--r-- | registry/source/keyimpl.cxx | 21 | ||||
-rw-r--r-- | registry/source/reflwrit.cxx | 2 | ||||
-rw-r--r-- | registry/source/regimpl.cxx | 4 | ||||
-rw-r--r-- | registry/tools/regcompare.cxx | 2 |
4 files changed, 15 insertions, 14 deletions
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index e4c0325e5895..8a1234f76054 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 fca4023ab61b..1c644e956eee 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 d6bd01766f8f..d51aafdc53e2 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 46c982404916..f9a72d75da08 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); |