diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-11-24 08:54:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-11-24 08:54:31 +0000 |
commit | 8f75224369d1a741ef88bba66b520376ee4f83f9 (patch) | |
tree | 01c6da30544ef23b897701b5b5877cf6ca540c0e /idlc | |
parent | 924908a09bfc917a6d8d1117b757c0b262f0d1cb (diff) |
cppcheck: The scope of these variables can be reduced
Diffstat (limited to 'idlc')
-rw-r--r-- | idlc/source/preproc/macro.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/idlc/source/preproc/macro.c b/idlc/source/preproc/macro.c index be9f30abf085..824a966fda84 100644 --- a/idlc/source/preproc/macro.c +++ b/idlc/source/preproc/macro.c @@ -76,14 +76,14 @@ void args = NULL; if (tp < trp->lp && tp->type == LP && tp->wslen == 0) { - /* macro with args */ - int narg = 0; - tp += 1; args = new(Tokenrow); maketokenrow(2, args); if (tp->type != RP) { + /* macro with args */ + int narg = 0; + int err = 0; for (;;) @@ -301,7 +301,7 @@ void expand(Tokenrow * trp, Nlist * np) { Tokenrow ntr; - int ntokc, narg, i; + int ntokc, narg; Tokenrow *atr[NARG + 1]; if (Mflag == 2) @@ -317,6 +317,8 @@ void ntokc = 1; else { + int i; + ntokc = gatherargs(trp, atr, &narg); if (narg < 0) { /* not actually a call (no '(') */ @@ -330,7 +332,7 @@ void return; } substargs(np, &ntr, atr); /* put args into replacement */ - for (i = 0; i < narg; i++) + for (i = 0; i < narg; ++i) { dofree(atr[i]->bp); dofree(atr[i]); |