summaryrefslogtreecommitdiff
path: root/idlc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-11-24 08:54:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2010-11-24 08:54:31 +0000
commite809491b5f94de4343cce16de1452df8d732c71c (patch)
tree6f4867ce7ce1bdcdc147a602f72361cda3d81133 /idlc
parentc969a74136a9f6c84aa13b8c90f1aea1ec1b14b0 (diff)
cppcheck: The scope of these variables can be reduced
Diffstat (limited to 'idlc')
-rw-r--r--idlc/source/preproc/macro.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/idlc/source/preproc/macro.c b/idlc/source/preproc/macro.c
index 1d253d6a8..54c0268c0 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]);