Browse Source

mop up, in the shadow of the last two commits

pre-master-46
rlar 15 years ago
parent
commit
2ebe2d6277
  1. 3
      ChangeLog
  2. 6
      src/spicelib/parser/inpaname.c
  3. 24
      src/spicelib/parser/inpdpar.c
  4. 9
      src/spicelib/parser/inppname.c

3
ChangeLog

@ -1,4 +1,7 @@
2011-05-01 Robert Larice 2011-05-01 Robert Larice
* src/spicelib/parser/inpaname.c ,
* src/spicelib/parser/inpdpar.c ,
* src/spicelib/parser/inppname.c ,
* src/xspice/mif/mifgetmod.c : * src/xspice/mif/mifgetmod.c :
mop up, in the shadow of the last two commits mop up, in the shadow of the last two commits

6
src/spicelib/parser/inpaname.c

@ -50,10 +50,8 @@ INPaName(char *parm, IFvalue * val, CKTcircuit *ckt, int *dev, char *devnam,
* parameter. * parameter.
*/ */
for (i = 0; i < *(sim->devices[*dev]->numInstanceParms); i++) { for (i = 0; i < *(sim->devices[*dev]->numInstanceParms); i++) {
if (strcmp(parm,
sim->devices[*dev]->instanceParms[i].keyword) == 0
&& (sim->devices[*dev]->instanceParms[i].dataType &
IF_ASK)) {
if (strcmp(parm, sim->devices[*dev]->instanceParms[i].keyword) == 0
&& (sim->devices[*dev]->instanceParms[i].dataType & IF_ASK)) {
/* found it, so we ask the question using the device info we got /* found it, so we ask the question using the device info we got
* above and put the results in the IFvalue structure our caller * above and put the results in the IFvalue structure our caller
* gave us originally * gave us originally

24
src/spicelib/parser/inpdpar.c

@ -43,35 +43,31 @@ char *INPdevParse(char **line, CKTcircuit *ckt, int dev, GENinstance *fast,
*waslead = 1; *waslead = 1;
} else } else
*leading = 0.0; *leading = 0.0;
while (**line != (char) 0) {
while (**line != '\0') {
error = INPgetTok(line, &parm, 1); error = INPgetTok(line, &parm, 1);
if (!*parm) { if (!*parm) {
FREE(parm); FREE(parm);
continue; continue;
} }
if (error) { if (error) {
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) {
val = val =
INPgetValue(ckt, line, INPgetValue(ckt, line,
ft_sim->devices[dev]->
instanceParms[i].dataType, tab);
ft_sim->devices[dev]->instanceParms[i].dataType,
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,
val,
NULL);
ft_sim->devices[dev]->instanceParms[i].id,
val, NULL);
if (error) { if (error) {
rtn = (INPerror(error));
rtn = INPerror(error);
goto quit; goto quit;
} }
break; break;
@ -80,7 +76,7 @@ char *INPdevParse(char **line, CKTcircuit *ckt, int dev, GENinstance *fast,
if (i == *(ft_sim->devices[dev]->numInstanceParms)) { if (i == *(ft_sim->devices[dev]->numInstanceParms)) {
errbuf = TMALLOC(char, strlen(parm) + 25); errbuf = TMALLOC(char, strlen(parm) + 25);
(void) sprintf(errbuf, " unknown parameter (%s) \n", parm); (void) sprintf(errbuf, " unknown parameter (%s) \n", parm);
rtn = (errbuf);
rtn = errbuf;
goto quit; goto quit;
} }
FREE(parm); FREE(parm);

9
src/spicelib/parser/inppname.c

@ -28,14 +28,11 @@ int INPpName(char *parm, IFvalue * val, CKTcircuit *ckt, int dev, GENinstance *f
int i; int i;
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) {
error = error =
ft_sim->setInstanceParm (ckt, fast, ft_sim->setInstanceParm (ckt, fast,
ft_sim->devices[dev]->
instanceParms[i].id, val,
NULL);
ft_sim->devices[dev]->instanceParms[i].id,
val, NULL);
if (error) if (error)
return (error); return (error);
break; break;

Loading…
Cancel
Save