cleanup, (modtmp) --> modtmp

This commit is contained in:
rlar 2011-05-01 17:29:21 +00:00
parent c1683a5571
commit 3d8fb96647
3 changed files with 37 additions and 32 deletions

View File

@ -1,3 +1,8 @@
2011-05-01 Robert Larice
* src/spicelib/parser/inpgmod.c ,
* src/xspice/mif/mifgetmod.c :
cleanup, (modtmp) --> modtmp
2011-05-01 Robert Larice
* src/spicelib/parser/inpaname.c ,
* src/spicelib/parser/inpdpar.c ,

View File

@ -59,18 +59,18 @@ create_model( CKTcircuit* ckt, INPmodel* modtmp, INPtables* tab )
#ifdef CIDER
/* begin cider integration */
/* Handle Numerical Models Differently */
if ( ((modtmp)->INPmodType == INPtypelook("NUMD")) ||
((modtmp)->INPmodType == INPtypelook("NBJT")) ||
((modtmp)->INPmodType == INPtypelook("NUMD2")) ||
((modtmp)->INPmodType == INPtypelook("NBJT2")) ||
((modtmp)->INPmodType == INPtypelook("NUMOS")) ) {
if ( modtmp->INPmodType == INPtypelook("NUMD") ||
modtmp->INPmodType == INPtypelook("NBJT") ||
modtmp->INPmodType == INPtypelook("NUMD2") ||
modtmp->INPmodType == INPtypelook("NBJT2") ||
modtmp->INPmodType == INPtypelook("NUMOS") ) {
error = INPparseNumMod( ckt, modtmp, tab, &err );
if (error) return error;
} else {
/* It's an analytical model */
#endif /* CIDER */
line = ((modtmp)->INPmodLine)->line;
line = modtmp->INPmodLine->line;
#ifdef TRACE
/* SDB debug statement */
@ -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,7 +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 */
@ -133,8 +133,8 @@ create_model( CKTcircuit* ckt, INPmodel* modtmp, INPtables* tab )
#ifdef CIDER
} /* analytical vs. numerical model parsing */
#endif
(modtmp)->INPmodUsed = 1;
(modtmp)->INPmodLine->error = err;
modtmp->INPmodUsed = 1;
modtmp->INPmodLine->error = err;
return 0;
}
@ -253,10 +253,10 @@ char *INPgetMod(CKTcircuit *ckt, char *name, INPmodel ** model, INPtables * tab)
#ifdef TRACE
/* SDB debug statement */
printf("In INPgetMod, comparing %s against stored model %s . . . \n", name, (modtmp)->INPmodName);
printf("In INPgetMod, comparing %s against stored model %s . . . \n", name, modtmp->INPmodName);
#endif
if (strcmp((modtmp)->INPmodName, name) == 0) {
if (strcmp(modtmp->INPmodName, name) == 0) {
/* found the model in question - now instantiate if necessary */
/* and return an appropriate pointer to it */
@ -274,7 +274,7 @@ char *INPgetMod(CKTcircuit *ckt, char *name, INPmodel ** model, INPtables * tab)
return (err);
} /* end of checking for illegal model */
if (!((modtmp)->INPmodUsed)) { /* Check if model is already defined */
if (! modtmp->INPmodUsed) { /* Check if model is already defined */
error = create_model( ckt, modtmp, tab );
if ( error ) return INPerror(error);
}

View File

@ -126,14 +126,14 @@ char *MIFgetMod(
--------------------------*/
/* loop through modtable looking for this model (*name) */
for (modtmp = modtab; modtmp != NULL; modtmp = ((modtmp)->INPnextModel) ) {
for (modtmp = modtab; modtmp != NULL; modtmp = modtmp->INPnextModel) {
#ifdef TRACE
/* SDB debug statement */
printf("In MIFgetMod, checking model against stored model = %s . . .\n", (modtmp)->INPmodName );
printf("In MIFgetMod, checking model against stored model = %s . . .\n", modtmp->INPmodName);
#endif
if (strcmp((modtmp)->INPmodName,name) == 0) {
if (strcmp(modtmp->INPmodName, name) == 0) {
#ifdef TRACE
/* SDB debug statement */
@ -144,7 +144,7 @@ char *MIFgetMod(
/* ============== and return an appropriate pointer to it ===================== */
/* make sure the type is valid before proceeding */
if( (modtmp)->INPmodType < 0) {
if(modtmp->INPmodType < 0) {
/* illegal device type, so can't handle */
*model = NULL;
@ -158,11 +158,11 @@ char *MIFgetMod(
}
/* check to see if this model's parameters have been processed */
if(! ((modtmp)->INPmodUsed )) {
if(! modtmp->INPmodUsed) {
/* not already processed, so create data struct */
error = ft_sim->newModel ( ckt, modtmp->INPmodType,
&((modtmp)->INPmodfast), (modtmp)->INPmodName);
&(modtmp->INPmodfast), modtmp->INPmodName);
if(error)
return(INPerror(error));
@ -179,7 +179,7 @@ char *MIFgetMod(
/* remaining initializations will be done by MIFmParam() and MIFsetup() */
/* parameter isolation, identification, binding */
line = ((modtmp)->INPmodLine)->line;
line = modtmp->INPmodLine->line;
INPgetTok(&line,&parm,1); /* throw away '.model' */
INPgetTok(&line,&parm,1); /* throw away 'modname' */
@ -189,12 +189,12 @@ 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,
ft_sim->devices[modtmp->INPmodType]->modelParms[j].dataType,
tab, &err1);
if(err1) {
err2 = TMALLOC(char, 25 + strlen(name) + strlen(err1));
@ -202,8 +202,8 @@ char *MIFgetMod(
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));
@ -211,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()
@ -232,8 +232,8 @@ char *MIFgetMod(
} /* end while end of line not reached */
(modtmp)->INPmodUsed=1;
(modtmp)->INPmodLine->error = err;
modtmp->INPmodUsed = 1;
modtmp->INPmodLine->error = err;
} /* end if model parameters not processed yet */