cleanup, some more (*p).foo --> p->foo
This commit is contained in:
parent
3349b98145
commit
c1683a5571
|
|
@ -1,3 +1,12 @@
|
|||
2011-05-01 Robert Larice
|
||||
* src/spicelib/parser/inpaname.c ,
|
||||
* src/spicelib/parser/inpdpar.c ,
|
||||
* src/spicelib/parser/inpgmod.c ,
|
||||
* src/spicelib/parser/inppname.c ,
|
||||
* src/spicelib/parser/inptyplk.c ,
|
||||
* src/xspice/mif/mifgetmod.c :
|
||||
cleanup, some more (*p).foo --> p->foo
|
||||
|
||||
2011-04-30 Robert Larice
|
||||
* src/spicelib/devices/cktbindnode.c ,
|
||||
* src/spicelib/devices/hisimhv/hsmhvmask.c ,
|
||||
|
|
|
|||
|
|
@ -49,22 +49,21 @@ INPaName(char *parm, IFvalue * val, CKTcircuit *ckt, int *dev, char *devnam,
|
|||
* this device type and look for a name match of an 'ask'able
|
||||
* 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) &
|
||||
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
|
||||
* above and put the results in the IFvalue structure our caller
|
||||
* gave us originally
|
||||
*/
|
||||
error = sim->askInstanceQuest (ckt, *fast,
|
||||
(*(sim->devices)[*dev]).
|
||||
instanceParms[i].id, val,
|
||||
sim->devices[*dev]->instanceParms[i].id, val,
|
||||
selector);
|
||||
if (dataType)
|
||||
*dataType =
|
||||
(*(sim->devices)[*dev]).instanceParms[i].dataType;
|
||||
sim->devices[*dev]->instanceParms[i].dataType;
|
||||
return (error);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,21 +53,20 @@ char *INPdevParse(char **line, CKTcircuit *ckt, int dev, GENinstance *fast,
|
|||
rtn = (INPerror(error));
|
||||
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) {
|
||||
ft_sim->devices[dev]->instanceParms[i].keyword) == 0) {
|
||||
val =
|
||||
INPgetValue(ckt, line,
|
||||
((*(ft_sim->devices)[dev]).
|
||||
instanceParms[i].dataType), tab);
|
||||
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]).
|
||||
ft_sim->devices
|
||||
[dev]->
|
||||
instanceParms[i].id,
|
||||
val,
|
||||
NULL);
|
||||
|
|
@ -78,7 +77,7 @@ char *INPdevParse(char **line, CKTcircuit *ckt, int dev, GENinstance *fast,
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (i == (*(*(ft_sim->devices)[dev]).numInstanceParms)) {
|
||||
if (i == *(ft_sim->devices[dev]->numInstanceParms)) {
|
||||
errbuf = TMALLOC(char, strlen(parm) + 25);
|
||||
(void) sprintf(errbuf, " unknown parameter (%s) \n", parm);
|
||||
rtn = (errbuf);
|
||||
|
|
|
|||
|
|
@ -86,20 +86,20 @@ create_model( CKTcircuit* ckt, INPmodel* modtmp, INPtables* tab )
|
|||
if (!*parm)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < (* (*(ft_sim->devices)[(modtmp)->INPmodType]).numModelParms); j++) {
|
||||
for (j = 0; j < *(ft_sim->devices[(modtmp)->INPmodType]->numModelParms); j++) {
|
||||
|
||||
if (strcmp(parm, "txl") == 0) {
|
||||
if (strcmp("cpl", ((*(ft_sim->devices) [ (modtmp)->INPmodType ]).modelParms[j].keyword)) == 0) {
|
||||
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) {
|
||||
|
||||
val = INPgetValue(ckt, &line, ((* (ft_sim->devices)[(modtmp)->INPmodType]).modelParms[j].dataType), tab);
|
||||
val = INPgetValue(ckt, &line, ft_sim->devices[(modtmp)->INPmodType]->modelParms[j].dataType, tab);
|
||||
|
||||
error = ft_sim->setModelParm (ckt, modtmp->INPmodfast,
|
||||
(* (ft_sim->devices)[(modtmp)->INPmodType]).modelParms[j].id,
|
||||
ft_sim->devices[(modtmp)->INPmodType]->modelParms[j].id,
|
||||
val, NULL);
|
||||
if (error)
|
||||
return error;
|
||||
|
|
@ -111,10 +111,7 @@ create_model( CKTcircuit* ckt, INPmodel* modtmp, INPtables* tab )
|
|||
/* 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 if (j >= *(ft_sim->devices[(modtmp)->INPmodType]->numModelParms)) {
|
||||
|
||||
/* want only the parameter names in output - not the values */
|
||||
errno = 0; /* To distinguish success/failure after call */
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ int INPpName(char *parm, IFvalue * val, CKTcircuit *ckt, int dev, GENinstance *f
|
|||
int error; /* int to store evaluate error return codes in */
|
||||
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)) ==
|
||||
ft_sim->devices[dev]->instanceParms[i].keyword) ==
|
||||
0) {
|
||||
error =
|
||||
ft_sim->setInstanceParm (ckt, fast,
|
||||
(*(ft_sim->devices)[dev]).
|
||||
ft_sim->devices[dev]->
|
||||
instanceParms[i].id, val,
|
||||
NULL);
|
||||
if (error)
|
||||
|
|
@ -41,7 +41,7 @@ int INPpName(char *parm, IFvalue * val, CKTcircuit *ckt, int dev, GENinstance *f
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (i == (*(*(ft_sim->devices)[dev]).numInstanceParms)) {
|
||||
if (i == *(ft_sim->devices[dev]->numInstanceParms)) {
|
||||
return (E_BADPARM);
|
||||
}
|
||||
return (OK);
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ int INPtypelook(char *type)
|
|||
if ((ft_sim->devices[i]) == NULL)
|
||||
printf("In INPtypelook, checking model type = %s against existing model = %s, . . .\n", type, "NULL");
|
||||
else
|
||||
printf("In INPtypelook, checking model type = %s against existing model = %s, . . .\n", type, (*(ft_sim->devices)[i]).name );
|
||||
printf("In INPtypelook, checking model type = %s against existing model = %s, . . .\n", type, ft_sim->devices[i]->name);
|
||||
#endif
|
||||
|
||||
if ((ft_sim->devices)[i] && strcmp(type, (*(ft_sim->devices)[i]).name) == 0) {
|
||||
if (ft_sim->devices[i] && strcmp(type, ft_sim->devices[i]->name) == 0) {
|
||||
/* found the device - return it */
|
||||
|
||||
#ifdef TRACE
|
||||
|
|
|
|||
|
|
@ -189,23 +189,21 @@ char *MIFgetMod(
|
|||
|
||||
while(*line != 0) {
|
||||
INPgetTok(&line,&parm,1);
|
||||
for(j=0;j<*((*(ft_sim->devices)[(modtmp)->INPmodType]).numModelParms); j++) {
|
||||
if (strcmp(parm,((*(ft_sim->devices) [ (modtmp)->
|
||||
INPmodType ]).modelParms[j].keyword)) == 0) {
|
||||
for(j=0 ; j < *(ft_sim->devices[(modtmp)->INPmodType]->numModelParms); j++) {
|
||||
if (strcmp(parm, ft_sim->devices[(modtmp)->INPmodType]->modelParms[j].keyword) == 0) {
|
||||
/* gtri modification: call MIFgetValue instead of INPgetValue */
|
||||
err1 = NULL;
|
||||
val = MIFgetValue(ckt,&line,
|
||||
((*(ft_sim->devices)[(modtmp)->
|
||||
INPmodType ]).modelParms[j].
|
||||
dataType),tab,&err1);
|
||||
ft_sim->devices[(modtmp)->INPmodType]->modelParms[j].dataType,
|
||||
tab, &err1);
|
||||
if(err1) {
|
||||
err2 = TMALLOC(char, 25 + strlen(name) + strlen(err1));
|
||||
sprintf(err2, "MIF-ERROR - model: %s - %s\n", name, err1);
|
||||
return(err2);
|
||||
}
|
||||
error = ft_sim->setModelParm (ckt,
|
||||
((modtmp)->INPmodfast),
|
||||
(*(ft_sim->devices)[(modtmp)->INPmodType ]).
|
||||
(modtmp)->INPmodfast,
|
||||
ft_sim->devices[(modtmp)->INPmodType]->
|
||||
modelParms[j].id, val, NULL);
|
||||
if(error)
|
||||
return(INPerror(error));
|
||||
|
|
@ -213,7 +211,7 @@ char *MIFgetMod(
|
|||
}
|
||||
}
|
||||
/* gtri modification: processing of special parameter "level" removed */
|
||||
if(j >= *((*(ft_sim->devices)[(modtmp)->INPmodType]).numModelParms))
|
||||
if(j >= *(ft_sim->devices[(modtmp)->INPmodType]->numModelParms))
|
||||
{
|
||||
//err has not been allocated, but free() in INPerrCat()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue