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