summaryrefslogtreecommitdiff
path: root/soltools
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-12-09 12:23:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2010-12-09 14:46:05 +0000
commit6486978435a2f29853cb3a832f87c049b65c7068 (patch)
tree080bddbff0a7ebe66c30539f9181f7c236d735e8 /soltools
parentd1839b973b330e2e0e8d8a6aca2a21f2c982e63c (diff)
cppcheck: can reduce the scope of these variables
Diffstat (limited to 'soltools')
-rw-r--r--soltools/cpp/_macro.c9
1 files changed, 5 insertions, 4 deletions
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 '(') */