summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2015-08-22 11:58:11 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2015-08-22 13:02:08 +0000
commit25accda781bc0bc79ca2e887c54ca981068bf407 (patch)
tree0f551b4f516dd289df523d71bff08a26de2c3622 /hwpfilter
parent159bace378aefa5e48967f1e5089acef9a7f2378 (diff)
tdf#39440 reduce scope of local variables
This addresses some cppcheck warnings. Change-Id: I6ab170c4426494ab9fc53017f88e47fbfdbd9aad Reviewed-on: https://gerrit.libreoffice.org/17920 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/grammar.cxx5
-rw-r--r--hwpfilter/source/hwpeq.cxx2
2 files changed, 3 insertions, 4 deletions
diff --git a/hwpfilter/source/grammar.cxx b/hwpfilter/source/grammar.cxx
index 77984b97c9fa..42185466b88e 100644
--- a/hwpfilter/source/grammar.cxx
+++ b/hwpfilter/source/grammar.cxx
@@ -1238,11 +1238,10 @@ void yyerror(const char * /*err*/)
{
// printf("REALKING ERR[%s]\n",err);
// if error, delete all nodes.
- Node *pNode = 0L;
int ncount = nodelist.size();
for( int i = 0 ; i < ncount ; i++){
- pNode = nodelist.front();
- nodelist.pop_front();
+ Node *pNode = nodelist.front();
+ nodelist.pop_front();
delete pNode;
}
top = 0L;
diff --git a/hwpfilter/source/hwpeq.cxx b/hwpfilter/source/hwpeq.cxx
index 393a6dbea19d..732b2299168c 100644
--- a/hwpfilter/source/hwpeq.cxx
+++ b/hwpfilter/source/hwpeq.cxx
@@ -674,12 +674,12 @@ static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel)
MzString white, token;
char key[256];
int ch, result;
- const hwpeq *eq = 0;
while( 0 != (result = next_token(white, token, strm)) ) {
if( sentinel && (result == 1) && strchr(sentinel, token[0]) )
break;
make_keyword(key, token);
+ const hwpeq *eq = 0;
if( (eq = lookup_eqn(key)) != 0 ) {
if( eq->latex )
strcpy(key, eq->latex);