diff options
Diffstat (limited to 'registry')
-rw-r--r-- | registry/source/regimpl.cxx | 6 | ||||
-rw-r--r-- | registry/source/registry.cxx | 8 |
2 files changed, 4 insertions, 10 deletions
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 37813095e0af..039cde3270b7 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -1616,14 +1616,13 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ sal::static_int_cast< unsigned long >(len)); fprintf(stdout, "%s Data = ", indent); - sal_Char *pValue; for (sal_uInt32 i=0; i < len; i++) { readUINT32(pBuffer+offset, sLen); offset += 4; // 4 Bytes (sal_uInt32) fuer die Groesse des strings in Bytes - pValue = (sal_Char*)rtl_allocateMemory(sLen); + sal_Char *pValue = (sal_Char*)rtl_allocateMemory(sLen); readUtf8(pBuffer+offset, pValue, sLen); if (offset > 8) @@ -1654,7 +1653,6 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ sal::static_int_cast< unsigned long >(len)); fprintf(stdout, "%s Data = ", indent); - sal_Unicode *pValue; OString uStr; for (sal_uInt32 i=0; i < len; i++) { @@ -1662,7 +1660,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_ offset += 4; // 4 Bytes (sal_uInt32) fuer die Groesse des strings in Bytes - pValue = (sal_Unicode*)rtl_allocateMemory((sLen / 2) * sizeof(sal_Unicode)); + sal_Unicode *pValue = (sal_Unicode*)rtl_allocateMemory((sLen / 2) * sizeof(sal_Unicode)); readString(pBuffer+offset, pValue, sLen); if (offset > 8) diff --git a/registry/source/registry.cxx b/registry/source/registry.cxx index 803372fa8028..3086adb44b2e 100644 --- a/registry/source/registry.cxx +++ b/registry/source/registry.cxx @@ -74,11 +74,9 @@ static void REGISTRY_CALLTYPE release(RegHandle hReg) static RegError REGISTRY_CALLTYPE getName(RegHandle hReg, rtl_uString** pName) { - ORegistry* pReg; - if (hReg) { - pReg = (ORegistry*)hReg; + ORegistry* pReg = (ORegistry*)hReg; if ( pReg->isOpen() ) { rtl_uString_assign(pName, pReg->getName().pData); @@ -580,11 +578,9 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryN REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_closeRegistry(RegHandle hRegistry) { - ORegistry* pReg; - if (hRegistry) { - pReg = (ORegistry*)hRegistry; + ORegistry* pReg = (ORegistry*)hRegistry; delete(pReg); return REG_NO_ERROR; } else |