From 1ea5561a180dd06a92fc5c6bd60bbf41959179dc Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 8 Mar 2012 20:21:50 +0100 Subject: [PATCH] doit, shrink scope of `lc' and `last' --- src/frontend/subckt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index ed664d05a..53eb99c30 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -396,7 +396,7 @@ inp_subcktexpand(struct line *deck) { /*-------------------------------------------------------------------*/ static struct line * doit(struct line *deck) { - struct line *c, *last, *lc, *lcc; + struct line *c, *lcc; struct subs *sssfree = NULL, *sss = NULL; /* *sss temporarily hold decks to substitute */ char *s, *t; int nest, numpasses = MAXNEST, i; @@ -416,6 +416,9 @@ doit(struct line *deck) { for(c=deck; c; c=c->li_next) printf(" %s\n",c->li_line); #endif + + { + struct line *last, *lc; /* First pass: xtract all the .subckts and stick pointers to them into sss. */ for (last = deck, lc = NULL; last; ) { @@ -502,6 +505,7 @@ doit(struct line *deck) { last = last->li_next; } } /* for (last = deck . . . . */ + } /* At this point, sss holds the .subckt definition found, subs holds @@ -533,6 +537,7 @@ doit(struct line *deck) { error = 0; /* Second pass: do the replacements. */ do { /* while (!error && numpasses-- && gotone) */ + struct line *lc; gotone = FALSE; for (c = deck, lc = NULL; c; ) { if (ciprefix(invoke, c->li_line)) { /* found reference to .subckt (i.e. component with refdes X) */