Browse Source

inp2q.c, #16/23, emit a message and give up, if we couldn't find the modelname token

Thats a functional change of ngspice.

So far we did cook up a "default" model when we didn't find a model token.
But this was buggy anyway, because in such cases we silently dropped
  a token from beeing processed by PARSECALL()
Now, we emit a message, and skip this line alltogether.
pre-master-46
rlar 9 years ago
parent
commit
03d3e2ea12
  1. 15
      src/spicelib/parser/inp2q.c

15
src/spicelib/parser/inp2q.c

@ -69,6 +69,8 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode)
INPtermInsert(ckt, &nname[i], tab, &node[i]); INPtermInsert(ckt, &nname[i], tab, &node[i]);
} }
model = NULL;
i = 3; i = 3;
INPgetTok(&line, &nname[i], 1); INPgetTok(&line, &nname[i], 1);
@ -91,13 +93,20 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode)
INPtermInsert(ckt, &nname[i], tab, &node[i]); INPtermInsert(ckt, &nname[i], tab, &node[i]);
i = 5; i = 5;
INPgetTok(&line, &nname[i], 1); INPgetTok(&line, &nname[i], 1);
model = nname[i];
INPinsert(&model, tab);
current->error = INPgetMod(ckt, model, &thismodel, tab);
if (INPlookMod(nname[i])) {
model = nname[i];
INPinsert(&model, tab);
current->error = INPgetMod(ckt, model, &thismodel, tab);
}
#endif #endif
} }
} }
if (!model) {
LITERR ("could not find a valid modelname");
return;
}
if (i == 3) { if (i == 3) {
/* 3-terminal device - substrate to ground */ /* 3-terminal device - substrate to ground */
node[3] = gnode; node[3] = gnode;

Loading…
Cancel
Save