subckt.c, doit(), rename `lc' --> `prev_of_c'
This commit is contained in:
parent
73935377ff
commit
5944a2505a
|
|
@ -542,7 +542,7 @@ doit(struct line *deck, wordlist *modnames) {
|
||||||
/* Second pass: do the replacements. */
|
/* Second pass: do the replacements. */
|
||||||
do { /* while (!error && numpasses-- && gotone) */
|
do { /* while (!error && numpasses-- && gotone) */
|
||||||
struct line *c = deck;
|
struct line *c = deck;
|
||||||
struct line *lc = NULL;
|
struct line *prev_of_c = NULL;
|
||||||
gotone = FALSE;
|
gotone = FALSE;
|
||||||
while (c) {
|
while (c) {
|
||||||
if (ciprefix(invoke, c->li_line)) { /* found reference to .subckt (i.e. component with refdes X) */
|
if (ciprefix(invoke, c->li_line)) { /* found reference to .subckt (i.e. component with refdes X) */
|
||||||
|
|
@ -590,7 +590,7 @@ doit(struct line *deck, wordlist *modnames) {
|
||||||
* instance of a subckt that is defined above at higher level.
|
* instance of a subckt that is defined above at higher level.
|
||||||
*/
|
*/
|
||||||
if (!sss) {
|
if (!sss) {
|
||||||
lc = c;
|
prev_of_c = c;
|
||||||
c = c->li_next;
|
c = c->li_next;
|
||||||
tfree(tofree);
|
tfree(tofree);
|
||||||
tfree(tofree2);
|
tfree(tofree2);
|
||||||
|
|
@ -621,8 +621,8 @@ doit(struct line *deck, wordlist *modnames) {
|
||||||
struct line *savenext = c->li_next;
|
struct line *savenext = c->li_next;
|
||||||
if (use_numparams == FALSE) {
|
if (use_numparams == FALSE) {
|
||||||
/* old style: c will drop a dangling pointer: memory leak */
|
/* old style: c will drop a dangling pointer: memory leak */
|
||||||
if (lc)
|
if (prev_of_c)
|
||||||
lc->li_next = lcc;
|
prev_of_c->li_next = lcc;
|
||||||
else
|
else
|
||||||
deck = lcc;
|
deck = lcc;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -635,12 +635,12 @@ doit(struct line *deck, wordlist *modnames) {
|
||||||
lcc->li_next = savenext;
|
lcc->li_next = savenext;
|
||||||
}
|
}
|
||||||
c = lcc->li_next;
|
c = lcc->li_next;
|
||||||
lc = lcc;
|
prev_of_c = lcc;
|
||||||
tfree(tofree);
|
tfree(tofree);
|
||||||
tfree(tofree2);
|
tfree(tofree2);
|
||||||
} /* if (ciprefix(invoke, c->li_line)) . . . */
|
} /* if (ciprefix(invoke, c->li_line)) . . . */
|
||||||
else {
|
else {
|
||||||
lc = c;
|
prev_of_c = c;
|
||||||
c = c->li_next;
|
c = c->li_next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue