From 4af931d9e494944abaf344061bd974f40ee62c52 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 8 Mar 2012 20:01:34 +0100 Subject: [PATCH] nest, shrink scope of `nest' --- src/frontend/subckt.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index b7828d24e..1eae4f031 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -397,7 +397,7 @@ inp_subcktexpand(struct line *deck) { static struct line * doit(struct line *deck) { struct subs *sssfree = NULL, *sss = NULL; /* *sss temporarily hold decks to substitute */ - int nest, numpasses = MAXNEST; + int numpasses = MAXNEST; bool gotone; wordlist *tmodnames = modnames; wordlist *tsubmod = submod; @@ -445,7 +445,9 @@ doit(struct line *deck) { * At the end of this section, last will point to the location of the * .subckt card, and lcc will point to the location of the .ends card. */ - for (nest = 0, c = last->li_next; c; c = c->li_next) { + { + int nest = 0; + for (c = last->li_next; c; c = c->li_next) { if (ciprefix(sbend, c->li_line)) { /* found a .ends */ if (!nest) break; /* nest = 0 means we have balanced .subckt and .ends */ @@ -458,6 +460,7 @@ doit(struct line *deck) { nest++; lcc = c; /* lcc points to current pos of c */ } /* for (nest = 0 . . . */ + } /* Check to see if we have looped through remainder of deck without finding .ends */ if (!c) {