From 1f31f7329568cbe1fc22e9b1a48072c3d987dc3a Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 20 Nov 2016 18:35:07 +0100 Subject: [PATCH] subckt.c, translate(), #3/8 simplify --- src/frontend/subckt.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index aca71d186..5e3c64b29 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -1060,7 +1060,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha case 'g': case 'h': - t = name = gettok(&s); /* name points to the refdes */ + name = gettok(&s); /* name points to the refdes */ if (!name) continue; if (!*name) { @@ -1072,7 +1072,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha * and stick the translated name into buffer. */ translate_inst_name(&buffer, scname, name, NULL); - tfree(t); + tfree(name); bxx_putc(&buffer, ' '); /* Next iterate over all nodes (netnames) found and translate them. */ @@ -1135,7 +1135,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha /* Now translate the controlling source/nodes */ nnodes = dim * numdevs(c->li_line); while (--nnodes >= 0) { - nametofree = name = gettok_node(&s); /* name points to the returned token */ + name = gettok_node(&s); /* name points to the returned token */ if (name == NULL) { fprintf(cp_err, "Error: too few devs: %s\n", c->li_line); goto quit; @@ -1161,7 +1161,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha translate_node_name(&buffer, scname, name, NULL); } - tfree(nametofree); + tfree(name); bxx_putc(&buffer, ' '); } /* while (nnodes--. . . . */ @@ -1173,7 +1173,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha /*================= Default case ===================*/ default: /* this section handles ordinary components */ - nametofree = name = gettok_node(&s); /* changed to gettok_node to handle netlists with ( , ) */ + name = gettok_node(&s); /* changed to gettok_node to handle netlists with ( , ) */ if (!name) continue; if (!*name) { @@ -1187,7 +1187,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha translate_inst_name(&buffer, scname, name, NULL); - tfree(nametofree); + tfree(name); bxx_putc(&buffer, ' '); /* Next iterate over all nodes (netnames) found and translate them. */ @@ -1210,14 +1210,14 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha */ nnodes = numdevs(c->li_line); while (--nnodes >= 0) { - t = name = gettok_node(&s); + name = gettok_node(&s); if (name == NULL) { fprintf(cp_err, "Error: too few devs: %s\n", c->li_line); goto quit; } translate_inst_name(&buffer, scname, name, NULL); - tfree(t); + tfree(name); bxx_putc(&buffer, ' '); } /* while (nnodes--. . . . */