From df5c785a8443d7198b4a9db91dc0450c052cb55e Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 17 Jul 2013 20:40:13 +0200 Subject: [PATCH] drop `INPmodUsed' which is redundant to `INPmodfast' --- src/frontend/spiceif.c | 2 +- src/include/ngspice/inpdefs.h | 1 - src/spicelib/parser/inpgmod.c | 5 ++--- src/spicelib/parser/inpmkmod.c | 1 - src/xspice/mif/mifgetmod.c | 3 +-- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index a04c54e0b..365e9ffb1 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -913,11 +913,11 @@ if_setparam_model(CKTcircuit *ckt, char **name, char *val) prevMod->GENnextModel = mods->GENnextModel; INPgetMod(ckt, mods->GENmodName, &inpmod, ft_curckt->ci_symtab); - inpmod->INPmodUsed = 0; if (curMod != nghash_delete(ckt->MODnameHash, curMod->GENmodName)) fprintf(stderr, "ERROR, ouch nasal daemons ...\n"); FREE(mods); + inpmod->INPmodfast = NULL; break; } prevMod = mods; diff --git a/src/include/ngspice/inpdefs.h b/src/include/ngspice/inpdefs.h index a249466b2..fc077a059 100644 --- a/src/include/ngspice/inpdefs.h +++ b/src/include/ngspice/inpdefs.h @@ -75,7 +75,6 @@ struct INPmodel{ IFuid INPmodName; /* uid of model */ int INPmodType; /* type index of device type */ INPmodel *INPnextModel; /* link to next model */ - int INPmodUsed; /* flag to indicate it has already been used */ card *INPmodLine; /* pointer to line describing model */ GENmodel *INPmodfast; /* high speed pointer to model for access */ }; diff --git a/src/spicelib/parser/inpgmod.c b/src/spicelib/parser/inpgmod.c index 31b389591..99f9260c5 100644 --- a/src/spicelib/parser/inpgmod.c +++ b/src/spicelib/parser/inpgmod.c @@ -132,7 +132,6 @@ create_model( CKTcircuit* ckt, INPmodel* modtmp, INPtables* tab ) #ifdef CIDER } /* analytical vs. numerical model parsing */ #endif - modtmp->INPmodUsed = 1; modtmp->INPmodLine->error = err; return 0; @@ -244,7 +243,7 @@ INPgetModBin( CKTcircuit* ckt, char* name, INPmodel** model, INPtables* tab, cha if ( strncmp( modtmp->INPmodName, name, strlen( name ) ) == 0 && in_range( l, lmin, lmax ) && in_range( w, wmin, wmax ) ) { - if ( !modtmp->INPmodUsed ) { + if ( !modtmp->INPmodfast ) { error = create_model( ckt, modtmp, tab ); if ( error ) return NULL; } @@ -291,7 +290,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->INPmodfast) { /* Check if model is already defined */ error = create_model( ckt, modtmp, tab ); if ( error ) return INPerror(error); } diff --git a/src/spicelib/parser/inpmkmod.c b/src/spicelib/parser/inpmkmod.c index 7335a8329..f79284d40 100644 --- a/src/spicelib/parser/inpmkmod.c +++ b/src/spicelib/parser/inpmkmod.c @@ -46,7 +46,6 @@ int INPmakeMod(char *token, int type, card * line) (*i)->INPmodName = token; /* model name */ (*i)->INPmodType = type; /* model type */ (*i)->INPnextModel = NULL; /* pointer to next model (end of list) */ - (*i)->INPmodUsed = 0; /* model is unused */ (*i)->INPmodLine = line; /* model line */ (*i)->INPmodfast = NULL; return (OK); diff --git a/src/xspice/mif/mifgetmod.c b/src/xspice/mif/mifgetmod.c index a5f1dcca1..e1e3c50fb 100644 --- a/src/xspice/mif/mifgetmod.c +++ b/src/xspice/mif/mifgetmod.c @@ -158,7 +158,7 @@ char *MIFgetMod( } /* check to see if this model's parameters have been processed */ - if(! modtmp->INPmodUsed) { + if(! modtmp->INPmodfast) { /* not already processed, so create data struct */ error = ft_sim->newModel ( ckt, modtmp->INPmodType, @@ -235,7 +235,6 @@ char *MIFgetMod( } /* end while end of line not reached */ - modtmp->INPmodUsed = 1; modtmp->INPmodLine->error = err; } /* end if model parameters not processed yet */