subckt.c, cleanup while() loop

This commit is contained in:
rlar 2016-11-18 22:40:00 +01:00
parent 0982953fca
commit 2852776482
1 changed files with 4 additions and 4 deletions

View File

@ -1108,7 +1108,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha
/* Next iterate over all nodes (netnames) found and translate them. */
nnodes = numnodes(c->li_line, subs, modnames);
while (nnodes-- > 0) {
while (--nnodes >= 0) {
name = gettok_node(&s);
if (name == NULL) {
fprintf(cp_err, "Error: too few nodes: %s\n",
@ -1172,7 +1172,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) {
while (--nnodes >= 0) {
nametofree = 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);
@ -1251,7 +1251,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha
/* Next iterate over all nodes (netnames) found and translate them. */
nnodes = numnodes(c->li_line, subs, modnames);
while (nnodes-- > 0) {
while (--nnodes >= 0) {
name = gettok_node(&s);
if (name == NULL) {
fprintf(cp_err, "Error: too few nodes: %s\n", c->li_line);
@ -1277,7 +1277,7 @@ translate(struct line *deck, char *formal, char *actual, char *scname, const cha
* source devices above . . . .
*/
nnodes = numdevs(c->li_line);
while (nnodes-- > 0) {
while (--nnodes >= 0) {
t = name = gettok_node(&s);
if (name == NULL) {
fprintf(cp_err, "Error: too few devs: %s\n", c->li_line);