summaryrefslogtreecommitdiff
path: root/registry
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2015-08-22 16:50:56 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-08-23 06:02:42 +0000
commitb712b1f63492a311e4a51cffd516b3e202a140e6 (patch)
tree6703ded631b477680b87da3f1fe6b398c595e5f7 /registry
parent93cd7b78c29c11ccc87c19c845c6617acb834630 (diff)
tdf#39440 cppcheck: redundantAssignment
This addresses some of cppcheck's "redundantAssignment" warnings ("Variable '<varName>' is reassigned a value before the old one has been used"). Change-Id: I8fd2950d5aa1a3f4bd9e1c4c336abe465d1f657e Reviewed-on: https://gerrit.libreoffice.org/17926 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'registry')
-rw-r--r--registry/source/regimpl.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
index 3499a5a83167..92a4187c8a5d 100644
--- a/registry/source/regimpl.cxx
+++ b/registry/source/regimpl.cxx
@@ -904,11 +904,10 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey)
RegError ORegistry::loadKey(RegKeyHandle hKey, const OUString& regFileName,
bool bWarnings, bool bReport)
{
- RegError _ret = RegError::NO_ERROR;
ORegKey* pKey = static_cast< ORegKey* >(hKey);
std::unique_ptr< ORegistry > pReg (new ORegistry());
- _ret = pReg->initRegistry(regFileName, RegAccessMode::READONLY);
+ RegError _ret = pReg->initRegistry(regFileName, RegAccessMode::READONLY);
if (_ret != RegError::NO_ERROR)
return _ret;
ORegKey* pRootKey = pReg->getRootKey();
@@ -952,11 +951,10 @@ RegError ORegistry::loadKey(RegKeyHandle hKey, const OUString& regFileName,
RegError ORegistry::saveKey(RegKeyHandle hKey, const OUString& regFileName,
bool bWarnings, bool bReport)
{
- RegError _ret = RegError::NO_ERROR;
ORegKey* pKey = static_cast< ORegKey* >(hKey);
std::unique_ptr< ORegistry > pReg (new ORegistry());
- _ret = pReg->initRegistry(regFileName, RegAccessMode::READWRITE, true/*bCreate*/);
+ RegError _ret = pReg->initRegistry(regFileName, RegAccessMode::READWRITE, true/*bCreate*/);
if (_ret != RegError::NO_ERROR)
return _ret;
ORegKey* pRootKey = pReg->getRootKey();