Browse Source

drop `INPmodUsed' which is redundant to `INPmodfast'

pre-master-46
rlar 13 years ago
parent
commit
df5c785a84
  1. 2
      src/frontend/spiceif.c
  2. 1
      src/include/ngspice/inpdefs.h
  3. 5
      src/spicelib/parser/inpgmod.c
  4. 1
      src/spicelib/parser/inpmkmod.c
  5. 3
      src/xspice/mif/mifgetmod.c

2
src/frontend/spiceif.c

@ -913,11 +913,11 @@ if_setparam_model(CKTcircuit *ckt, char **name, char *val)
prevMod->GENnextModel = mods->GENnextModel; prevMod->GENnextModel = mods->GENnextModel;
INPgetMod(ckt, mods->GENmodName, &inpmod, ft_curckt->ci_symtab); INPgetMod(ckt, mods->GENmodName, &inpmod, ft_curckt->ci_symtab);
inpmod->INPmodUsed = 0;
if (curMod != nghash_delete(ckt->MODnameHash, curMod->GENmodName)) if (curMod != nghash_delete(ckt->MODnameHash, curMod->GENmodName))
fprintf(stderr, "ERROR, ouch nasal daemons ...\n"); fprintf(stderr, "ERROR, ouch nasal daemons ...\n");
FREE(mods); FREE(mods);
inpmod->INPmodfast = NULL;
break; break;
} }
prevMod = mods; prevMod = mods;

1
src/include/ngspice/inpdefs.h

@ -75,7 +75,6 @@ struct INPmodel{
IFuid INPmodName; /* uid of model */ IFuid INPmodName; /* uid of model */
int INPmodType; /* type index of device type */ int INPmodType; /* type index of device type */
INPmodel *INPnextModel; /* link to next model */ INPmodel *INPnextModel; /* link to next model */
int INPmodUsed; /* flag to indicate it has already been used */
card *INPmodLine; /* pointer to line describing model */ card *INPmodLine; /* pointer to line describing model */
GENmodel *INPmodfast; /* high speed pointer to model for access */ GENmodel *INPmodfast; /* high speed pointer to model for access */
}; };

5
src/spicelib/parser/inpgmod.c

@ -132,7 +132,6 @@ create_model( CKTcircuit* ckt, INPmodel* modtmp, INPtables* tab )
#ifdef CIDER #ifdef CIDER
} /* analytical vs. numerical model parsing */ } /* analytical vs. numerical model parsing */
#endif #endif
modtmp->INPmodUsed = 1;
modtmp->INPmodLine->error = err; modtmp->INPmodLine->error = err;
return 0; return 0;
@ -244,7 +243,7 @@ INPgetModBin( CKTcircuit* ckt, char* name, INPmodel** model, INPtables* tab, cha
if ( strncmp( modtmp->INPmodName, name, strlen( name ) ) == 0 && if ( strncmp( modtmp->INPmodName, name, strlen( name ) ) == 0 &&
in_range( l, lmin, lmax ) && in_range( w, wmin, wmax ) ) { in_range( l, lmin, lmax ) && in_range( w, wmin, wmax ) ) {
if ( !modtmp->INPmodUsed ) {
if ( !modtmp->INPmodfast ) {
error = create_model( ckt, modtmp, tab ); error = create_model( ckt, modtmp, tab );
if ( error ) return NULL; if ( error ) return NULL;
} }
@ -291,7 +290,7 @@ char *INPgetMod(CKTcircuit *ckt, char *name, INPmodel ** model, INPtables * tab)
return (err); return (err);
} /* end of checking for illegal model */ } /* 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 ); error = create_model( ckt, modtmp, tab );
if ( error ) return INPerror(error); if ( error ) return INPerror(error);
} }

1
src/spicelib/parser/inpmkmod.c

@ -46,7 +46,6 @@ int INPmakeMod(char *token, int type, card * line)
(*i)->INPmodName = token; /* model name */ (*i)->INPmodName = token; /* model name */
(*i)->INPmodType = type; /* model type */ (*i)->INPmodType = type; /* model type */
(*i)->INPnextModel = NULL; /* pointer to next model (end of list) */ (*i)->INPnextModel = NULL; /* pointer to next model (end of list) */
(*i)->INPmodUsed = 0; /* model is unused */
(*i)->INPmodLine = line; /* model line */ (*i)->INPmodLine = line; /* model line */
(*i)->INPmodfast = NULL; (*i)->INPmodfast = NULL;
return (OK); return (OK);

3
src/xspice/mif/mifgetmod.c

@ -158,7 +158,7 @@ char *MIFgetMod(
} }
/* check to see if this model's parameters have been processed */ /* check to see if this model's parameters have been processed */
if(! modtmp->INPmodUsed) {
if(! modtmp->INPmodfast) {
/* not already processed, so create data struct */ /* not already processed, so create data struct */
error = ft_sim->newModel ( ckt, modtmp->INPmodType, error = ft_sim->newModel ( ckt, modtmp->INPmodType,
@ -235,7 +235,6 @@ char *MIFgetMod(
} /* end while end of line not reached */ } /* end while end of line not reached */
modtmp->INPmodUsed = 1;
modtmp->INPmodLine->error = err; modtmp->INPmodLine->error = err;
} /* end if model parameters not processed yet */ } /* end if model parameters not processed yet */

Loading…
Cancel
Save