diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index d0cf6fd83..46dd085ba 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -898,7 +898,7 @@ if_setparam_model(CKTcircuit *ckt, char **name, char *val) INPgetMod(ckt, mods->GENmodName, &inpmod, ft_curckt->ci_symtab); if (curMod != nghash_delete(ckt->MODnameHash, curMod->GENmodName)) fprintf(stderr, "ERROR, ouch nasal daemons ...\n"); - FREE(mods); + GENmodelFree(mods); inpmod->INPmodfast = NULL; break; diff --git a/src/include/ngspice/gendefs.h b/src/include/ngspice/gendefs.h index 5b4007795..b15a3c8a8 100644 --- a/src/include/ngspice/gendefs.h +++ b/src/include/ngspice/gendefs.h @@ -48,4 +48,12 @@ struct GENmodel { /* model structure for a resistor */ IFuid GENmodName; /* pointer to character string naming this model */ }; + +void GENinstanceFree(GENinstance *); +void GENmodelFree(GENmodel *); + +#define GENmodelOf(p) &((p)->gen) +#define GENinstanceOf(p) &((p)->gen) + + #endif diff --git a/src/spicelib/analysis/cktdltm.c b/src/spicelib/analysis/cktdltm.c index bc0ab245d..d27966af2 100644 --- a/src/spicelib/analysis/cktdltm.c +++ b/src/spicelib/analysis/cktdltm.c @@ -37,11 +37,11 @@ CKTdltMod(CKTcircuit *ckt, GENmodel *m) fprintf(stderr, "ERROR, ouch nasal daemons ...\n"); error = SPfrontEnd->IFdelUid (ckt, h->GENname, UID_INSTANCE); - tfree(h); + GENinstanceFree(h); } if (m != nghash_delete(ckt->MODnameHash, m->GENmodName)) fprintf(stderr, "ERROR, ouch nasal daemons ...\n"); error = SPfrontEnd->IFdelUid (ckt, m->GENmodName, UID_MODEL); - tfree(m); + GENmodelFree(m); return(OK); } diff --git a/src/spicelib/analysis/cktmcrt.c b/src/spicelib/analysis/cktmcrt.c index b41c67039..f8b6382c6 100644 --- a/src/spicelib/analysis/cktmcrt.c +++ b/src/spicelib/analysis/cktmcrt.c @@ -42,3 +42,17 @@ CKTmodCrt(CKTcircuit *ckt, int type, GENmodel **modfast, IFuid name) return OK; } + + +void +GENinstanceFree(GENinstance *inst) +{ + txfree(inst); +} + + +void +GENmodelFree(GENmodel *model) +{ + txfree(model); +} diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEdel.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEdel.c.xml index 6119aa66d..38aad852c 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEdel.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEdel.c.xml @@ -54,7 +54,7 @@ $(module)delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml index 094ebe3d0..77cfb9091 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEdest.c.xml @@ -54,10 +54,10 @@ $(module)destroy(GENmodel **inModel) $(module)instance *inst = $(module)instances(mod); while (inst) { $(module)instance *next_inst = $(module)nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEmdel.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEmdel.c.xml index cb7a5b371..d48317b08 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEmdel.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEmdel.c.xml @@ -64,10 +64,10 @@ $(module)mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/asrc/asrcdel.c b/src/spicelib/devices/asrc/asrcdel.c index 5c19d0cbb..8119fd36f 100644 --- a/src/spicelib/devices/asrc/asrcdel.c +++ b/src/spicelib/devices/asrc/asrcdel.c @@ -18,7 +18,7 @@ ASRCdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/asrc/asrcdest.c b/src/spicelib/devices/asrc/asrcdest.c index d78392011..9ca688d67 100644 --- a/src/spicelib/devices/asrc/asrcdest.c +++ b/src/spicelib/devices/asrc/asrcdest.c @@ -23,10 +23,10 @@ ASRCdestroy(GENmodel **inModel) FREE(inst->ASRCacValues); FREE(inst->ASRCposPtr); FREE(inst->ASRCvars); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/asrc/asrcmdel.c b/src/spicelib/devices/asrc/asrcmdel.c index ba77d59cb..ff2fa54d9 100644 --- a/src/spicelib/devices/asrc/asrcmdel.c +++ b/src/spicelib/devices/asrc/asrcmdel.c @@ -30,10 +30,10 @@ ASRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(((ASRCinstance*)here)->ASRCacValues); - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bjt/bjtdel.c b/src/spicelib/devices/bjt/bjtdel.c index 3d06b6600..bb72e2259 100644 --- a/src/spicelib/devices/bjt/bjtdel.c +++ b/src/spicelib/devices/bjt/bjtdel.c @@ -23,7 +23,7 @@ BJTdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bjt/bjtdest.c b/src/spicelib/devices/bjt/bjtdest.c index ec42e4ed1..d7d124c52 100644 --- a/src/spicelib/devices/bjt/bjtdest.c +++ b/src/spicelib/devices/bjt/bjtdest.c @@ -24,10 +24,10 @@ BJTdestroy(GENmodel **inModel) while (inst) { BJTinstance *next_inst = BJTnextInstance(inst); FREE(inst->BJTsens); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bjt/bjtmdel.c b/src/spicelib/devices/bjt/bjtmdel.c index 89ff70cea..ca8faf94d 100644 --- a/src/spicelib/devices/bjt/bjtmdel.c +++ b/src/spicelib/devices/bjt/bjtmdel.c @@ -33,6 +33,6 @@ BJTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim1/b1del.c b/src/spicelib/devices/bsim1/b1del.c index faac55943..772ea082b 100644 --- a/src/spicelib/devices/bsim1/b1del.c +++ b/src/spicelib/devices/bsim1/b1del.c @@ -19,7 +19,7 @@ B1delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim1/b1dest.c b/src/spicelib/devices/bsim1/b1dest.c index f4e98b008..f2f6fb870 100644 --- a/src/spicelib/devices/bsim1/b1dest.c +++ b/src/spicelib/devices/bsim1/b1dest.c @@ -18,10 +18,10 @@ B1destroy(GENmodel **inModel) B1instance *inst = B1instances(mod); while (inst) { B1instance *next_inst = B1nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim1/b1mdel.c b/src/spicelib/devices/bsim1/b1mdel.c index 7cd890290..e41be0147 100644 --- a/src/spicelib/devices/bsim1/b1mdel.c +++ b/src/spicelib/devices/bsim1/b1mdel.c @@ -28,9 +28,9 @@ B1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim2/b2del.c b/src/spicelib/devices/bsim2/b2del.c index 818a717fb..6c535df93 100644 --- a/src/spicelib/devices/bsim2/b2del.c +++ b/src/spicelib/devices/bsim2/b2del.c @@ -19,7 +19,7 @@ B2delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim2/b2dest.c b/src/spicelib/devices/bsim2/b2dest.c index c292b96df..abbfa0a15 100644 --- a/src/spicelib/devices/bsim2/b2dest.c +++ b/src/spicelib/devices/bsim2/b2dest.c @@ -18,10 +18,10 @@ B2destroy(GENmodel **inModel) B2instance *inst = B2instances(mod); while (inst) { B2instance *next_inst = B2nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim2/b2mdel.c b/src/spicelib/devices/bsim2/b2mdel.c index 9794ab403..4b7aebfea 100644 --- a/src/spicelib/devices/bsim2/b2mdel.c +++ b/src/spicelib/devices/bsim2/b2mdel.c @@ -28,9 +28,9 @@ B2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3/b3del.c b/src/spicelib/devices/bsim3/b3del.c index 0ef7efabc..ce24a41ca 100644 --- a/src/spicelib/devices/bsim3/b3del.c +++ b/src/spicelib/devices/bsim3/b3del.c @@ -25,7 +25,7 @@ BSIM3delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim3/b3dest.c b/src/spicelib/devices/bsim3/b3dest.c index 6369ddb5c..f9ac980ca 100644 --- a/src/spicelib/devices/bsim3/b3dest.c +++ b/src/spicelib/devices/bsim3/b3dest.c @@ -38,13 +38,13 @@ BSIM3destroy(GENmodel **inModel) while (inst) { BSIM3instance *next_inst = BSIM3nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } /* mod->BSIM3modName to be freed in INPtabEnd() */ FREE(mod->BSIM3version); - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim3/b3mdel.c b/src/spicelib/devices/bsim3/b3mdel.c index 677effac4..4c3754340 100644 --- a/src/spicelib/devices/bsim3/b3mdel.c +++ b/src/spicelib/devices/bsim3/b3mdel.c @@ -33,9 +33,9 @@ BSIM3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3soi_dd/b3soidddel.c b/src/spicelib/devices/bsim3soi_dd/b3soidddel.c index c9989993f..c5a73cf0f 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soidddel.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soidddel.c @@ -26,7 +26,7 @@ B3SOIDDdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim3soi_dd/b3soidddest.c b/src/spicelib/devices/bsim3soi_dd/b3soidddest.c index 59050a008..1c2a306aa 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soidddest.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soidddest.c @@ -25,10 +25,10 @@ B3SOIDDdestroy(GENmodel **inModel) B3SOIDDinstance *inst = B3SOIDDinstances(mod); while (inst) { B3SOIDDinstance *next_inst = B3SOIDDnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c index 267eaf892..93bdf08f4 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c @@ -36,9 +36,9 @@ B3SOIDDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifddel.c b/src/spicelib/devices/bsim3soi_fd/b3soifddel.c index 26ae2b27d..80838ca62 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifddel.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifddel.c @@ -26,7 +26,7 @@ B3SOIFDdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifddest.c b/src/spicelib/devices/bsim3soi_fd/b3soifddest.c index a6eae009b..f30ee1874 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifddest.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifddest.c @@ -25,10 +25,10 @@ B3SOIFDdestroy(GENmodel **inModel) B3SOIFDinstance *inst = B3SOIFDinstances(mod); while (inst) { B3SOIFDinstance *next_inst = B3SOIFDnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c index bb08533fb..d15f7dd02 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c @@ -35,9 +35,9 @@ B3SOIFDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipddel.c b/src/spicelib/devices/bsim3soi_pd/b3soipddel.c index 0c7d2f4b2..db893aaba 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipddel.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipddel.c @@ -26,7 +26,7 @@ B3SOIPDdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipddest.c b/src/spicelib/devices/bsim3soi_pd/b3soipddest.c index 6c0ec9e4a..70819cb23 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipddest.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipddest.c @@ -25,10 +25,10 @@ B3SOIPDdestroy(GENmodel **inModel) B3SOIPDinstance *inst = B3SOIPDinstances(mod); while (inst) { B3SOIPDinstance *next_inst = B3SOIPDnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c index 40ac2d9ae..9fca64c30 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c @@ -35,9 +35,9 @@ B3SOIPDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3v0/b3v0del.c b/src/spicelib/devices/bsim3v0/b3v0del.c index 7495f57dc..e0ff7aed0 100644 --- a/src/spicelib/devices/bsim3v0/b3v0del.c +++ b/src/spicelib/devices/bsim3v0/b3v0del.c @@ -20,7 +20,7 @@ BSIM3v0delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim3v0/b3v0dest.c b/src/spicelib/devices/bsim3v0/b3v0dest.c index 2741d3267..b2911ad00 100644 --- a/src/spicelib/devices/bsim3v0/b3v0dest.c +++ b/src/spicelib/devices/bsim3v0/b3v0dest.c @@ -19,10 +19,10 @@ BSIM3v0destroy(GENmodel **inModel) BSIM3v0instance *inst = BSIM3v0instances(mod); while (inst) { BSIM3v0instance *next_inst = BSIM3v0nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim3v0/b3v0mdel.c b/src/spicelib/devices/bsim3v0/b3v0mdel.c index 8e3f346e8..bf33c9d35 100644 --- a/src/spicelib/devices/bsim3v0/b3v0mdel.c +++ b/src/spicelib/devices/bsim3v0/b3v0mdel.c @@ -29,9 +29,9 @@ BSIM3v0mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3v1/b3v1del.c b/src/spicelib/devices/bsim3v1/b3v1del.c index dd4e25407..3b889694f 100644 --- a/src/spicelib/devices/bsim3v1/b3v1del.c +++ b/src/spicelib/devices/bsim3v1/b3v1del.c @@ -26,7 +26,7 @@ BSIM3v1delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim3v1/b3v1dest.c b/src/spicelib/devices/bsim3v1/b3v1dest.c index cb2f6fdd7..eba2ebc85 100644 --- a/src/spicelib/devices/bsim3v1/b3v1dest.c +++ b/src/spicelib/devices/bsim3v1/b3v1dest.c @@ -25,10 +25,10 @@ BSIM3v1destroy(GENmodel **inModel) BSIM3v1instance *inst = BSIM3v1instances(mod); while (inst) { BSIM3v1instance *next_inst = BSIM3v1nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim3v1/b3v1mdel.c b/src/spicelib/devices/bsim3v1/b3v1mdel.c index 55221840e..6dae70965 100644 --- a/src/spicelib/devices/bsim3v1/b3v1mdel.c +++ b/src/spicelib/devices/bsim3v1/b3v1mdel.c @@ -35,9 +35,9 @@ BSIM3v1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3v32/b3v32del.c b/src/spicelib/devices/bsim3v32/b3v32del.c index e2f2a44ac..b12113928 100644 --- a/src/spicelib/devices/bsim3v32/b3v32del.c +++ b/src/spicelib/devices/bsim3v32/b3v32del.c @@ -26,7 +26,7 @@ BSIM3v32delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim3v32/b3v32dest.c b/src/spicelib/devices/bsim3v32/b3v32dest.c index 5e006d64e..cca76df53 100644 --- a/src/spicelib/devices/bsim3v32/b3v32dest.c +++ b/src/spicelib/devices/bsim3v32/b3v32dest.c @@ -37,11 +37,11 @@ BSIM3v32destroy (GENmodel **inModel) /** end of extra code **/ while (inst) { BSIM3v32instance *next_inst = BSIM3v32nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } FREE(mod->BSIM3v32version); - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim3v32/b3v32mdel.c b/src/spicelib/devices/bsim3v32/b3v32mdel.c index 0025189fd..cf90c0ecb 100644 --- a/src/spicelib/devices/bsim3v32/b3v32mdel.c +++ b/src/spicelib/devices/bsim3v32/b3v32mdel.c @@ -34,9 +34,9 @@ BSIM3v32mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim4/b4del.c b/src/spicelib/devices/bsim4/b4del.c index ae96166a8..38062affc 100644 --- a/src/spicelib/devices/bsim4/b4del.c +++ b/src/spicelib/devices/bsim4/b4del.c @@ -74,7 +74,7 @@ BSIM4delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim4/b4dest.c b/src/spicelib/devices/bsim4/b4dest.c index c3d330e39..36d133ed3 100644 --- a/src/spicelib/devices/bsim4/b4dest.c +++ b/src/spicelib/devices/bsim4/b4dest.c @@ -86,11 +86,11 @@ BSIM4destroy(GENmodel **inModel) /** end of extra code **/ while (inst) { BSIM4instance *next_inst = BSIM4nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } FREE(mod->BSIM4version); - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim4/b4mdel.c b/src/spicelib/devices/bsim4/b4mdel.c index 156088aca..49e638563 100644 --- a/src/spicelib/devices/bsim4/b4mdel.c +++ b/src/spicelib/devices/bsim4/b4mdel.c @@ -83,9 +83,9 @@ BSIM4mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim4v5/b4v5del.c b/src/spicelib/devices/bsim4v5/b4v5del.c index 3908fd5fc..fa008a675 100644 --- a/src/spicelib/devices/bsim4v5/b4v5del.c +++ b/src/spicelib/devices/bsim4v5/b4v5del.c @@ -24,7 +24,7 @@ BSIM4v5delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim4v5/b4v5dest.c b/src/spicelib/devices/bsim4v5/b4v5dest.c index 74caa02b5..0a0806eff 100644 --- a/src/spicelib/devices/bsim4v5/b4v5dest.c +++ b/src/spicelib/devices/bsim4v5/b4v5dest.c @@ -36,11 +36,11 @@ BSIM4v5destroy(GENmodel **inModel) /** end of extra code **/ while (inst) { BSIM4v5instance *next_inst = BSIM4v5nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } FREE(mod->BSIM4v5version); - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim4v5/b4v5mdel.c b/src/spicelib/devices/bsim4v5/b4v5mdel.c index ce1ad89b2..0738eea7c 100644 --- a/src/spicelib/devices/bsim4v5/b4v5mdel.c +++ b/src/spicelib/devices/bsim4v5/b4v5mdel.c @@ -33,9 +33,9 @@ BSIM4v5mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim4v6/b4v6del.c b/src/spicelib/devices/bsim4v6/b4v6del.c index 35957b750..25ec7156e 100644 --- a/src/spicelib/devices/bsim4v6/b4v6del.c +++ b/src/spicelib/devices/bsim4v6/b4v6del.c @@ -26,7 +26,7 @@ BSIM4v6delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim4v6/b4v6dest.c b/src/spicelib/devices/bsim4v6/b4v6dest.c index 8c49ac248..914f3d7f0 100644 --- a/src/spicelib/devices/bsim4v6/b4v6dest.c +++ b/src/spicelib/devices/bsim4v6/b4v6dest.c @@ -38,11 +38,11 @@ BSIM4v6destroy(GENmodel **inModel) /** end of extra code **/ while (inst) { BSIM4v6instance *next_inst = BSIM4v6nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } FREE(mod->BSIM4v6version); - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim4v6/b4v6mdel.c b/src/spicelib/devices/bsim4v6/b4v6mdel.c index 3a69a9616..079f1acad 100644 --- a/src/spicelib/devices/bsim4v6/b4v6mdel.c +++ b/src/spicelib/devices/bsim4v6/b4v6mdel.c @@ -35,9 +35,9 @@ BSIM4v6mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim4v7/b4v7del.c b/src/spicelib/devices/bsim4v7/b4v7del.c index e9cff5952..7da945b54 100644 --- a/src/spicelib/devices/bsim4v7/b4v7del.c +++ b/src/spicelib/devices/bsim4v7/b4v7del.c @@ -26,7 +26,7 @@ BSIM4v7delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsim4v7/b4v7dest.c b/src/spicelib/devices/bsim4v7/b4v7dest.c index a09a87719..be887ed5d 100644 --- a/src/spicelib/devices/bsim4v7/b4v7dest.c +++ b/src/spicelib/devices/bsim4v7/b4v7dest.c @@ -38,12 +38,12 @@ BSIM4v7destroy(GENmodel **inModel) /** end of extra code **/ while (inst) { BSIM4v7instance *next_inst = BSIM4v7nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } /* mod->BSIM4v7modName to be freed in INPtabEnd() */ FREE(mod->BSIM4v7version); - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsim4v7/b4v7mdel.c b/src/spicelib/devices/bsim4v7/b4v7mdel.c index 8f1386aa1..3765abf94 100644 --- a/src/spicelib/devices/bsim4v7/b4v7mdel.c +++ b/src/spicelib/devices/bsim4v7/b4v7mdel.c @@ -35,9 +35,9 @@ BSIM4v7mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsimsoi/b4soidel.c b/src/spicelib/devices/bsimsoi/b4soidel.c index d3dd23c35..9add8a2fb 100644 --- a/src/spicelib/devices/bsimsoi/b4soidel.c +++ b/src/spicelib/devices/bsimsoi/b4soidel.c @@ -29,7 +29,7 @@ B4SOIdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/bsimsoi/b4soidest.c b/src/spicelib/devices/bsimsoi/b4soidest.c index bf4843cc3..b3fb7c34f 100644 --- a/src/spicelib/devices/bsimsoi/b4soidest.c +++ b/src/spicelib/devices/bsimsoi/b4soidest.c @@ -29,10 +29,10 @@ B4SOIdestroy(GENmodel **inModel) B4SOIinstance *inst = B4SOIinstances(mod); while (inst) { B4SOIinstance *next_inst = B4SOInextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/bsimsoi/b4soimdel.c b/src/spicelib/devices/bsimsoi/b4soimdel.c index 30f8746b8..d214a08e4 100644 --- a/src/spicelib/devices/bsimsoi/b4soimdel.c +++ b/src/spicelib/devices/bsimsoi/b4soimdel.c @@ -39,9 +39,9 @@ B4SOImDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/cap/capdel.c b/src/spicelib/devices/cap/capdel.c index 2e9fbc31b..464317da2 100644 --- a/src/spicelib/devices/cap/capdel.c +++ b/src/spicelib/devices/cap/capdel.c @@ -19,7 +19,7 @@ CAPdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/cap/capdest.c b/src/spicelib/devices/cap/capdest.c index 2f772f1ba..3ddeb9809 100644 --- a/src/spicelib/devices/cap/capdest.c +++ b/src/spicelib/devices/cap/capdest.c @@ -19,10 +19,10 @@ CAPdestroy(GENmodel **inModel) CAPinstance *inst = CAPinstances(mod); while (inst) { CAPinstance *next_inst = CAPnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/cap/capmdel.c b/src/spicelib/devices/cap/capmdel.c index 3396307f5..a46daaee6 100644 --- a/src/spicelib/devices/cap/capmdel.c +++ b/src/spicelib/devices/cap/capmdel.c @@ -29,9 +29,9 @@ CAPmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/cccs/cccsdel.c b/src/spicelib/devices/cccs/cccsdel.c index 23fae4694..f5deec13a 100644 --- a/src/spicelib/devices/cccs/cccsdel.c +++ b/src/spicelib/devices/cccs/cccsdel.c @@ -18,7 +18,7 @@ CCCSdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/cccs/cccsdest.c b/src/spicelib/devices/cccs/cccsdest.c index 0d3f5fd44..dc8495bb4 100644 --- a/src/spicelib/devices/cccs/cccsdest.c +++ b/src/spicelib/devices/cccs/cccsdest.c @@ -18,10 +18,10 @@ CCCSdestroy(GENmodel **inModel) CCCSinstance *inst = CCCSinstances(mod); while (inst) { CCCSinstance *next_inst = CCCSnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/cccs/cccsmdel.c b/src/spicelib/devices/cccs/cccsmdel.c index 5c9e85051..e94f15539 100644 --- a/src/spicelib/devices/cccs/cccsmdel.c +++ b/src/spicelib/devices/cccs/cccsmdel.c @@ -28,9 +28,9 @@ CCCSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ccvs/ccvsdel.c b/src/spicelib/devices/ccvs/ccvsdel.c index 26bf62d73..448ea433f 100644 --- a/src/spicelib/devices/ccvs/ccvsdel.c +++ b/src/spicelib/devices/ccvs/ccvsdel.c @@ -18,7 +18,7 @@ CCVSdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/ccvs/ccvsdest.c b/src/spicelib/devices/ccvs/ccvsdest.c index 225b43ef2..4bd2cf65b 100644 --- a/src/spicelib/devices/ccvs/ccvsdest.c +++ b/src/spicelib/devices/ccvs/ccvsdest.c @@ -18,10 +18,10 @@ CCVSdestroy(GENmodel **inModel) CCVSinstance *inst = CCVSinstances(mod); while (inst) { CCVSinstance *next_inst = CCVSnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/ccvs/ccvsmdel.c b/src/spicelib/devices/ccvs/ccvsmdel.c index 0544403d4..9364224af 100644 --- a/src/spicelib/devices/ccvs/ccvsmdel.c +++ b/src/spicelib/devices/ccvs/ccvsmdel.c @@ -28,9 +28,9 @@ CCVSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/cpl/cpldel.c b/src/spicelib/devices/cpl/cpldel.c index 0a5555f86..35cf216af 100644 --- a/src/spicelib/devices/cpl/cpldel.c +++ b/src/spicelib/devices/cpl/cpldel.c @@ -19,7 +19,7 @@ CPLdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/cpl/cpldest.c b/src/spicelib/devices/cpl/cpldest.c index 2e2469c4d..da2fd26c9 100644 --- a/src/spicelib/devices/cpl/cpldest.c +++ b/src/spicelib/devices/cpl/cpldest.c @@ -19,10 +19,10 @@ CPLdestroy(GENmodel **inModel) CPLinstance *inst = CPLinstances(mod); while (inst) { CPLinstance *next_inst = CPLnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/cpl/cplmdel.c b/src/spicelib/devices/cpl/cplmdel.c index 264d36a5c..870ff946f 100644 --- a/src/spicelib/devices/cpl/cplmdel.c +++ b/src/spicelib/devices/cpl/cplmdel.c @@ -30,9 +30,9 @@ CPLmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/csw/cswdel.c b/src/spicelib/devices/csw/cswdel.c index 6d781de85..060205620 100644 --- a/src/spicelib/devices/csw/cswdel.c +++ b/src/spicelib/devices/csw/cswdel.c @@ -18,7 +18,7 @@ CSWdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/csw/cswdest.c b/src/spicelib/devices/csw/cswdest.c index b9a80044d..fddaf762e 100644 --- a/src/spicelib/devices/csw/cswdest.c +++ b/src/spicelib/devices/csw/cswdest.c @@ -18,10 +18,10 @@ CSWdestroy(GENmodel **inModel) CSWinstance *inst = CSWinstances(mod); while (inst) { CSWinstance *next_inst = CSWnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/csw/cswmdel.c b/src/spicelib/devices/csw/cswmdel.c index 6173d5fe0..f90841c6e 100644 --- a/src/spicelib/devices/csw/cswmdel.c +++ b/src/spicelib/devices/csw/cswmdel.c @@ -28,9 +28,9 @@ CSWmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/dio/diodel.c b/src/spicelib/devices/dio/diodel.c index 285e12732..54b5418c0 100644 --- a/src/spicelib/devices/dio/diodel.c +++ b/src/spicelib/devices/dio/diodel.c @@ -18,7 +18,7 @@ DIOdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/dio/diodest.c b/src/spicelib/devices/dio/diodest.c index 549fcf433..8f0b68f37 100644 --- a/src/spicelib/devices/dio/diodest.c +++ b/src/spicelib/devices/dio/diodest.c @@ -18,10 +18,10 @@ DIOdestroy(GENmodel **inModel) DIOinstance *inst = DIOinstances(mod); while (inst) { DIOinstance *next_inst = DIOnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/dio/diomdel.c b/src/spicelib/devices/dio/diomdel.c index 7e376b9b1..3b683f4df 100644 --- a/src/spicelib/devices/dio/diomdel.c +++ b/src/spicelib/devices/dio/diomdel.c @@ -28,9 +28,9 @@ DIOmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hfet1/hfetdel.c b/src/spicelib/devices/hfet1/hfetdel.c index e4e207fd4..05b8cd3e3 100644 --- a/src/spicelib/devices/hfet1/hfetdel.c +++ b/src/spicelib/devices/hfet1/hfetdel.c @@ -22,7 +22,7 @@ HFETAdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/hfet1/hfetdest.c b/src/spicelib/devices/hfet1/hfetdest.c index 7225ce137..e1b5913a1 100644 --- a/src/spicelib/devices/hfet1/hfetdest.c +++ b/src/spicelib/devices/hfet1/hfetdest.c @@ -18,10 +18,10 @@ HFETAdestroy(GENmodel **inModel) HFETAinstance *inst = HFETAinstances(mod); while (inst) { HFETAinstance *next_inst = HFETAnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/hfet1/hfetmdel.c b/src/spicelib/devices/hfet1/hfetmdel.c index 8131ef0e7..773723cd5 100644 --- a/src/spicelib/devices/hfet1/hfetmdel.c +++ b/src/spicelib/devices/hfet1/hfetmdel.c @@ -32,9 +32,9 @@ HFETAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hfet2/hfet2del.c b/src/spicelib/devices/hfet2/hfet2del.c index a523edf22..262f8c15e 100644 --- a/src/spicelib/devices/hfet2/hfet2del.c +++ b/src/spicelib/devices/hfet2/hfet2del.c @@ -22,7 +22,7 @@ HFET2delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/hfet2/hfet2dest.c b/src/spicelib/devices/hfet2/hfet2dest.c index 18e44fa63..4cb752d93 100644 --- a/src/spicelib/devices/hfet2/hfet2dest.c +++ b/src/spicelib/devices/hfet2/hfet2dest.c @@ -18,10 +18,10 @@ HFET2destroy(GENmodel **inModel) HFET2instance *inst = HFET2instances(mod); while (inst) { HFET2instance *next_inst = HFET2nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/hfet2/hfet2mdel.c b/src/spicelib/devices/hfet2/hfet2mdel.c index 57b9a0b87..c80b45c4a 100644 --- a/src/spicelib/devices/hfet2/hfet2mdel.c +++ b/src/spicelib/devices/hfet2/hfet2mdel.c @@ -32,9 +32,9 @@ HFET2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hisim2/hsm2del.c b/src/spicelib/devices/hisim2/hsm2del.c index dd261146c..787ac4895 100644 --- a/src/spicelib/devices/hisim2/hsm2del.c +++ b/src/spicelib/devices/hisim2/hsm2del.c @@ -70,7 +70,7 @@ HSM2delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/hisim2/hsm2dest.c b/src/spicelib/devices/hisim2/hsm2dest.c index dc7b5ffde..03ec5fc57 100644 --- a/src/spicelib/devices/hisim2/hsm2dest.c +++ b/src/spicelib/devices/hisim2/hsm2dest.c @@ -74,10 +74,10 @@ HSM2destroy(GENmodel **inModel) HSM2instance *inst = HSM2instances(mod); while (inst) { HSM2instance *next_inst = HSM2nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/hisim2/hsm2mdel.c b/src/spicelib/devices/hisim2/hsm2mdel.c index eae5d772a..325287d12 100644 --- a/src/spicelib/devices/hisim2/hsm2mdel.c +++ b/src/spicelib/devices/hisim2/hsm2mdel.c @@ -79,9 +79,9 @@ HSM2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hisimhv1/hsmhvdel.c b/src/spicelib/devices/hisimhv1/hsmhvdel.c index a8bee3383..70040a511 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvdel.c +++ b/src/spicelib/devices/hisimhv1/hsmhvdel.c @@ -31,7 +31,7 @@ HSMHVdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/hisimhv1/hsmhvdest.c b/src/spicelib/devices/hisimhv1/hsmhvdest.c index 9e83fbbcf..96d84645d 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvdest.c +++ b/src/spicelib/devices/hisimhv1/hsmhvdest.c @@ -30,10 +30,10 @@ HSMHVdestroy(GENmodel **inModel) HSMHVinstance *inst = HSMHVinstances(mod); while (inst) { HSMHVinstance *next_inst = HSMHVnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/hisimhv1/hsmhvmdel.c b/src/spicelib/devices/hisimhv1/hsmhvmdel.c index 088f5298f..b05f2fca7 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvmdel.c +++ b/src/spicelib/devices/hisimhv1/hsmhvmdel.c @@ -40,9 +40,9 @@ HSMHVmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hisimhv2/hsmhv2del.c b/src/spicelib/devices/hisimhv2/hsmhv2del.c index 577aba1c4..d21fa8840 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2del.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2del.c @@ -73,7 +73,7 @@ HSMHV2delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/hisimhv2/hsmhv2dest.c b/src/spicelib/devices/hisimhv2/hsmhv2dest.c index cb02f7f79..49143e3d9 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2dest.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2dest.c @@ -72,10 +72,10 @@ HSMHV2destroy(GENmodel **inModel) HSMHV2instance *inst = HSMHV2instances(mod); while (inst) { HSMHV2instance *next_inst = HSMHV2nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c index f92131ce9..b65ebb64f 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c @@ -82,9 +82,9 @@ HSMHV2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ind/inddel.c b/src/spicelib/devices/ind/inddel.c index aa4473191..e22ec883a 100644 --- a/src/spicelib/devices/ind/inddel.c +++ b/src/spicelib/devices/ind/inddel.c @@ -18,7 +18,7 @@ INDdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/ind/inddest.c b/src/spicelib/devices/ind/inddest.c index c463dc3b1..2ed0d2dc5 100644 --- a/src/spicelib/devices/ind/inddest.c +++ b/src/spicelib/devices/ind/inddest.c @@ -18,10 +18,10 @@ INDdestroy(GENmodel **inModel) INDinstance *inst = INDinstances(mod); while (inst) { INDinstance *next_inst = INDnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/ind/indmdel.c b/src/spicelib/devices/ind/indmdel.c index 0bb698e21..68b85c23b 100644 --- a/src/spicelib/devices/ind/indmdel.c +++ b/src/spicelib/devices/ind/indmdel.c @@ -28,9 +28,9 @@ INDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ind/mutdel.c b/src/spicelib/devices/ind/mutdel.c index 65f62c733..a6cea58a4 100644 --- a/src/spicelib/devices/ind/mutdel.c +++ b/src/spicelib/devices/ind/mutdel.c @@ -19,7 +19,7 @@ MUTdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/ind/mutdest.c b/src/spicelib/devices/ind/mutdest.c index 5395dce93..5dfeb0944 100644 --- a/src/spicelib/devices/ind/mutdest.c +++ b/src/spicelib/devices/ind/mutdest.c @@ -20,10 +20,10 @@ MUTdestroy(GENmodel **inModel) MUTinstance *inst = MUTinstances(mod); while (inst) { MUTinstance *next_inst = MUTnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/ind/mutmdel.c b/src/spicelib/devices/ind/mutmdel.c index 16ea6f4bd..8c0f412a8 100644 --- a/src/spicelib/devices/ind/mutmdel.c +++ b/src/spicelib/devices/ind/mutmdel.c @@ -29,10 +29,10 @@ MUTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } #endif /* MUTUAL */ diff --git a/src/spicelib/devices/isrc/isrcdel.c b/src/spicelib/devices/isrc/isrcdel.c index ffb666c1f..6b4f24387 100644 --- a/src/spicelib/devices/isrc/isrcdel.c +++ b/src/spicelib/devices/isrc/isrcdel.c @@ -18,7 +18,7 @@ ISRCdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/isrc/isrcdest.c b/src/spicelib/devices/isrc/isrcdest.c index 5a47a33eb..4536d6869 100644 --- a/src/spicelib/devices/isrc/isrcdest.c +++ b/src/spicelib/devices/isrc/isrcdest.c @@ -19,10 +19,10 @@ ISRCdestroy(GENmodel **inModel) while (inst) { ISRCinstance *next_inst = ISRCnextInstance(inst); FREE(inst->ISRCcoeffs); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/isrc/isrcmdel.c b/src/spicelib/devices/isrc/isrcmdel.c index 78b2c9de9..1536f6473 100644 --- a/src/spicelib/devices/isrc/isrcmdel.c +++ b/src/spicelib/devices/isrc/isrcmdel.c @@ -28,9 +28,9 @@ ISRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/jfet/jfetdel.c b/src/spicelib/devices/jfet/jfetdel.c index f26dbb62d..1d3c17c4a 100644 --- a/src/spicelib/devices/jfet/jfetdel.c +++ b/src/spicelib/devices/jfet/jfetdel.c @@ -18,7 +18,7 @@ JFETdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/jfet/jfetdest.c b/src/spicelib/devices/jfet/jfetdest.c index 919bb6a8e..ad6bfb432 100644 --- a/src/spicelib/devices/jfet/jfetdest.c +++ b/src/spicelib/devices/jfet/jfetdest.c @@ -18,10 +18,10 @@ JFETdestroy(GENmodel **inModel) JFETinstance *inst = JFETinstances(mod); while (inst) { JFETinstance *next_inst = JFETnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/jfet/jfetmdel.c b/src/spicelib/devices/jfet/jfetmdel.c index e89c5de81..b8fa711b0 100644 --- a/src/spicelib/devices/jfet/jfetmdel.c +++ b/src/spicelib/devices/jfet/jfetmdel.c @@ -28,9 +28,9 @@ JFETmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/jfet2/jfet2del.c b/src/spicelib/devices/jfet2/jfet2del.c index b6e5b61d1..a8a64625c 100644 --- a/src/spicelib/devices/jfet2/jfet2del.c +++ b/src/spicelib/devices/jfet2/jfet2del.c @@ -22,7 +22,7 @@ JFET2delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/jfet2/jfet2dest.c b/src/spicelib/devices/jfet2/jfet2dest.c index e06662d13..8fb5c1157 100644 --- a/src/spicelib/devices/jfet2/jfet2dest.c +++ b/src/spicelib/devices/jfet2/jfet2dest.c @@ -22,10 +22,10 @@ JFET2destroy(GENmodel **inModel) JFET2instance *inst = JFET2instances(mod); while (inst) { JFET2instance *next_inst = JFET2nextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/jfet2/jfet2mdel.c b/src/spicelib/devices/jfet2/jfet2mdel.c index e96d45769..7ebebd3da 100644 --- a/src/spicelib/devices/jfet2/jfet2mdel.c +++ b/src/spicelib/devices/jfet2/jfet2mdel.c @@ -32,9 +32,9 @@ JFET2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ltra/ltradel.c b/src/spicelib/devices/ltra/ltradel.c index 2840b4ee0..cac5b4b49 100644 --- a/src/spicelib/devices/ltra/ltradel.c +++ b/src/spicelib/devices/ltra/ltradel.c @@ -18,7 +18,7 @@ LTRAdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/ltra/ltradest.c b/src/spicelib/devices/ltra/ltradest.c index 9fc9eeea5..41cdab4e6 100644 --- a/src/spicelib/devices/ltra/ltradest.c +++ b/src/spicelib/devices/ltra/ltradest.c @@ -18,10 +18,10 @@ LTRAdestroy(GENmodel **inModel) LTRAinstance *inst = LTRAinstances(mod); while (inst) { LTRAinstance *next_inst = LTRAnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/ltra/ltramdel.c b/src/spicelib/devices/ltra/ltramdel.c index f7d55089d..fd7ad3547 100644 --- a/src/spicelib/devices/ltra/ltramdel.c +++ b/src/spicelib/devices/ltra/ltramdel.c @@ -28,9 +28,9 @@ LTRAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mes/mesdel.c b/src/spicelib/devices/mes/mesdel.c index c470fab6d..32e88cff9 100644 --- a/src/spicelib/devices/mes/mesdel.c +++ b/src/spicelib/devices/mes/mesdel.c @@ -18,7 +18,7 @@ MESdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/mes/mesdest.c b/src/spicelib/devices/mes/mesdest.c index b83f934cb..3a854ab70 100644 --- a/src/spicelib/devices/mes/mesdest.c +++ b/src/spicelib/devices/mes/mesdest.c @@ -18,10 +18,10 @@ MESdestroy(GENmodel **inModel) MESinstance *inst = MESinstances(mod); while (inst) { MESinstance *next_inst = MESnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/mes/mesmdel.c b/src/spicelib/devices/mes/mesmdel.c index 76578171a..6e46b0b2f 100644 --- a/src/spicelib/devices/mes/mesmdel.c +++ b/src/spicelib/devices/mes/mesmdel.c @@ -28,9 +28,9 @@ MESmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mesa/mesadel.c b/src/spicelib/devices/mesa/mesadel.c index 38697ce93..7ef19658f 100644 --- a/src/spicelib/devices/mesa/mesadel.c +++ b/src/spicelib/devices/mesa/mesadel.c @@ -22,7 +22,7 @@ MESAdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/mesa/mesadest.c b/src/spicelib/devices/mesa/mesadest.c index 5173c3555..dddd84222 100644 --- a/src/spicelib/devices/mesa/mesadest.c +++ b/src/spicelib/devices/mesa/mesadest.c @@ -18,10 +18,10 @@ MESAdestroy(GENmodel **inModel) MESAinstance *inst = MESAinstances(mod); while (inst) { MESAinstance *next_inst = MESAnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/mesa/mesamdel.c b/src/spicelib/devices/mesa/mesamdel.c index 2231528be..d611c8cc0 100644 --- a/src/spicelib/devices/mesa/mesamdel.c +++ b/src/spicelib/devices/mesa/mesamdel.c @@ -32,9 +32,9 @@ MESAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mos1/mos1del.c b/src/spicelib/devices/mos1/mos1del.c index fae053cda..b25e05fc7 100644 --- a/src/spicelib/devices/mos1/mos1del.c +++ b/src/spicelib/devices/mos1/mos1del.c @@ -18,7 +18,7 @@ MOS1delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/mos1/mos1dest.c b/src/spicelib/devices/mos1/mos1dest.c index 1538b6b4d..1f79dbdd1 100644 --- a/src/spicelib/devices/mos1/mos1dest.c +++ b/src/spicelib/devices/mos1/mos1dest.c @@ -19,10 +19,10 @@ MOS1destroy(GENmodel **inModel) while (inst) { MOS1instance *next_inst = MOS1nextInstance(inst); FREE(inst->MOS1sens); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/mos1/mos1mdel.c b/src/spicelib/devices/mos1/mos1mdel.c index c15061fdf..19bc2a190 100644 --- a/src/spicelib/devices/mos1/mos1mdel.c +++ b/src/spicelib/devices/mos1/mos1mdel.c @@ -28,9 +28,9 @@ MOS1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mos2/mos2del.c b/src/spicelib/devices/mos2/mos2del.c index 105d3025e..6bc460948 100644 --- a/src/spicelib/devices/mos2/mos2del.c +++ b/src/spicelib/devices/mos2/mos2del.c @@ -18,7 +18,7 @@ MOS2delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/mos2/mos2dest.c b/src/spicelib/devices/mos2/mos2dest.c index 18a991a51..9374b2cdc 100644 --- a/src/spicelib/devices/mos2/mos2dest.c +++ b/src/spicelib/devices/mos2/mos2dest.c @@ -19,10 +19,10 @@ MOS2destroy(GENmodel **inModel) while (inst) { MOS2instance *next_inst = MOS2nextInstance(inst); FREE(inst->MOS2sens); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/mos2/mos2mdel.c b/src/spicelib/devices/mos2/mos2mdel.c index f62af9857..b4ae8bdde 100644 --- a/src/spicelib/devices/mos2/mos2mdel.c +++ b/src/spicelib/devices/mos2/mos2mdel.c @@ -28,9 +28,9 @@ MOS2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mos3/mos3del.c b/src/spicelib/devices/mos3/mos3del.c index 0a55ce9af..e7e93de32 100644 --- a/src/spicelib/devices/mos3/mos3del.c +++ b/src/spicelib/devices/mos3/mos3del.c @@ -18,7 +18,7 @@ MOS3delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/mos3/mos3dest.c b/src/spicelib/devices/mos3/mos3dest.c index dfdab0ff4..9d4398a15 100644 --- a/src/spicelib/devices/mos3/mos3dest.c +++ b/src/spicelib/devices/mos3/mos3dest.c @@ -19,10 +19,10 @@ MOS3destroy(GENmodel **inModel) while (inst) { MOS3instance *next_inst = MOS3nextInstance(inst); FREE(inst->MOS3sens); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/mos3/mos3mdel.c b/src/spicelib/devices/mos3/mos3mdel.c index fae010af4..dd05d072b 100644 --- a/src/spicelib/devices/mos3/mos3mdel.c +++ b/src/spicelib/devices/mos3/mos3mdel.c @@ -28,9 +28,9 @@ MOS3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mos6/mos6dest.c b/src/spicelib/devices/mos6/mos6dest.c index f4f83945f..6d47f2240 100644 --- a/src/spicelib/devices/mos6/mos6dest.c +++ b/src/spicelib/devices/mos6/mos6dest.c @@ -19,10 +19,10 @@ MOS6destroy(GENmodel **inModel) while (inst) { MOS6instance *next_inst = MOS6nextInstance(inst); FREE(inst->MOS6sens); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/mos9/mos9del.c b/src/spicelib/devices/mos9/mos9del.c index b5628def3..19dcd2437 100644 --- a/src/spicelib/devices/mos9/mos9del.c +++ b/src/spicelib/devices/mos9/mos9del.c @@ -19,7 +19,7 @@ MOS9delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/mos9/mos9dest.c b/src/spicelib/devices/mos9/mos9dest.c index ad30e8817..c235641c6 100644 --- a/src/spicelib/devices/mos9/mos9dest.c +++ b/src/spicelib/devices/mos9/mos9dest.c @@ -20,10 +20,10 @@ MOS9destroy(GENmodel **inModel) while (inst) { MOS9instance *next_inst = MOS9nextInstance(inst); FREE(inst->MOS9sens); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/mos9/mos9mdel.c b/src/spicelib/devices/mos9/mos9mdel.c index 7f9bc46fc..0ae175316 100644 --- a/src/spicelib/devices/mos9/mos9mdel.c +++ b/src/spicelib/devices/mos9/mos9mdel.c @@ -29,9 +29,9 @@ MOS9mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/nbjt/nbjtdel.c b/src/spicelib/devices/nbjt/nbjtdel.c index a55dfade9..f5dc70ce4 100644 --- a/src/spicelib/devices/nbjt/nbjtdel.c +++ b/src/spicelib/devices/nbjt/nbjtdel.c @@ -23,7 +23,7 @@ NBJTdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/nbjt/nbjtdest.c b/src/spicelib/devices/nbjt/nbjtdest.c index b3da2522c..b07ed2fa8 100644 --- a/src/spicelib/devices/nbjt/nbjtdest.c +++ b/src/spicelib/devices/nbjt/nbjtdest.c @@ -26,10 +26,10 @@ NBJTdestroy(GENmodel **inModel) while (inst) { NBJTinstance *next_inst = NBJTnextInstance(inst); ONEdestroy(inst->NBJTpDevice); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/nbjt/nbjtmdel.c b/src/spicelib/devices/nbjt/nbjtmdel.c index 29696e97f..641a1f465 100644 --- a/src/spicelib/devices/nbjt/nbjtmdel.c +++ b/src/spicelib/devices/nbjt/nbjtmdel.c @@ -32,6 +32,6 @@ NBJTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/nbjt2/nbt2del.c b/src/spicelib/devices/nbjt2/nbt2del.c index 2a138f409..c59a65f51 100644 --- a/src/spicelib/devices/nbjt2/nbt2del.c +++ b/src/spicelib/devices/nbjt2/nbt2del.c @@ -23,7 +23,7 @@ NBJT2delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/nbjt2/nbt2dest.c b/src/spicelib/devices/nbjt2/nbt2dest.c index 2d3b3b5b0..247d43e7c 100644 --- a/src/spicelib/devices/nbjt2/nbt2dest.c +++ b/src/spicelib/devices/nbjt2/nbt2dest.c @@ -26,10 +26,10 @@ NBJT2destroy(GENmodel **inModel) while (inst) { NBJT2instance *next_inst = NBJT2nextInstance(inst); TWOdestroy(inst->NBJT2pDevice); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/nbjt2/nbt2mdel.c b/src/spicelib/devices/nbjt2/nbt2mdel.c index 7b899fea5..472af1558 100644 --- a/src/spicelib/devices/nbjt2/nbt2mdel.c +++ b/src/spicelib/devices/nbjt2/nbt2mdel.c @@ -32,6 +32,6 @@ NBJT2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ndev/ndevdel.c b/src/spicelib/devices/ndev/ndevdel.c index a8db556d4..980fbe387 100644 --- a/src/spicelib/devices/ndev/ndevdel.c +++ b/src/spicelib/devices/ndev/ndevdel.c @@ -19,7 +19,7 @@ NDEVdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/ndev/ndevdest.c b/src/spicelib/devices/ndev/ndevdest.c index 0c175ea42..a9680f482 100644 --- a/src/spicelib/devices/ndev/ndevdest.c +++ b/src/spicelib/devices/ndev/ndevdest.c @@ -19,12 +19,12 @@ NDEVdestroy(GENmodel **inModel) NDEVinstance *inst = NDEVinstances(mod); while (inst) { NDEVinstance *next_inst = NDEVnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } close(mod->sock); printf("Disconnect to remote NDEV server %s:%d\n", mod->host, mod->port); - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/numd/numddel.c b/src/spicelib/devices/numd/numddel.c index 4d5651093..30ffc85c7 100644 --- a/src/spicelib/devices/numd/numddel.c +++ b/src/spicelib/devices/numd/numddel.c @@ -18,7 +18,7 @@ NUMDdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/numd/numddest.c b/src/spicelib/devices/numd/numddest.c index 5ef34418d..6d339f938 100644 --- a/src/spicelib/devices/numd/numddest.c +++ b/src/spicelib/devices/numd/numddest.c @@ -26,10 +26,10 @@ NUMDdestroy(GENmodel **inModel) while (inst) { NUMDinstance *next_inst = NUMDnextInstance(inst); ONEdestroy(inst->NUMDpDevice); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/numd/numdmdel.c b/src/spicelib/devices/numd/numdmdel.c index 2cb1cf537..1b345f225 100644 --- a/src/spicelib/devices/numd/numdmdel.c +++ b/src/spicelib/devices/numd/numdmdel.c @@ -28,9 +28,9 @@ NUMDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/numd2/nud2del.c b/src/spicelib/devices/numd2/nud2del.c index 5379f3943..4105e494c 100644 --- a/src/spicelib/devices/numd2/nud2del.c +++ b/src/spicelib/devices/numd2/nud2del.c @@ -18,7 +18,7 @@ NUMD2delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/numd2/nud2dest.c b/src/spicelib/devices/numd2/nud2dest.c index 6f989a6f4..fdc37fd79 100644 --- a/src/spicelib/devices/numd2/nud2dest.c +++ b/src/spicelib/devices/numd2/nud2dest.c @@ -27,10 +27,10 @@ NUMD2destroy(GENmodel **inModel) while (inst) { NUMD2instance *next_inst = NUMD2nextInstance(inst); TWOdestroy(inst->NUMD2pDevice); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/numd2/nud2mdel.c b/src/spicelib/devices/numd2/nud2mdel.c index b5dd133a7..e4174ab27 100644 --- a/src/spicelib/devices/numd2/nud2mdel.c +++ b/src/spicelib/devices/numd2/nud2mdel.c @@ -28,9 +28,9 @@ NUMD2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/numos/nummdel.c b/src/spicelib/devices/numos/nummdel.c index 343cb314c..c8f32fd9d 100644 --- a/src/spicelib/devices/numos/nummdel.c +++ b/src/spicelib/devices/numos/nummdel.c @@ -23,7 +23,7 @@ NUMOSdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/numos/nummdest.c b/src/spicelib/devices/numos/nummdest.c index ce4dd4fff..74ee7fae1 100644 --- a/src/spicelib/devices/numos/nummdest.c +++ b/src/spicelib/devices/numos/nummdest.c @@ -26,10 +26,10 @@ NUMOSdestroy(GENmodel **inModel) while (inst) { NUMOSinstance *next_inst = NUMOSnextInstance(inst); TWOdestroy(inst->NUMOSpDevice); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/numos/nummmdel.c b/src/spicelib/devices/numos/nummmdel.c index 9d6aa84c4..925d994c0 100644 --- a/src/spicelib/devices/numos/nummmdel.c +++ b/src/spicelib/devices/numos/nummmdel.c @@ -32,6 +32,6 @@ NUMOSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/res/resdel.c b/src/spicelib/devices/res/resdel.c index f466a8a02..e13696501 100644 --- a/src/spicelib/devices/res/resdel.c +++ b/src/spicelib/devices/res/resdel.c @@ -18,7 +18,7 @@ RESdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/res/resdest.c b/src/spicelib/devices/res/resdest.c index fb4ab33f8..67dbe4dba 100644 --- a/src/spicelib/devices/res/resdest.c +++ b/src/spicelib/devices/res/resdest.c @@ -18,10 +18,10 @@ RESdestroy(GENmodel **inModel) RESinstance *inst = RESinstances(mod); while (inst) { RESinstance *next_inst = RESnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/res/resmdel.c b/src/spicelib/devices/res/resmdel.c index 044b2b44b..850581315 100644 --- a/src/spicelib/devices/res/resmdel.c +++ b/src/spicelib/devices/res/resmdel.c @@ -28,9 +28,9 @@ RESmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/soi3/soi3del.c b/src/spicelib/devices/soi3/soi3del.c index af4d2ce88..f85deb279 100644 --- a/src/spicelib/devices/soi3/soi3del.c +++ b/src/spicelib/devices/soi3/soi3del.c @@ -35,7 +35,7 @@ SOI3delete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/soi3/soi3dest.c b/src/spicelib/devices/soi3/soi3dest.c index 0d120cad6..e225ea95a 100644 --- a/src/spicelib/devices/soi3/soi3dest.c +++ b/src/spicelib/devices/soi3/soi3dest.c @@ -36,10 +36,10 @@ SOI3destroy(GENmodel **inModel) while (inst) { SOI3instance *next_inst = SOI3nextInstance(inst); /* FREE(inst->SOI3sens); */ - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/soi3/soi3mdel.c b/src/spicelib/devices/soi3/soi3mdel.c index 53a07e648..f7daa775e 100644 --- a/src/spicelib/devices/soi3/soi3mdel.c +++ b/src/spicelib/devices/soi3/soi3mdel.c @@ -45,9 +45,9 @@ SOI3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/sw/swdelete.c b/src/spicelib/devices/sw/swdelete.c index fd874ce81..ba7026279 100644 --- a/src/spicelib/devices/sw/swdelete.c +++ b/src/spicelib/devices/sw/swdelete.c @@ -18,7 +18,7 @@ SWdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/sw/swdest.c b/src/spicelib/devices/sw/swdest.c index 2c23592b0..7b8ddd8a1 100644 --- a/src/spicelib/devices/sw/swdest.c +++ b/src/spicelib/devices/sw/swdest.c @@ -18,10 +18,10 @@ SWdestroy(GENmodel **inModel) SWinstance *inst = SWinstances(mod); while (inst) { SWinstance *next_inst = SWnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/sw/swmdel.c b/src/spicelib/devices/sw/swmdel.c index 336b57033..312f69645 100644 --- a/src/spicelib/devices/sw/swmdel.c +++ b/src/spicelib/devices/sw/swmdel.c @@ -28,9 +28,9 @@ SWmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/tra/tradel.c b/src/spicelib/devices/tra/tradel.c index 4ca19180c..79efd7b5f 100644 --- a/src/spicelib/devices/tra/tradel.c +++ b/src/spicelib/devices/tra/tradel.c @@ -18,7 +18,7 @@ TRAdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/tra/tradest.c b/src/spicelib/devices/tra/tradest.c index 913482322..b9a7f5387 100644 --- a/src/spicelib/devices/tra/tradest.c +++ b/src/spicelib/devices/tra/tradest.c @@ -18,10 +18,10 @@ TRAdestroy(GENmodel **inModel) TRAinstance *inst = TRAinstances(mod); while (inst) { TRAinstance *next_inst = TRAnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/tra/tramdel.c b/src/spicelib/devices/tra/tramdel.c index 4a64458d5..7a24f2f34 100644 --- a/src/spicelib/devices/tra/tramdel.c +++ b/src/spicelib/devices/tra/tramdel.c @@ -28,9 +28,9 @@ TRAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/txl/txldel.c b/src/spicelib/devices/txl/txldel.c index c6e7fb3e8..799f7d46e 100644 --- a/src/spicelib/devices/txl/txldel.c +++ b/src/spicelib/devices/txl/txldel.c @@ -19,7 +19,7 @@ TXLdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/txl/txldest.c b/src/spicelib/devices/txl/txldest.c index 07ee634c1..40025b185 100644 --- a/src/spicelib/devices/txl/txldest.c +++ b/src/spicelib/devices/txl/txldest.c @@ -19,10 +19,10 @@ TXLdestroy(GENmodel **inModel) TXLinstance *inst = TXLinstances(mod); while (inst) { TXLinstance *next_inst = TXLnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/txl/txlmdel.c b/src/spicelib/devices/txl/txlmdel.c index 66291f75c..fa109a7d8 100644 --- a/src/spicelib/devices/txl/txlmdel.c +++ b/src/spicelib/devices/txl/txlmdel.c @@ -29,9 +29,9 @@ TXLmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/urc/urcdel.c b/src/spicelib/devices/urc/urcdel.c index d0fa6a572..886b0dda7 100644 --- a/src/spicelib/devices/urc/urcdel.c +++ b/src/spicelib/devices/urc/urcdel.c @@ -18,7 +18,7 @@ URCdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/urc/urcdest.c b/src/spicelib/devices/urc/urcdest.c index 91f3d3093..503c43bfc 100644 --- a/src/spicelib/devices/urc/urcdest.c +++ b/src/spicelib/devices/urc/urcdest.c @@ -18,10 +18,10 @@ URCdestroy(GENmodel **inModel) URCinstance *inst = URCinstances(mod); while (inst) { URCinstance *next_inst = URCnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/urc/urcmdel.c b/src/spicelib/devices/urc/urcmdel.c index 0950fd45a..be75b9942 100644 --- a/src/spicelib/devices/urc/urcmdel.c +++ b/src/spicelib/devices/urc/urcmdel.c @@ -28,9 +28,9 @@ URCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/vbic/vbicdel.c b/src/spicelib/devices/vbic/vbicdel.c index a5123100a..8b48706a5 100644 --- a/src/spicelib/devices/vbic/vbicdel.c +++ b/src/spicelib/devices/vbic/vbicdel.c @@ -25,7 +25,7 @@ VBICdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/vbic/vbicdest.c b/src/spicelib/devices/vbic/vbicdest.c index c90b433e1..a5f469963 100644 --- a/src/spicelib/devices/vbic/vbicdest.c +++ b/src/spicelib/devices/vbic/vbicdest.c @@ -26,10 +26,10 @@ VBICdestroy(GENmodel **inModel) while (inst) { VBICinstance *next_inst = VBICnextInstance(inst); FREE(inst->VBICsens); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/vbic/vbicmdel.c b/src/spicelib/devices/vbic/vbicmdel.c index d676a03d7..e00527c88 100644 --- a/src/spicelib/devices/vbic/vbicmdel.c +++ b/src/spicelib/devices/vbic/vbicmdel.c @@ -35,6 +35,6 @@ VBICmDelete(GENmodel **models, IFuid modname, GENmodel *kill) if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/vccs/vccsdel.c b/src/spicelib/devices/vccs/vccsdel.c index 1a7e94e6d..8180fbeee 100644 --- a/src/spicelib/devices/vccs/vccsdel.c +++ b/src/spicelib/devices/vccs/vccsdel.c @@ -18,7 +18,7 @@ VCCSdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/vccs/vccsdest.c b/src/spicelib/devices/vccs/vccsdest.c index f306a97df..162b09df5 100644 --- a/src/spicelib/devices/vccs/vccsdest.c +++ b/src/spicelib/devices/vccs/vccsdest.c @@ -18,10 +18,10 @@ VCCSdestroy(GENmodel **inModel) VCCSinstance *inst = VCCSinstances(mod); while (inst) { VCCSinstance *next_inst = VCCSnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/vccs/vccsmdel.c b/src/spicelib/devices/vccs/vccsmdel.c index 727eed09b..7592ad685 100644 --- a/src/spicelib/devices/vccs/vccsmdel.c +++ b/src/spicelib/devices/vccs/vccsmdel.c @@ -28,9 +28,9 @@ VCCSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/vcvs/vcvsdel.c b/src/spicelib/devices/vcvs/vcvsdel.c index 1ce2fc137..6e47dc249 100644 --- a/src/spicelib/devices/vcvs/vcvsdel.c +++ b/src/spicelib/devices/vcvs/vcvsdel.c @@ -18,7 +18,7 @@ VCVSdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/vcvs/vcvsdest.c b/src/spicelib/devices/vcvs/vcvsdest.c index 00eb900a3..a5680d38a 100644 --- a/src/spicelib/devices/vcvs/vcvsdest.c +++ b/src/spicelib/devices/vcvs/vcvsdest.c @@ -18,10 +18,10 @@ VCVSdestroy(GENmodel **inModel) VCVSinstance *inst = VCVSinstances(mod); while (inst) { VCVSinstance *next_inst = VCVSnextInstance(inst); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/vcvs/vcvsmdel.c b/src/spicelib/devices/vcvs/vcvsmdel.c index 65443d6ed..39e715b24 100644 --- a/src/spicelib/devices/vcvs/vcvsmdel.c +++ b/src/spicelib/devices/vcvs/vcvsmdel.c @@ -28,9 +28,9 @@ VCVSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/vsrc/vsrcdel.c b/src/spicelib/devices/vsrc/vsrcdel.c index 740a4628e..cc91d71f6 100644 --- a/src/spicelib/devices/vsrc/vsrcdel.c +++ b/src/spicelib/devices/vsrc/vsrcdel.c @@ -18,7 +18,7 @@ VSRCdelete(GENmodel *model, IFuid name, GENinstance **kill) for (; here; here = *prev) { if (here->GENname == name || (kill && here == *kill)) { *prev = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); return OK; } prev = &(here->GENnextInstance); diff --git a/src/spicelib/devices/vsrc/vsrcdest.c b/src/spicelib/devices/vsrc/vsrcdest.c index 3a3f94fcd..61b8db770 100644 --- a/src/spicelib/devices/vsrc/vsrcdest.c +++ b/src/spicelib/devices/vsrc/vsrcdest.c @@ -19,10 +19,10 @@ VSRCdestroy(GENmodel **inModel) while (inst) { VSRCinstance *next_inst = VSRCnextInstance(inst); FREE(inst->VSRCcoeffs); - FREE(inst); + GENinstanceFree(GENinstanceOf(inst)); inst = next_inst; } - FREE(mod); + GENmodelFree(GENmodelOf(mod)); mod = next_mod; } diff --git a/src/spicelib/devices/vsrc/vsrcmdel.c b/src/spicelib/devices/vsrc/vsrcmdel.c index 00cb4deff..7bb35b575 100644 --- a/src/spicelib/devices/vsrc/vsrcmdel.c +++ b/src/spicelib/devices/vsrc/vsrcmdel.c @@ -28,9 +28,9 @@ VSRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; - FREE(here); + GENinstanceFree(here); here = next_instance; } - FREE(model); + GENmodelFree(model); return OK; } diff --git a/src/xspice/mif/mifdelete.c b/src/xspice/mif/mifdelete.c index 567d8e61c..270ebe2a4 100644 --- a/src/xspice/mif/mifdelete.c +++ b/src/xspice/mif/mifdelete.c @@ -215,7 +215,7 @@ MIFdelete( /* Finally, free the instance struct itself */ - FREE(here); + GENinstanceFree(GENinstanceOf(here)); return(OK); } diff --git a/src/xspice/mif/mifmdelete.c b/src/xspice/mif/mifmdelete.c index aaa7d270c..b97bffb89 100644 --- a/src/xspice/mif/mifmdelete.c +++ b/src/xspice/mif/mifmdelete.c @@ -99,6 +99,6 @@ int MIFmDelete( FREE(here->param); /* Free the model and return */ - FREE(here); + GENmodelFree(GENmodelOf(here)); return(OK); }