parser/inpdpar.c, #3/6, cleanup, whitespace

This commit is contained in:
rlar 2018-02-03 17:41:21 +01:00
parent 4140af6d29
commit 36f3263727
1 changed files with 27 additions and 25 deletions

View File

@ -56,43 +56,45 @@ INPdevParse(char **line, CKTcircuit *ckt, int dev, GENinstance *fast,
rtn = INPerror(error);
goto quit;
}
for (i = 0; i < *(ft_sim->devices[dev]->numInstanceParms); i++) {
if (strcmp(parm, ft_sim->devices[dev]->instanceParms[i].keyword) == 0) {
break;
}
}
if (i >= *(ft_sim->devices[dev]->numInstanceParms)) {
errbuf = tprintf(" unknown parameter (%s) \n", parm);
rtn = errbuf;
goto quit;
}
val = INPgetValue(ckt, line,
ft_sim->devices[dev]->instanceParms[i].dataType,
tab);
if (!val) {
rtn = INPerror(E_PARMVAL);
goto quit;
}
error = ft_sim->setInstanceParm (ckt, fast,
ft_sim->devices[dev]->instanceParms[i].id,
val, NULL);
if (error) {
rtn = INPerror(error);
goto quit;
}
val = INPgetValue(ckt, line,
ft_sim->devices[dev]->instanceParms[i].dataType,
tab);
if (!val) {
rtn = INPerror(E_PARMVAL);
goto quit;
}
error = ft_sim->setInstanceParm (ckt, fast,
ft_sim->devices[dev]->instanceParms[i].id,
val, NULL);
if (error) {
rtn = INPerror(error);
goto quit;
}
/* delete the union val */
switch (ft_sim->devices[dev]->instanceParms[i].dataType & IF_VARTYPES) {
case IF_REALVEC:
tfree(val->v.vec.rVec);
break;
case IF_INTVEC:
tfree(val->v.vec.iVec);
break;
default:
break;
}
/* delete the union val */
switch (ft_sim->devices[dev]->instanceParms[i].dataType & IF_VARTYPES) {
case IF_REALVEC:
tfree(val->v.vec.rVec);
break;
case IF_INTVEC:
tfree(val->v.vec.iVec);
break;
default:
break;
}
FREE(parm);
}