Browse Source

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

pre-master-46
rlar 8 years ago
parent
commit
36f3263727
  1. 52
      src/spicelib/parser/inpdpar.c

52
src/spicelib/parser/inpdpar.c

@ -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,
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); FREE(parm);
} }

Loading…
Cancel
Save