From 6486978435a2f29853cb3a832f87c049b65c7068 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 9 Dec 2010 12:23:06 +0000 Subject: cppcheck: can reduce the scope of these variables --- soltools/cpp/_macro.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'soltools') diff --git a/soltools/cpp/_macro.c b/soltools/cpp/_macro.c index c61798704711..d1775c6a1f64 100644 --- a/soltools/cpp/_macro.c +++ b/soltools/cpp/_macro.c @@ -46,14 +46,13 @@ 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 (;;) @@ -295,7 +294,7 @@ void { // Token * pOldNextTp; Tokenrow ntr; - int ntokc, narg, i; + int ntokc, narg; Tokenrow *atr[NARG + 1]; if (Mflag == 2) @@ -311,6 +310,8 @@ void ntokc = 1; else { + int i; + ntokc = gatherargs(trp, atr, &narg); if (narg < 0) { /* not actually a call (no '(') */ -- cgit