From 16f0c1315bf29b9da342d669709da28eb22b8390 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Nov 2015 10:21:10 +0100 Subject: loplugin:nullptr (automatic rewrite) Change-Id: Ie5a37a49f1b1c08a20f89e167ca415fc645ed40d --- registry/source/keyimpl.cxx | 50 ++++++++--------- registry/source/reflread.cxx | 126 +++++++++++++++++++++---------------------- registry/source/reflwrit.cxx | 46 ++++++++-------- registry/source/regimpl.cxx | 10 ++-- registry/source/registry.cxx | 22 ++++---- registry/source/regkey.cxx | 46 ++++++++-------- 6 files changed, 150 insertions(+), 150 deletions(-) (limited to 'registry/source') diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx index 75256d4b54af..a2908e12cf7d 100644 --- a/registry/source/keyimpl.cxx +++ b/registry/source/keyimpl.cxx @@ -85,7 +85,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK { RegError _ret = RegError::NO_ERROR; - *phOpenSubKeys = 0; + *phOpenSubKeys = nullptr; *pnSubKeys = 0; ORegKey* pKey = this; @@ -113,11 +113,11 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK { OUString const sSubKeyName = iter.m_pszName; - ORegKey* pOpenSubKey = 0; + ORegKey* pOpenSubKey = nullptr; _ret = pKey->openKey(sSubKeyName, reinterpret_cast(&pOpenSubKey)); if (_ret != RegError::NO_ERROR) { - *phOpenSubKeys = NULL; + *phOpenSubKeys = nullptr; *pnSubKeys = 0; rtl_freeMemory(pSubKeys); // @@@ leaking 'pSubKeys[0...nSubkeys-1]' return _ret; // @@@ leaking 'pKey' @@ -149,7 +149,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName, { RegError _ret = RegError::NO_ERROR; - *pSubKeyNames = 0; + *pSubKeyNames = nullptr; *pnSubKeys = 0; ORegKey* pKey = this; @@ -163,7 +163,7 @@ RegError ORegKey::getKeyNames(const OUString& keyName, sal_uInt32 nSubKeys = pKey->countSubKeys(); *pnSubKeys = nSubKeys; - rtl_uString** pSubKeys = 0; + rtl_uString** pSubKeys = nullptr; pSubKeys = static_cast(rtl_allocateZeroMemory(nSubKeys * sizeof(rtl_uString*))); OStoreDirectory::iterator iter; @@ -672,7 +672,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue if (rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; return RegError::VALUE_NOT_EXISTS; } @@ -682,14 +682,14 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue sal_uInt32 readBytes; if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) ) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; } if (readBytes != VALUE_HEADERSIZE) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -700,7 +700,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue if (valueType != RegValueType::LONGLIST) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -714,7 +714,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue /* surely 10 millions entry in a registry list should be enough */ if(valueSize > 40000000) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -723,14 +723,14 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) ) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; } if (readBytes != valueSize) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -742,7 +742,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue /* make sure the declared size of the arry is consistent with the amount of data we have read */ if(len > (valueSize - 4) / 4) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -786,7 +786,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal if ( rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; return RegError::VALUE_NOT_EXISTS; } @@ -796,14 +796,14 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal sal_uInt32 readBytes; if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) ) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; } if (readBytes != VALUE_HEADERSIZE) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -814,7 +814,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal if (valueType != RegValueType::STRINGLIST) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -828,14 +828,14 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) ) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; } if (readBytes != valueSize) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -892,7 +892,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** if ( rValue.create(getStoreFile(), m_name + m_pRegistry->ROOT, sImplValueName, accessMode) ) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; return RegError::VALUE_NOT_EXISTS; } @@ -902,14 +902,14 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** sal_uInt32 readBytes; if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) ) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; } if (readBytes != VALUE_HEADERSIZE) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -920,7 +920,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** if (valueType != RegValueType::UNICODELIST) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; @@ -934,14 +934,14 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode*** if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) ) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; } if (readBytes != valueSize) { - pValueList = NULL; + pValueList = nullptr; *pLen = 0; rtl_freeMemory(pBuffer); return RegError::INVALID_VALUE; diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx index ef7d4e42f29c..310d10bf6470 100644 --- a/registry/source/reflread.cxx +++ b/registry/source/reflread.cxx @@ -157,7 +157,7 @@ BlopObject::BlopObject(const sal_uInt8* buffer, sal_uInt32 len, bool copyBuffer) { if (m_isCopied) { - m_pBuffer = 0; + m_pBuffer = nullptr; sal_uInt8* newBuffer = new sal_uInt8[len]; memcpy(newBuffer, buffer, len); m_pBuffer = newBuffer; @@ -197,7 +197,7 @@ public: }; StringCache::StringCache(sal_uInt16 size) - : m_stringTable(NULL) + : m_stringTable(nullptr) , m_numOfStrings(size) , m_stringsCopied(0) { @@ -205,7 +205,7 @@ StringCache::StringCache(sal_uInt16 size) for (sal_uInt16 i = 0; i < m_numOfStrings; i++) { - m_stringTable[i] = NULL; + m_stringTable[i] = nullptr; } } @@ -227,7 +227,7 @@ const sal_Unicode* StringCache::getString(sal_uInt16 index) if ((index > 0) && (index <= m_stringsCopied)) return m_stringTable[index - 1]; else - return NULL; + return nullptr; } sal_uInt16 StringCache::createString(const sal_uInt8* buffer) @@ -613,7 +613,7 @@ public: const sal_Char* FieldList::getFieldName(sal_uInt16 index) { - const sal_Char* aName = NULL; + const sal_Char* aName = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -629,7 +629,7 @@ const sal_Char* FieldList::getFieldName(sal_uInt16 index) const sal_Char* FieldList::getFieldType(sal_uInt16 index) { - const sal_Char* aName = NULL; + const sal_Char* aName = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -724,7 +724,7 @@ RTValueType FieldList::getFieldConstValue(sal_uInt16 index, RTConstValueUnion* v const sal_Char* FieldList::getFieldDoku(sal_uInt16 index) { - const sal_Char* aDoku = NULL; + const sal_Char* aDoku = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -740,7 +740,7 @@ const sal_Char* FieldList::getFieldDoku(sal_uInt16 index) const sal_Char* FieldList::getFieldFileName(sal_uInt16 index) { - const sal_Char* aFileName = NULL; + const sal_Char* aFileName = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -794,7 +794,7 @@ public: const sal_Char* ReferenceList::getReferenceName(sal_uInt16 index) { - const sal_Char* aName = NULL; + const sal_Char* aName = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -826,7 +826,7 @@ RTReferenceType ReferenceList::getReferenceType(sal_uInt16 index) const sal_Char* ReferenceList::getReferenceDoku(sal_uInt16 index) { - const sal_Char* aDoku = NULL; + const sal_Char* aDoku = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -943,7 +943,7 @@ sal_uInt32 MethodList::parseIndex() const sal_Char* MethodList::getMethodName(sal_uInt16 index) { - const sal_Char* aName = NULL; + const sal_Char* aName = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -975,7 +975,7 @@ sal_uInt16 MethodList::getMethodParamCount(sal_uInt16 index) const sal_Char* MethodList::getMethodParamType(sal_uInt16 index, sal_uInt16 paramIndex) { - const sal_Char* aName = NULL; + const sal_Char* aName = nullptr; try { if ((m_numOfEntries > 0) && (index <= m_numOfEntries) && @@ -995,7 +995,7 @@ const sal_Char* MethodList::getMethodParamType(sal_uInt16 index, sal_uInt16 para const sal_Char* MethodList::getMethodParamName(sal_uInt16 index, sal_uInt16 paramIndex) { - const sal_Char* aName = NULL; + const sal_Char* aName = nullptr; try { if ((m_numOfEntries > 0) && (index <= m_numOfEntries) && @@ -1050,7 +1050,7 @@ sal_uInt16 MethodList::getMethodExcCount(sal_uInt16 index) const sal_Char* MethodList::getMethodExcType(sal_uInt16 index, sal_uInt16 excIndex) { - const sal_Char* aName = NULL; + const sal_Char* aName = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -1074,7 +1074,7 @@ const sal_Char* MethodList::getMethodExcType(sal_uInt16 index, sal_uInt16 excInd const sal_Char* MethodList::getMethodReturnType(sal_uInt16 index) { - const sal_Char* aName = NULL; + const sal_Char* aName = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -1106,7 +1106,7 @@ RTMethodMode MethodList::getMethodMode(sal_uInt16 index) const sal_Char* MethodList::getMethodDoku(sal_uInt16 index) { - const sal_Char* aDoku = NULL; + const sal_Char* aDoku = nullptr; if ((m_numOfEntries > 0) && (index <= m_numOfEntries)) { @@ -1215,7 +1215,7 @@ bool TYPEREG_CALLTYPE typereg_reader_create( typereg_Version maxVersion, void ** result) { if (length < OFFSET_CP || length > SAL_MAX_UINT32) { - *result = 0; + *result = nullptr; return true; } std::unique_ptr< TypeRegistryEntry > entry; @@ -1229,12 +1229,12 @@ bool TYPEREG_CALLTYPE typereg_reader_create( return false; } if (entry->readUINT32(OFFSET_SIZE) != length) { - *result = 0; + *result = nullptr; return true; } typereg_Version version = entry->getVersion();; if (version < TYPEREG_VERSION_0 || version > maxVersion) { - *result = 0; + *result = nullptr; return true; } *result = entry.release(); @@ -1256,7 +1256,7 @@ void TYPEREG_CALLTYPE typereg_reader_acquire(void * hEntry) { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry != NULL) + if (pEntry != nullptr) pEntry->m_refCount++; } @@ -1264,7 +1264,7 @@ void TYPEREG_CALLTYPE typereg_reader_release(void * hEntry) { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry != NULL) + if (pEntry != nullptr) { if (--pEntry->m_refCount == 0) delete pEntry; @@ -1316,7 +1316,7 @@ void TYPEREG_CALLTYPE typereg_reader_getTypeName(void * hEntry, rtl_uString** pT try { const sal_Char* pTmp = pEntry->m_pCP->readUTF8NameConstant(pEntry->readUINT16(OFFSET_THIS_TYPE)); rtl_string2UString( - pTypeName, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pTypeName, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); return; } catch (BlopObject::BoundsError &) { @@ -1334,7 +1334,7 @@ static void TYPEREG_CALLTYPE getSuperTypeName(TypeReaderImpl hEntry, rtl_uString try { const sal_Char* pTmp = pEntry->m_pCP->readUTF8NameConstant(pEntry->readUINT16(pEntry->m_offset_SUPERTYPES )); //+ (index * sizeof(sal_uInt16)))); rtl_string2UString( - pSuperTypeName, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pSuperTypeName, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); return; } catch (BlopObject::BoundsError &) { @@ -1351,7 +1351,7 @@ void TYPEREG_CALLTYPE typereg_reader_getDocumentation(void * hEntry, rtl_uString try { const sal_Char* pTmp = pEntry->m_pCP->readUTF8NameConstant(pEntry->readUINT16(OFFSET_DOKU)); rtl_string2UString( - pDoku, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pDoku, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); return; } catch (BlopObject::BoundsError &) { @@ -1368,7 +1368,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFileName(void * hEntry, rtl_uString** pF try { const sal_Char* pTmp = pEntry->m_pCP->readUTF8NameConstant(pEntry->readUINT16(OFFSET_FILENAME)); rtl_string2UString( - pFileName, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pFileName, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); return; } catch (BlopObject::BoundsError &) { @@ -1383,7 +1383,7 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getFieldCount(void * hEntry) { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return 0; + if (pEntry == nullptr) return 0; return pEntry->m_pFields->m_numOfEntries; } @@ -1397,14 +1397,14 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldName(void * hEntry, rtl_uString** p { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pFieldName); return; } const sal_Char* pTmp = pEntry->m_pFields->getFieldName(index); rtl_string2UString( - pFieldName, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pFieldName, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1412,7 +1412,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldTypeName(void * hEntry, rtl_uString { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pFieldType); return; @@ -1420,7 +1420,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldTypeName(void * hEntry, rtl_uString const sal_Char* pTmp = pEntry->m_pFields->getFieldType(index); rtl_string2UString( - pFieldType, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pFieldType, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1428,7 +1428,7 @@ RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getFieldFlags(void * hEntry, sal_u { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return RTFieldAccess::INVALID; + if (pEntry == nullptr) return RTFieldAccess::INVALID; return pEntry->m_pFields->getFieldAccess(index); } @@ -1439,7 +1439,7 @@ bool TYPEREG_CALLTYPE typereg_reader_getFieldValue( { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) { + if (pEntry == nullptr) { *type = RT_TYPE_NONE; return true; } @@ -1463,7 +1463,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldDocumentation(void * hEntry, rtl_uS { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pDoku); return; @@ -1471,7 +1471,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldDocumentation(void * hEntry, rtl_uS const sal_Char* pTmp = pEntry->m_pFields->getFieldDoku(index); rtl_string2UString( - pDoku, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pDoku, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1479,7 +1479,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldFileName(void * hEntry, rtl_uString { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pFieldFileName); return; @@ -1487,7 +1487,7 @@ void TYPEREG_CALLTYPE typereg_reader_getFieldFileName(void * hEntry, rtl_uString const sal_Char* pTmp = pEntry->m_pFields->getFieldFileName(index); rtl_string2UString( - pFieldFileName, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pFieldFileName, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1496,7 +1496,7 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodCount(void * hEntry) { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return 0; + if (pEntry == nullptr) return 0; return pEntry->m_pMethods->m_numOfEntries; } @@ -1505,7 +1505,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodName(void * hEntry, rtl_uString** { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pMethodName); return; @@ -1513,7 +1513,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodName(void * hEntry, rtl_uString** const sal_Char* pTmp = pEntry->m_pMethods->getMethodName(index); rtl_string2UString( - pMethodName, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pMethodName, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1522,7 +1522,7 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodParameterCount( { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return 0; + if (pEntry == nullptr) return 0; return pEntry->m_pMethods->getMethodParamCount(index); } @@ -1531,7 +1531,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodParameterTypeName(void * hEntry, r { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pMethodParamType); return; @@ -1539,7 +1539,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodParameterTypeName(void * hEntry, r const sal_Char* pTmp = pEntry->m_pMethods->getMethodParamType(index, paramIndex); rtl_string2UString( - pMethodParamType, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pMethodParamType, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1547,7 +1547,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodParameterName(void * hEntry, rtl_u { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pMethodParamName); return; @@ -1555,7 +1555,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodParameterName(void * hEntry, rtl_u const sal_Char* pTmp = pEntry->m_pMethods->getMethodParamName(index, paramIndex); rtl_string2UString( - pMethodParamName, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pMethodParamName, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1563,7 +1563,7 @@ RTParamMode TYPEREG_CALLTYPE typereg_reader_getMethodParameterFlags(void * hEntr { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return RT_PARAM_INVALID; + if (pEntry == nullptr) return RT_PARAM_INVALID; return pEntry->m_pMethods->getMethodParamMode(index, paramIndex); } @@ -1573,7 +1573,7 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodExceptionCount( { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return 0; + if (pEntry == nullptr) return 0; return pEntry->m_pMethods->getMethodExcCount(index); } @@ -1582,7 +1582,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodExceptionTypeName(void * hEntry, r { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pMethodExcpType); return; @@ -1590,7 +1590,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodExceptionTypeName(void * hEntry, r const sal_Char* pTmp = pEntry->m_pMethods->getMethodExcType(index, excIndex); rtl_string2UString( - pMethodExcpType, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pMethodExcpType, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1598,7 +1598,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodReturnTypeName(void * hEntry, rtl_ { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pMethodReturnType); return; @@ -1606,7 +1606,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodReturnTypeName(void * hEntry, rtl_ const sal_Char* pTmp = pEntry->m_pMethods->getMethodReturnType(index); rtl_string2UString( - pMethodReturnType, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pMethodReturnType, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1614,7 +1614,7 @@ RTMethodMode TYPEREG_CALLTYPE typereg_reader_getMethodFlags(void * hEntry, sal_u { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return RTMethodMode::INVALID; + if (pEntry == nullptr) return RTMethodMode::INVALID; return pEntry->m_pMethods->getMethodMode(index); } @@ -1623,7 +1623,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodDocumentation(void * hEntry, rtl_u { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pMethodDoku); return; @@ -1631,7 +1631,7 @@ void TYPEREG_CALLTYPE typereg_reader_getMethodDocumentation(void * hEntry, rtl_u const sal_Char* pTmp = pEntry->m_pMethods->getMethodDoku(index); rtl_string2UString( - pMethodDoku, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pMethodDoku, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1639,7 +1639,7 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getReferenceCount(void * hEntry) { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return 0; + if (pEntry == nullptr) return 0; return pEntry->m_pReferences->m_numOfEntries; } @@ -1648,7 +1648,7 @@ void TYPEREG_CALLTYPE typereg_reader_getReferenceTypeName(void * hEntry, rtl_uSt { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pReferenceName); return; @@ -1656,7 +1656,7 @@ void TYPEREG_CALLTYPE typereg_reader_getReferenceTypeName(void * hEntry, rtl_uSt const sal_Char* pTmp = pEntry->m_pReferences->getReferenceName(index); rtl_string2UString( - pReferenceName, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pReferenceName, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1664,7 +1664,7 @@ RTReferenceType TYPEREG_CALLTYPE typereg_reader_getReferenceSort(void * hEntry, { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return RTReferenceType::INVALID; + if (pEntry == nullptr) return RTReferenceType::INVALID; return pEntry->m_pReferences->getReferenceType(index); } @@ -1673,7 +1673,7 @@ void TYPEREG_CALLTYPE typereg_reader_getReferenceDocumentation(void * hEntry, rt { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) + if (pEntry == nullptr) { rtl_uString_new(pReferenceDoku); return; @@ -1681,7 +1681,7 @@ void TYPEREG_CALLTYPE typereg_reader_getReferenceDocumentation(void * hEntry, rt const sal_Char* pTmp = pEntry->m_pReferences->getReferenceDoku(index); rtl_string2UString( - pReferenceDoku, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pReferenceDoku, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); } @@ -1689,7 +1689,7 @@ RTFieldAccess TYPEREG_CALLTYPE typereg_reader_getReferenceFlags(void * hEntry, s { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return RTFieldAccess::INVALID; + if (pEntry == nullptr) return RTFieldAccess::INVALID; return pEntry->m_pReferences->getReferenceAccess(index); } @@ -1698,7 +1698,7 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getSuperTypeCount(void * hEntry) { TypeRegistryEntry* pEntry = static_cast(hEntry); - if (pEntry == NULL) return 0; + if (pEntry == nullptr) return 0; return pEntry->m_nSuperTypes; } @@ -1712,7 +1712,7 @@ void TYPEREG_CALLTYPE typereg_reader_getSuperTypeName( OSL_ASSERT(index < pEntry->m_nSuperTypes); const sal_Char* pTmp = pEntry->m_pCP->readUTF8NameConstant(pEntry->readUINT16(pEntry->m_offset_SUPERTYPES + (index * sizeof(sal_uInt16)))); rtl_string2UString( - pSuperTypeName, pTmp, pTmp == 0 ? 0 : rtl_str_getLength(pTmp), + pSuperTypeName, pTmp, pTmp == nullptr ? 0 : rtl_str_getLength(pTmp), RTL_TEXTENCODING_UTF8, OSTRING_TO_OUSTRING_CVTFLAGS); return; } catch (BlopObject::BoundsError &) { @@ -1725,7 +1725,7 @@ void TYPEREG_CALLTYPE typereg_reader_getSuperTypeName( RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer, sal_uInt32 bufferLen, bool copyData) - : m_hImpl(NULL) + : m_hImpl(nullptr) { m_hImpl = createEntry(buffer, bufferLen, copyData); } diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx index febfbc696d2e..b7ab081d7b25 100644 --- a/registry/source/reflwrit.cxx +++ b/registry/source/reflwrit.cxx @@ -196,7 +196,7 @@ struct CPInfo CPInfo::CPInfo(CPInfoTag tag, struct CPInfo* prev) : m_tag(tag) , m_index(0) - , m_next(NULL) + , m_next(nullptr) { if (prev) { @@ -377,8 +377,8 @@ void FieldEntry::setData(const OString& name, RTValueType constValueType, RTConstValueUnion constValue) { - sal_Unicode * newValue = 0; - if (constValueType == RT_TYPE_STRING && constValue.aString != 0) { + sal_Unicode * newValue = nullptr; + if (constValueType == RT_TYPE_STRING && constValue.aString != nullptr) { sal_Int32 n = rtl_ustr_getLength(constValue.aString) + 1; newValue = new sal_Unicode[n]; memcpy(newValue, constValue.aString, n * sizeof (sal_Unicode)); @@ -403,7 +403,7 @@ void FieldEntry::setData(const OString& name, if (m_constValueType == RT_TYPE_STRING) { - if (constValue.aString == NULL) + if (constValue.aString == nullptr) m_constValue.aString = NULL_WSTRING; else { @@ -581,7 +581,7 @@ void MethodEntry::reallocParams(sal_uInt16 size) if (size) newParams = new ParamEntry[size]; else - newParams = NULL; + newParams = nullptr; if (m_paramCount) { @@ -607,7 +607,7 @@ void MethodEntry::reallocExcs(sal_uInt16 size) if (size) newExcNames = new OString[size]; else - newExcNames = NULL; + newExcNames = nullptr; sal_uInt16 i; sal_uInt16 mn = size < m_excCount ? size : m_excCount; @@ -687,15 +687,15 @@ TypeWriter::TypeWriter(typereg_Version version, RTTypeClass | (published ? RT_TYPE_PUBLISHED : 0))) , m_typeName(typeName) , m_nSuperTypes(superTypeCount) - , m_pUik(NULL) + , m_pUik(nullptr) , m_doku(documentation) , m_fileName(fileName) , m_fieldCount(fieldCount) - , m_fields(NULL) + , m_fields(nullptr) , m_methodCount(methodCount) - , m_methods(NULL) + , m_methods(nullptr) , m_referenceCount(referenceCount) - , m_references(NULL) + , m_references(nullptr) , m_blopSize(0) { if (m_nSuperTypes > 0) @@ -703,7 +703,7 @@ TypeWriter::TypeWriter(typereg_Version version, m_superTypeNames = new OString[m_nSuperTypes]; } else { - m_superTypeNames = NULL; + m_superTypeNames = nullptr; } if (m_fieldCount) @@ -743,21 +743,21 @@ void TypeWriter::createBlop() { //TODO: Fix memory leaks that occur when std::bad_alloc is thrown - sal_uInt8* pBlopFields = NULL; - sal_uInt8* pBlopMethods = NULL; - sal_uInt8* pBlopReferences = NULL; - sal_uInt8* pBuffer = NULL; + sal_uInt8* pBlopFields = nullptr; + sal_uInt8* pBlopMethods = nullptr; + sal_uInt8* pBlopReferences = nullptr; + sal_uInt8* pBuffer = nullptr; sal_uInt32 blopFieldsSize = 0; sal_uInt32 blopMethodsSize = 0; sal_uInt32 blopReferenceSize = 0; - CPInfo root(CP_TAG_INVALID, NULL); + CPInfo root(CP_TAG_INVALID, nullptr); sal_uInt16 cpIndexThisName = 0; - sal_uInt16* cpIndexSuperNames = NULL; + sal_uInt16* cpIndexSuperNames = nullptr; sal_uInt16 cpIndexUik = 0; sal_uInt16 cpIndexDoku = 0; sal_uInt16 cpIndexFileName = 0; - CPInfo* pInfo = NULL; + CPInfo* pInfo = nullptr; sal_uInt16 entrySize = sizeof(sal_uInt16); sal_uInt32 blopHeaderEntrySize = BLOP_OFFSET_N_ENTRIES + entrySize + (BLOP_HEADER_N_ENTRIES * entrySize); @@ -792,7 +792,7 @@ void TypeWriter::createBlop() } // create CP entry for uik - if (m_pUik != NULL) + if (m_pUik != nullptr) { pInfo = new CPInfo(CP_TAG_UIK, pInfo); pInfo->m_value.aUik = m_pUik; @@ -1154,7 +1154,7 @@ static void TYPEREG_CALLTYPE release(TypeWriterImpl hEntry) { TypeWriter* pEntry = static_cast(hEntry); - if (pEntry != NULL) + if (pEntry != nullptr) { if (--pEntry->m_refCount == 0) delete pEntry; @@ -1248,7 +1248,7 @@ void const * TYPEREG_CALLTYPE typereg_writer_getBlob(void * handle, sal_uInt32 * try { writer->createBlop(); } catch (std::bad_alloc &) { - return 0; + return nullptr; } } *size = writer->m_blopSize; @@ -1296,7 +1296,7 @@ void * TYPEREG_CALLTYPE typereg_writer_create( typeClass, published, toByteString(typeName), superTypeCount, fieldCount, methodCount, referenceCount); } catch (std::bad_alloc &) { - return 0; + return nullptr; } } @@ -1341,7 +1341,7 @@ RegistryTypeWriter::RegistryTypeWriter(RTTypeClass RTTypeClass, sal_uInt16 fieldCount, sal_uInt16 methodCount, sal_uInt16 referenceCount) - : m_hImpl(NULL) + : m_hImpl(nullptr) { m_hImpl = createEntry(RTTypeClass, typeName.pData, diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 92a4187c8a5d..6e262b2eb22f 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -441,7 +441,7 @@ ORegistry::ORegistry() ORegistry::~ORegistry() { ORegKey* pRootKey = m_openKeyTable[ROOT]; - if (pRootKey != 0) + if (pRootKey != nullptr) (void) releaseKey(pRootKey); if (m_file.isValid()) @@ -639,7 +639,7 @@ RegError ORegistry::createKey(RegKeyHandle hKey, const OUString& keyName, { ORegKey* pKey; - *phNewKey = NULL; + *phNewKey = nullptr; if ( keyName.isEmpty() ) return RegError::INVALID_KEYNAME; @@ -700,7 +700,7 @@ RegError ORegistry::openKey(RegKeyHandle hKey, const OUString& keyName, { ORegKey* pKey; - *phOpenKey = NULL; + *phOpenKey = nullptr; if ( keyName.isEmpty() ) { @@ -829,7 +829,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName) sFullPath += ROOT; } - ORegKey* pOldKey = 0; + ORegKey* pOldKey = nullptr; _ret = pKey->openKey(keyName, reinterpret_cast(&pOldKey)); if (_ret != RegError::NO_ERROR) return _ret; @@ -1360,7 +1360,7 @@ RegError ORegistry::loadAndSaveKeys(ORegKey* pTargetKey, m_openKeyTable[sFullKeyName]->setDeleted(false); } - ORegKey* pTmpKey = 0; + ORegKey* pTmpKey = nullptr; _ret = pSourceKey->openKey(keyName, reinterpret_cast(&pTmpKey)); if (_ret != RegError::NO_ERROR) return _ret; diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx index 97a577e7234f..b18fa570badb 100644 --- a/registry/source/registry.cxx +++ b/registry/source/registry.cxx @@ -46,7 +46,7 @@ static void REGISTRY_CALLTYPE acquire(RegHandle hReg) { ORegistry* pReg = static_cast(hReg); - if (pReg != NULL) + if (pReg != nullptr) pReg->acquire(); } @@ -63,7 +63,7 @@ static void REGISTRY_CALLTYPE release(RegHandle hReg) if (pReg->release() == 0) { delete pReg; - hReg = NULL; + hReg = nullptr; } } } @@ -117,7 +117,7 @@ static RegError REGISTRY_CALLTYPE createRegistry(rtl_uString* registryName, if ((ret = pReg->initRegistry(registryName, RegAccessMode::READWRITE, true/*bCreate*/)) != RegError::NO_ERROR) { delete pReg; - *phRegistry = NULL; + *phRegistry = nullptr; return ret; } @@ -141,7 +141,7 @@ static RegError REGISTRY_CALLTYPE openRootKey(RegHandle hReg, return RegError::REGISTRY_NOT_OPEN; } else { - phRootKey = NULL; + phRootKey = nullptr; return RegError::INVALID_REGISTRY; } @@ -163,7 +163,7 @@ static RegError REGISTRY_CALLTYPE openRegistry(rtl_uString* registryName, ORegistry* pReg = new ORegistry(); if ((_ret = pReg->initRegistry(registryName, accessMode)) != RegError::NO_ERROR) { - *phRegistry = NULL; + *phRegistry = nullptr; delete pReg; return _ret; } @@ -191,7 +191,7 @@ static RegError REGISTRY_CALLTYPE closeRegistry(RegHandle hReg) if (pReg->release() == 0) { delete(pReg); - hReg = NULL; + hReg = nullptr; } else ret = pReg->closeRegistry(); @@ -224,7 +224,7 @@ static RegError REGISTRY_CALLTYPE destroyRegistry(RegHandle hReg, if (!registryName->length) { delete(pReg); - hReg = NULL; + hReg = nullptr; } } return ret; @@ -263,7 +263,7 @@ static RegError REGISTRY_CALLTYPE loadKey(RegHandle hReg, return RegError::REGISTRY_READONLY; - ORegKey* pNewKey = 0; + ORegKey* pNewKey = nullptr; RegError _ret = pKey->openKey(keyName, reinterpret_cast(&pNewKey)); if (_ret == RegError::NO_ERROR) { @@ -311,7 +311,7 @@ static RegError REGISTRY_CALLTYPE saveKey(RegHandle hReg, if (pKey->isDeleted()) return RegError::INVALID_KEY; - ORegKey* pNewKey = 0; + ORegKey* pNewKey = nullptr; RegError _ret = pKey->openKey(keyName, reinterpret_cast(&pNewKey)); if (_ret != RegError::NO_ERROR) return _ret; @@ -354,7 +354,7 @@ static RegError REGISTRY_CALLTYPE mergeKey(RegHandle hReg, if (keyName->length) { - ORegKey* pNewKey = 0; + ORegKey* pNewKey = nullptr; RegError _ret = pKey->createKey(keyName, reinterpret_cast(&pNewKey)); if (_ret != RegError::NO_ERROR) return _ret; @@ -468,7 +468,7 @@ RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryName, if ((_ret = pReg->initRegistry(registryName, accessMode)) != RegError::NO_ERROR) { delete pReg; - *phRegistry = NULL; + *phRegistry = nullptr; return _ret; } diff --git a/registry/source/regkey.cxx b/registry/source/regkey.cxx index bf61f64db68d..7e471f0b9f43 100644 --- a/registry/source/regkey.cxx +++ b/registry/source/regkey.cxx @@ -33,7 +33,7 @@ void REGISTRY_CALLTYPE acquireKey(RegKeyHandle hKey) { ORegKey* pKey = static_cast< ORegKey* >(hKey); - if (pKey != 0) + if (pKey != nullptr) { ORegistry* pReg = pKey->getRegistry(); (void) pReg->acquireKey(pKey); @@ -47,7 +47,7 @@ void REGISTRY_CALLTYPE acquireKey(RegKeyHandle hKey) void REGISTRY_CALLTYPE releaseKey(RegKeyHandle hKey) { ORegKey* pKey = static_cast< ORegKey* >(hKey); - if (pKey != 0) + if (pKey != nullptr) { ORegistry* pReg = pKey->getRegistry(); (void) pReg->releaseKey(pKey); @@ -61,7 +61,7 @@ void REGISTRY_CALLTYPE releaseKey(RegKeyHandle hKey) sal_Bool REGISTRY_CALLTYPE isKeyReadOnly(RegKeyHandle hKey) { ORegKey* pKey = static_cast< ORegKey* >(hKey); - return pKey != 0 && pKey->isReadOnly(); + return pKey != nullptr && pKey->isReadOnly(); } @@ -90,7 +90,7 @@ RegError REGISTRY_CALLTYPE createKey(RegKeyHandle hKey, rtl_uString* keyName, RegKeyHandle* phNewKey) { - *phNewKey = 0; + *phNewKey = nullptr; ORegKey* pKey = static_cast< ORegKey* >(hKey); if (!pKey) @@ -112,7 +112,7 @@ RegError REGISTRY_CALLTYPE openKey(RegKeyHandle hKey, rtl_uString* keyName, RegKeyHandle* phOpenKey) { - *phOpenKey = 0; + *phOpenKey = nullptr; ORegKey* pKey = static_cast< ORegKey* >(hKey); if (!pKey) @@ -132,7 +132,7 @@ RegError REGISTRY_CALLTYPE openSubKeys(RegKeyHandle hKey, RegKeyHandle** pphSubKeys, sal_uInt32* pnSubKeys) { - *pphSubKeys = NULL; + *pphSubKeys = nullptr; *pnSubKeys = 0; ORegKey* pKey = static_cast< ORegKey* >(hKey); @@ -151,7 +151,7 @@ RegError REGISTRY_CALLTYPE openSubKeys(RegKeyHandle hKey, RegError REGISTRY_CALLTYPE closeSubKeys(RegKeyHandle* phSubKeys, sal_uInt32 nSubKeys) { - if (phSubKeys == 0 || nSubKeys == 0) + if (phSubKeys == nullptr || nSubKeys == 0) return RegError::INVALID_KEY; ORegistry* pReg = static_cast(phSubKeys[0])->getRegistry(); @@ -217,7 +217,7 @@ RegError REGISTRY_CALLTYPE setValue(RegKeyHandle hKey, OUString valueName("value"); if (keyName->length) { - ORegKey* pSubKey = 0; + ORegKey* pSubKey = nullptr; RegError _ret1 = pKey->openKey(keyName, reinterpret_cast(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -259,7 +259,7 @@ RegError REGISTRY_CALLTYPE setLongListValue(RegKeyHandle hKey, OUString valueName("value"); if (keyName->length) { - ORegKey* pSubKey = 0; + ORegKey* pSubKey = nullptr; RegError _ret1 = pKey->openKey(keyName, reinterpret_cast(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -301,7 +301,7 @@ RegError REGISTRY_CALLTYPE setStringListValue(RegKeyHandle hKey, OUString valueName("value"); if (keyName->length) { - ORegKey* pSubKey = 0; + ORegKey* pSubKey = nullptr; RegError _ret1 = pKey->openKey(keyName, reinterpret_cast(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -343,7 +343,7 @@ RegError REGISTRY_CALLTYPE setUnicodeListValue(RegKeyHandle hKey, OUString valueName("value"); if (keyName->length) { - ORegKey* pSubKey = 0; + ORegKey* pSubKey = nullptr; RegError _ret1 = pKey->openKey(keyName, reinterpret_cast(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -388,7 +388,7 @@ RegError REGISTRY_CALLTYPE getValueInfo(RegKeyHandle hKey, OUString valueName("value"); if (keyName->length) { - ORegKey* pSubKey = 0; + ORegKey* pSubKey = nullptr; RegError _ret = pKey->openKey(keyName, reinterpret_cast(&pSubKey)); if (_ret != RegError::NO_ERROR) return _ret; @@ -434,7 +434,7 @@ RegError REGISTRY_CALLTYPE getValue(RegKeyHandle hKey, OUString valueName("value"); if (keyName->length) { - ORegKey* pSubKey = 0; + ORegKey* pSubKey = nullptr; RegError _ret1 = pKey->openKey(keyName, reinterpret_cast(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -460,8 +460,8 @@ RegError REGISTRY_CALLTYPE getLongListValue(RegKeyHandle hKey, sal_Int32** pValueList, sal_uInt32* pLen) { - assert((pValueList != 0) && (pLen != 0) && "registry::getLongListValue(): invalid parameter"); - *pValueList = 0, *pLen = 0; + assert((pValueList != nullptr) && (pLen != nullptr) && "registry::getLongListValue(): invalid parameter"); + *pValueList = nullptr, *pLen = 0; ORegKey* pKey = static_cast< ORegKey* >(hKey); if (!pKey) @@ -473,7 +473,7 @@ RegError REGISTRY_CALLTYPE getLongListValue(RegKeyHandle hKey, OUString valueName("value"); if (keyName->length) { - ORegKey* pSubKey = 0; + ORegKey* pSubKey = nullptr; RegError _ret1 = pKey->openKey(keyName, reinterpret_cast(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -499,8 +499,8 @@ RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey, sal_Char*** pValueList, sal_uInt32* pLen) { - OSL_PRECOND((pValueList != 0) && (pLen != 0), "registry::getStringListValue(): invalid parameter"); - *pValueList = 0, *pLen = 0; + OSL_PRECOND((pValueList != nullptr) && (pLen != nullptr), "registry::getStringListValue(): invalid parameter"); + *pValueList = nullptr, *pLen = 0; ORegKey* pKey = static_cast< ORegKey* >(hKey); if (!pKey) @@ -512,7 +512,7 @@ RegError REGISTRY_CALLTYPE getStringListValue(RegKeyHandle hKey, OUString valueName("value"); if (keyName->length) { - ORegKey* pSubKey = 0; + ORegKey* pSubKey = nullptr; RegError _ret1 = pKey->openKey(keyName, reinterpret_cast(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -536,8 +536,8 @@ RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey, sal_Unicode*** pValueList, sal_uInt32* pLen) { - assert((pValueList != 0) && (pLen != 0) && "registry::getUnicodeListValue(): invalid parameter"); - *pValueList = 0, *pLen = 0; + assert((pValueList != nullptr) && (pLen != nullptr) && "registry::getUnicodeListValue(): invalid parameter"); + *pValueList = nullptr, *pLen = 0; ORegKey* pKey = static_cast< ORegKey* >(hKey); if (!pKey) @@ -549,7 +549,7 @@ RegError REGISTRY_CALLTYPE getUnicodeListValue(RegKeyHandle hKey, OUString valueName("value"); if (keyName->length) { - ORegKey* pSubKey = 0; + ORegKey* pSubKey = nullptr; RegError _ret1 = pKey->openKey(keyName, reinterpret_cast(&pSubKey)); if (_ret1 != RegError::NO_ERROR) return _ret1; @@ -607,7 +607,7 @@ RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType, return RegError::INVALID_VALUE; } - pValueList = NULL; + pValueList = nullptr; return RegError::NO_ERROR; } -- cgit