inp2m.c, #12/15b, unify, add code which won't be executed at all

actually, this most certainly unveils a bug in the original code,
  lacking invocation of INPgetModBin() when optional extra nodes come
  into play.
This commit is contained in:
rlar 2017-03-05 16:53:29 +01:00
parent 99136a16e7
commit 3d6a2e2422
1 changed files with 13 additions and 1 deletions

View File

@ -121,7 +121,7 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current)
tfree(err_msg);
/* check if using model binning -- pass in line since need 'l' and 'w' */
if (!thismodel)
if (!thismodel && nodeflag < 5)
INPgetModBin(ckt, nname[nodeflag], &thismodel, tab, line);
if (!thismodel) {
@ -131,6 +131,10 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current)
err_msg = INPgetMod(ckt, nname[nodeflag], &thismodel, tab);
tfree(err_msg);
/* check if using model binning -- pass in line since need 'l' and 'w' */
if (!thismodel && nodeflag < 5)
INPgetModBin(ckt, nname[nodeflag], &thismodel, tab, line);
if (!thismodel) {
nodeflag = 6;
INPgetNetTok(&line, &nname[nodeflag], 1);
@ -138,6 +142,10 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current)
err_msg = INPgetMod(ckt, nname[nodeflag], &thismodel, tab);
tfree(err_msg);
/* check if using model binning -- pass in line since need 'l' and 'w' */
if (!thismodel && nodeflag < 5)
INPgetModBin(ckt, nname[nodeflag], &thismodel, tab, line);
if (!thismodel) {
nodeflag = 7;
INPgetTok(&line, &nname[nodeflag], 1);
@ -145,6 +153,10 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current)
err_msg = INPgetMod(ckt, nname[nodeflag], &thismodel, tab);
tfree(err_msg);
/* check if using model binning -- pass in line since need 'l' and 'w' */
if (!thismodel && nodeflag < 5)
INPgetModBin(ckt, nname[nodeflag], &thismodel, tab, line);
if (thismodel) {
/* nodeflag == 7 */
if (!valid_numnodes(nodeflag, thismodel, current))