summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-11-13 19:16:08 +0100
committerKurt Zenker <kz@openoffice.org>2009-11-13 19:16:08 +0100
commit0592d0fa1b64ae5d02117c1bdb500d1a4e449558 (patch)
tree40ebfb330585a18024377484ae2a6b408b2ca062
parent8c929c2dea4c2b62cbd8c892e0386bb3d7131466 (diff)
parente37c935982d48726dc5f81ad0993157348e2d661 (diff)
CWS-TOOLING: integrate CWS cmcfixes66ooo/DEV300_m65
-rw-r--r--pyuno/zipcore/python.cxx10
-rw-r--r--registry/test/testmerge.cxx22
-rw-r--r--store/source/stordata.hxx2
3 files changed, 17 insertions, 17 deletions
diff --git a/pyuno/zipcore/python.cxx b/pyuno/zipcore/python.cxx
index bec3529e3..90ace64ff 100644
--- a/pyuno/zipcore/python.cxx
+++ b/pyuno/zipcore/python.cxx
@@ -206,7 +206,7 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
MultiByteToWideChar(CP_ACP, 0, argv[i], -1, buff, nNeededWStrBuffSize);
buff[nNeededWStrBuffSize] = 0;
cp = encode(cp, buff);
- delete buff;
+ delete [] buff;
#else
cp = encode(cp, argv[i]);
#endif
@@ -235,9 +235,9 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
exit(EXIT_FAILURE);
}
if (n != 0) {
- delete orig;
+ delete [] orig;
}
- delete value;
+ delete [] value;
n = GetEnvironmentVariableW(L"PYTHONPATH", NULL, 0);
if (n == 0) {
if (GetLastError() != ERROR_ENVVAR_NOT_FOUND) {
@@ -276,9 +276,9 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
exit(EXIT_FAILURE);
}
if (n != 0) {
- delete orig;
+ delete [] orig;
}
- delete value;
+ delete [] value;
if (!SetEnvironmentVariableW(L"PYTHONHOME", pythonhome)) {
exit(EXIT_FAILURE);
}
diff --git a/registry/test/testmerge.cxx b/registry/test/testmerge.cxx
index b3c1585d3..9652b940c 100644
--- a/registry/test/testmerge.cxx
+++ b/registry/test/testmerge.cxx
@@ -320,42 +320,42 @@ void test_merge()
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), (RegValue)Value), "testMerge error 76.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 76.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 77");
REG_ENSURE(valueType == RG_VALUETYPE_UNICODE && valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 78");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 78.a)");
REG_ENSURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 78.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 79");
REG_ENSURE(valueType == RG_VALUETYPE_BINARY && valueSize == 27, "testMerge error 80");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 80.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, "abcdefghijklmnopqrstuvwxyz") == 0, "testMerge error 80.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 81");
REG_ENSURE(valueType == RG_VALUETYPE_BINARY && valueSize == 11, "testMerge error 82");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 82.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, "1234567890") == 0, "testMerge error 82.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 83");
REG_ENSURE(valueType == RG_VALUETYPE_UNICODE&& valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 84");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 84.a)");
REG_ENSURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 84.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 85");
REG_ENSURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 86");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), (RegValue)Value), "testMerge error 86.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 86.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 87");
REG_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 88");
@@ -372,21 +372,21 @@ void test_merge()
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), (RegValue)Value), "testMerge error 92.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 92.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 93");
REG_ENSURE(valueType == RG_VALUETYPE_UNICODE && valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 94");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 94.a)");
REG_ENSURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 94.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 95");
REG_ENSURE(valueType == RG_VALUETYPE_BINARY && valueSize == 19, "testMerge error 96");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 96.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, "a1b2c3d4e5f6g7h8i9") == 0, "testMerge error 96.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 97");
REG_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 98");
@@ -398,7 +398,7 @@ void test_merge()
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), (RegValue)Value), "testMerge error 100.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 100.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 101");
REG_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 102");
@@ -416,7 +416,7 @@ void test_merge()
REG_ENSURE(!myRegistry->destroy( OUString::createFromAscii("merge2.rdb") ), "test_registry_CppApi error 12");
REG_ENSURE(!myRegistry->destroy( OUString() ), "test_registry_CppApi error 13");
- delete(myRegistry);
+ delete myRegistry;
cout << "test_merge() Ok!\n";
return;
diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx
index b86287b06..67fda8370 100644
--- a/store/source/stordata.hxx
+++ b/store/source/stordata.hxx
@@ -93,7 +93,7 @@ struct OStoreDataPageData : public store::OStorePageData
{
base::m_aGuard.m_nMagic = store::htonl(self::theTypeId);
base::m_aDescr.m_nUsed = store::htons(self::thePageSize);
- memset (m_pData, 0, capacity());
+ if (capacity()) memset (m_pData, 0, capacity());
}
/** guard (external representation).