diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-17 21:16:11 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-12-18 06:39:15 +0000 |
commit | a23f6eb3ae49dfc326c6e57a8ab95a840c0661d2 (patch) | |
tree | e4bfa45604b2a62a6683573305763dd13f195e33 /idlc/source/astenum.cxx | |
parent | remove if-block that has no effect (diff) | |
download | core-a23f6eb3ae49dfc326c6e57a8ab95a840c0661d2.tar.gz core-a23f6eb3ae49dfc326c6e57a8ab95a840c0661d2.zip |
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: Ib16e4ecc0e0c43b2c1fb527eb0668a960ae9756e
Reviewed-on: https://gerrit.libreoffice.org/13513
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'idlc/source/astenum.cxx')
-rw-r--r-- | idlc/source/astenum.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/idlc/source/astenum.cxx b/idlc/source/astenum.cxx index 1f330b18f780..32f813803c6e 100644 --- a/idlc/source/astenum.cxx +++ b/idlc/source/astenum.cxx @@ -37,13 +37,11 @@ AstConstant* AstEnum::checkValue(AstExpression* pExpr) { DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); - AstConstant* pConst = NULL; - AstDeclaration* pDecl = NULL; while ( iter != end) { - pDecl = *iter; - pConst = static_cast<AstConstant*>(pDecl); + AstDeclaration* pDecl = *iter; + AstConstant* pConst = static_cast<AstConstant*>(pDecl); if (pConst->getConstValue()->compare(pExpr)) return pConst; @@ -80,11 +78,10 @@ bool AstEnum::dump(RegistryKey& rKey) DeclList::const_iterator iter = getIteratorBegin(); DeclList::const_iterator end = getIteratorEnd(); - AstDeclaration* pDecl = NULL; sal_uInt16 index = 0; while ( iter != end ) { - pDecl = *iter; + AstDeclaration* pDecl = *iter; if ( pDecl->getNodeType() == NT_enum_val ) static_cast<AstConstant*>(pDecl)->dumpBlob(aBlob, index++, false); |