diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEacld.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEacld.c.xml index 34c33f4d4..0a212e462 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEacld.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEacld.c.xml @@ -54,7 +54,7 @@ int $(module)acLoad(GENmodel *inModel, CKTcircuit *ckt) for ( ; model != NULL; model = $(module)nextModel(model) ) { /* loop through all the instances of the model */ - for (here = $(module)instances(model); here != NULL ; here = here->$(module)nextInstance) + for (here = $(module)instances(model); here != NULL ; here = $(module)nextInstance(here)) { diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEdefs.h.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEdefs.h.xml index 5d0ffaa41..7b8d3c2b3 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEdefs.h.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEdefs.h.xml @@ -188,10 +188,12 @@ if(isinf((double) var)) \\ /* information needed for each instance */ typedef struct s$(module)instance { - struct s$(module)model *$(module)modPtr; /* pointer to model */ - struct s$(module)instance *$(module)nextInstance; /* pointer to next instance of current model*/ - IFuid $(module)name; /* pointer to character string naming this instance */ - int $(module)state; /* index into state table for this device */ + struct GENinstance gen; + +#define $(module)modPtr(inst) ((struct s$(module)model*)((inst)->gen.GENmodPtr)) +#define $(module)nextInstance(inst) ((struct s$(module)instance*)((inst)->gen.GENnextInstance)) +#define $(module)name gen.GENname +#define $(module)states gen.GENstate /* node */ diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml index 50286f89d..094ebe3d0 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml @@ -53,7 +53,7 @@ $(module)destroy(GENmodel **inModel) $(module)model *next_mod = $(module)nextModel(mod); $(module)instance *inst = $(module)instances(mod); while (inst) { - $(module)instance *next_inst = inst->$(module)nextInstance; + $(module)instance *next_inst = $(module)nextInstance(inst); FREE(inst); inst = next_inst; } diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEload.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEload.c.xml index 881ccb69f..128b5a300 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEload.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEload.c.xml @@ -197,7 +197,7 @@ int $(module)load(GENmodel *inModel, CKTcircuit *ckt) for ( ; model != NULL; model = $(module)nextModel(model) ) { /* loop through all the instances of the model */ - for (here = $(module)instances(model); here != NULL ; here = here->$(module)nextInstance) + for (here = $(module)instances(model); here != NULL ; here = $(module)nextInstance(here)) { { diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEnoise.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEnoise.c.xml index 9954e3aae..bdadeeceb 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEnoise.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEnoise.c.xml @@ -50,7 +50,7 @@ $(module)noise (int mode, int operation, GENmodel *genmodel, CKTcircuit *ckt, Nd $(module)instance *inst; for (model=firstModel; model != NULL; model=$(module)nextModel(model)) { - for (inst=$(module)instances(model); inst != NULL; inst=inst->$(module)nextInstance) + for (inst=$(module)instances(model); inst != NULL; inst=$(module)nextInstance(inst)) { switch (operation) { diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEpzld.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEpzld.c.xml index 9c41b7e3d..3942980da 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEpzld.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEpzld.c.xml @@ -56,7 +56,7 @@ int $(module)pzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) for ( ; model != NULL; model = $(module)nextModel(model) ) { /* loop through all the instances of the model */ - for (here = $(module)instances(model); here != NULL ; here = here->$(module)nextInstance) + for (here = $(module)instances(model); here != NULL ; here = $(module)nextInstance(here)) { diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml index 574483ad9..e6c8bfd25 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEsetup.c.xml @@ -79,7 +79,7 @@ int $(module)setup (SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int * - for ( here = $(module)instances(model) ;here != NULL ; here = here->$(module)nextInstance ) + for ( here = $(module)instances(model) ;here != NULL ; here = $(module)nextInstance(here) ) { @@ -176,7 +176,7 @@ $(module)unsetup(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the $(module) device models */ for ( ;model != NULL ;model = $(module)nextModel(model) ) { - for ( here = $(module)instances(model) ;here != NULL ; here = here->$(module)nextInstance ) + for ( here = $(module)instances(model) ;here != NULL ; here = $(module)nextInstance(here) ) { diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEtemp.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEtemp.c.xml index d14439a96..ad04ad673 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEtemp.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEtemp.c.xml @@ -63,7 +63,7 @@ int $(module)temp(GENmodel *inModel, CKTcircuit *ckt) /* loop through all the instances of the model */ - for (here = $(module)instances(model); here != NULL ; here = here->$(module)nextInstance) + for (here = $(module)instances(model); here != NULL ; here = $(module)nextInstance(here)) { diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEtrunc.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEtrunc.c.xml index bdc122238..a728ffdc9 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEtrunc.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEtrunc.c.xml @@ -59,7 +59,7 @@ int $(module)trunc(GENmodel *inModel, CKTcircuit *ckt, double *timeStep) for ( ; model != NULL; model = $(module)nextModel(model) ) { /* loop through all the instances of the model */ - for (here = $(module)instances(model); here != NULL ; here = here->$(module)nextInstance) + for (here = $(module)instances(model); here != NULL ; here = $(module)nextInstance(here)) { #ifdef STEPDEBUG debugtemp = *timeStep;