parser/inpgmod.c, cleanup, fuse the if's

This commit is contained in:
rlar 2018-01-10 13:23:53 +01:00
parent 9bab8cf0f9
commit c2e0c944a6
1 changed files with 3 additions and 5 deletions

View File

@ -92,9 +92,8 @@ create_model(CKTcircuit *ckt, INPmodel *modtmp, INPtables *tab)
if (strcmp("cpl", ft_sim->devices[modtmp->INPmodType]->modelParms[j].keyword) == 0)
strcpy(parm, "cpl");
if (strcmp(parm, ft_sim->devices[modtmp->INPmodType]->modelParms[j].keyword) == 0) {
if (strcmp(parm, ft_sim->devices[modtmp->INPmodType]->modelParms[j].keyword) == 0)
break;
}
}
if (j < *(ft_sim->devices[modtmp->INPmodType]->numModelParms)) {
@ -105,12 +104,11 @@ create_model(CKTcircuit *ckt, INPmodel *modtmp, INPtables *tab)
val, NULL);
if (error)
return error;
}
if (j >= *(ft_sim->devices[modtmp->INPmodType]->numModelParms) && strcmp(parm, "level") == 0) {
} else if (strcmp(parm, "level") == 0) {
/* just grab the level number and throw away */
/* since we already have that info from pass1 */
val = INPgetValue(ckt, &line, IF_REAL, tab);
} else if (j >= *(ft_sim->devices[modtmp->INPmodType]->numModelParms)) {
} else {
/* want only the parameter names in output - not the values */
errno = 0; /* To distinguish success/failure after call */