From f25b7e2f08f24b357aef3d0965bfbfc17de24fda Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 14 Jan 2018 11:52:21 +0100 Subject: [PATCH] DEVmodDelete(), change API instead of searching and then deleting a device-model, just delete a given model. drop the loop to remove all instances too. Both, search and instance removal, shall be done somewhere else. right now nowhere, because DEVmodDelete() currently isn't used anyway. --- src/include/ngspice/devdefs.h | 4 +-- src/include/ngspice/dllitf.h | 2 +- src/include/ngspice/mifproto.h | 2 -- .../devices/adms/admst/ngspiceMODULEext.h.xml | 2 +- .../adms/admst/ngspiceMODULEmdel.c.xml | 21 +------------ src/spicelib/devices/asrc/asrcext.h | 2 +- src/spicelib/devices/asrc/asrcmdel.c | 24 +-------------- src/spicelib/devices/bjt/bjtext.h | 2 +- src/spicelib/devices/bjt/bjtmdel.c | 17 +---------- src/spicelib/devices/bsim1/b1mdel.c | 21 +------------ src/spicelib/devices/bsim1/bsim1ext.h | 2 +- src/spicelib/devices/bsim2/b2mdel.c | 21 +------------ src/spicelib/devices/bsim2/bsim2ext.h | 2 +- src/spicelib/devices/bsim3/b3mdel.c | 21 +------------ src/spicelib/devices/bsim3/bsim3ext.h | 2 +- src/spicelib/devices/bsim3soi_dd/b3soiddext.h | 2 +- .../devices/bsim3soi_dd/b3soiddmdel.c | 21 +------------ src/spicelib/devices/bsim3soi_fd/b3soifdext.h | 2 +- .../devices/bsim3soi_fd/b3soifdmdel.c | 21 +------------ src/spicelib/devices/bsim3soi_pd/b3soipdext.h | 2 +- .../devices/bsim3soi_pd/b3soipdmdel.c | 21 +------------ src/spicelib/devices/bsim3v0/b3v0mdel.c | 21 +------------ src/spicelib/devices/bsim3v0/bsim3v0ext.h | 2 +- src/spicelib/devices/bsim3v1/b3v1mdel.c | 21 +------------ src/spicelib/devices/bsim3v1/bsim3v1ext.h | 2 +- src/spicelib/devices/bsim3v32/b3v32mdel.c | 21 +------------ src/spicelib/devices/bsim3v32/bsim3v32ext.h | 2 +- src/spicelib/devices/bsim4/b4mdel.c | 21 +------------ src/spicelib/devices/bsim4/bsim4ext.h | 2 +- src/spicelib/devices/bsim4v5/b4v5mdel.c | 21 +------------ src/spicelib/devices/bsim4v5/bsim4v5ext.h | 2 +- src/spicelib/devices/bsim4v6/b4v6mdel.c | 21 +------------ src/spicelib/devices/bsim4v6/bsim4v6ext.h | 2 +- src/spicelib/devices/bsim4v7/b4v7mdel.c | 21 +------------ src/spicelib/devices/bsim4v7/bsim4v7ext.h | 2 +- src/spicelib/devices/bsimsoi/b4soiext.h | 2 +- src/spicelib/devices/bsimsoi/b4soimdel.c | 21 +------------ src/spicelib/devices/cap/capext.h | 2 +- src/spicelib/devices/cap/capmdel.c | 21 +------------ src/spicelib/devices/cccs/cccsext.h | 2 +- src/spicelib/devices/cccs/cccsmdel.c | 21 +------------ src/spicelib/devices/ccvs/ccvsext.h | 2 +- src/spicelib/devices/ccvs/ccvsmdel.c | 21 +------------ src/spicelib/devices/cpl/cplext.h | 2 +- src/spicelib/devices/cpl/cplmdel.c | 21 +------------ src/spicelib/devices/csw/cswext.h | 2 +- src/spicelib/devices/csw/cswmdel.c | 21 +------------ src/spicelib/devices/dio/dioext.h | 2 +- src/spicelib/devices/dio/diomdel.c | 21 +------------ src/spicelib/devices/hfet1/hfetext.h | 2 +- src/spicelib/devices/hfet1/hfetmdel.c | 21 +------------ src/spicelib/devices/hfet2/hfet2ext.h | 2 +- src/spicelib/devices/hfet2/hfet2mdel.c | 21 +------------ src/spicelib/devices/hisim2/hsm2ext.h | 2 +- src/spicelib/devices/hisim2/hsm2mdel.c | 21 +------------ src/spicelib/devices/hisimhv1/hsmhvext.h | 2 +- src/spicelib/devices/hisimhv1/hsmhvmdel.c | 21 +------------ src/spicelib/devices/hisimhv2/hsmhv2ext.h | 2 +- src/spicelib/devices/hisimhv2/hsmhv2mdel.c | 21 +------------ src/spicelib/devices/ind/indext.h | 4 +-- src/spicelib/devices/ind/indmdel.c | 21 +------------ src/spicelib/devices/ind/mutmdel.c | 21 +------------ src/spicelib/devices/isrc/isrcext.h | 2 +- src/spicelib/devices/isrc/isrcmdel.c | 21 +------------ src/spicelib/devices/jfet/jfetext.h | 2 +- src/spicelib/devices/jfet/jfetmdel.c | 21 +------------ src/spicelib/devices/jfet2/jfet2ext.h | 2 +- src/spicelib/devices/jfet2/jfet2mdel.c | 21 +------------ src/spicelib/devices/ltra/ltraext.h | 2 +- src/spicelib/devices/ltra/ltramdel.c | 21 +------------ src/spicelib/devices/mes/mesext.h | 2 +- src/spicelib/devices/mes/mesmdel.c | 21 +------------ src/spicelib/devices/mesa/mesaext.h | 2 +- src/spicelib/devices/mesa/mesamdel.c | 21 +------------ src/spicelib/devices/mos1/mos1ext.h | 2 +- src/spicelib/devices/mos1/mos1mdel.c | 21 +------------ src/spicelib/devices/mos2/mos2ext.h | 2 +- src/spicelib/devices/mos2/mos2mdel.c | 21 +------------ src/spicelib/devices/mos3/mos3ext.h | 2 +- src/spicelib/devices/mos3/mos3mdel.c | 21 +------------ src/spicelib/devices/mos6/mos6ext.h | 2 +- src/spicelib/devices/mos6/mos6mdel.c | 21 +------------ src/spicelib/devices/mos9/mos9ext.h | 2 +- src/spicelib/devices/mos9/mos9mdel.c | 21 +------------ src/spicelib/devices/nbjt/nbjtext.h | 2 +- src/spicelib/devices/nbjt/nbjtmdel.c | 17 +---------- src/spicelib/devices/nbjt2/nbjt2ext.h | 2 +- src/spicelib/devices/nbjt2/nbt2mdel.c | 17 +---------- src/spicelib/devices/ndev/ndevext.h | 2 +- src/spicelib/devices/ndev/ndevmdel.c | 6 ++-- src/spicelib/devices/numd/numdext.h | 2 +- src/spicelib/devices/numd/numdmdel.c | 21 +------------ src/spicelib/devices/numd2/nud2mdel.c | 21 +------------ src/spicelib/devices/numd2/numd2ext.h | 2 +- src/spicelib/devices/numos/nummmdel.c | 17 +---------- src/spicelib/devices/numos/numosext.h | 2 +- src/spicelib/devices/res/resext.h | 2 +- src/spicelib/devices/res/resmdel.c | 21 +------------ src/spicelib/devices/soi3/soi3ext.h | 2 +- src/spicelib/devices/soi3/soi3mdel.c | 21 +------------ src/spicelib/devices/sw/swext.h | 2 +- src/spicelib/devices/sw/swmdel.c | 21 +------------ src/spicelib/devices/tra/traext.h | 2 +- src/spicelib/devices/tra/tramdel.c | 21 +------------ src/spicelib/devices/txl/txlext.h | 2 +- src/spicelib/devices/txl/txlmdel.c | 21 +------------ src/spicelib/devices/urc/urcext.h | 2 +- src/spicelib/devices/urc/urcmdel.c | 21 +------------ src/spicelib/devices/vbic/vbicext.h | 2 +- src/spicelib/devices/vbic/vbicmdel.c | 17 +---------- src/spicelib/devices/vccs/vccsext.h | 2 +- src/spicelib/devices/vccs/vccsmdel.c | 21 +------------ src/spicelib/devices/vcvs/vcvsext.h | 2 +- src/spicelib/devices/vcvs/vcvsmdel.c | 21 +------------ src/spicelib/devices/vsrc/vsrcext.h | 2 +- src/spicelib/devices/vsrc/vsrcmdel.c | 21 +------------ src/xspice/icm/dlmain.c | 4 +-- src/xspice/mif/mifdestr.c | 6 ++-- src/xspice/mif/mifmdelete.c | 30 +------------------ 119 files changed, 123 insertions(+), 1204 deletions(-) diff --git a/src/include/ngspice/devdefs.h b/src/include/ngspice/devdefs.h index 711751ff2..942ae68ad 100644 --- a/src/include/ngspice/devdefs.h +++ b/src/include/ngspice/devdefs.h @@ -71,8 +71,8 @@ typedef struct SPICEdev { /* subroutine to call on acceptance of a timepoint */ void (*DEVdestroy)(GENmodel**); /* subroutine to destroy all models and instances */ - int (*DEVmodDelete)(GENmodel**,IFuid,GENmodel*); - /* subroutine to delete a model and all instances */ + int (*DEVmodDelete)(GENmodel*); + /* subroutine to delete a model */ int (*DEVdelete)(GENinstance*); /* subroutine to delete an instance */ int (*DEVsetic)(GENmodel*,CKTcircuit*); diff --git a/src/include/ngspice/dllitf.h b/src/include/ngspice/dllitf.h index ea2e14325..1353cdc75 100644 --- a/src/include/ngspice/dllitf.h +++ b/src/include/ngspice/dllitf.h @@ -27,7 +27,7 @@ struct coreInfo_t { int ((*dllitf_MIFtrunc)(GENmodel *, CKTcircuit *, double *)); int ((*dllitf_MIFconvTest)(GENmodel *, CKTcircuit *)); int ((*dllitf_MIFdelete)(GENinstance *)); - int ((*dllitf_MIFmDelete)(GENmodel **, IFuid, GENmodel *)); + int ((*dllitf_MIFmDelete)(GENmodel *)); void ((*dllitf_MIFdestroy)(GENmodel **)); char * ((*dllitf_MIFgettok)(char **)); char * ((*dllitf_MIFget_token)(char **, Mif_Token_Type_t *)); diff --git a/src/include/ngspice/mifproto.h b/src/include/ngspice/mifproto.h index a2e1959a3..c412cd7ba 100644 --- a/src/include/ngspice/mifproto.h +++ b/src/include/ngspice/mifproto.h @@ -129,8 +129,6 @@ extern int MIFdelete( ); extern int MIFmDelete( - GENmodel **inModel, - IFuid modname, GENmodel *model ); diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEext.h.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEext.h.xml index 086635087..9a8516782 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEext.h.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEext.h.xml @@ -46,7 +46,7 @@ extern int $(module)acLoad(GENmodel *,CKTcircuit*); extern int $(module)convTest(GENmodel *,CKTcircuit*); extern int $(module)delete(GENinstance*); extern int $(module)getic(GENmodel*,CKTcircuit*); -extern int $(module)mDelete(GENmodel**,IFuid,GENmodel*); +extern int $(module)mDelete(GENmodel*); extern int $(module)noise(int,int,GENmodel*,CKTcircuit*,Ndata*,double*); extern int $(module)pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int $(module)trunc(GENmodel*,CKTcircuit*,double*); diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULEmdel.c.xml b/src/spicelib/devices/adms/admst/ngspiceMODULEmdel.c.xml index d48317b08..1134969b6 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULEmdel.c.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULEmdel.c.xml @@ -46,27 +46,8 @@ #include "ngspice/suffix.h" int -$(module)mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +$(module)mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/asrc/asrcext.h b/src/spicelib/devices/asrc/asrcext.h index 27a15b5d4..81510999e 100644 --- a/src/spicelib/devices/asrc/asrcext.h +++ b/src/spicelib/devices/asrc/asrcext.h @@ -9,7 +9,7 @@ extern int ASRCdelete(GENinstance *); extern void ASRCdestroy(GENmodel **); extern int ASRCfindBr(CKTcircuit *, GENmodel *, IFuid); extern int ASRCload(GENmodel *, CKTcircuit *); -extern int ASRCmDelete(GENmodel **, IFuid, GENmodel *); +extern int ASRCmDelete(GENmodel *); extern int ASRCparam(int, IFvalue *, GENinstance *, IFvalue *); extern int ASRCpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); extern int ASRCacLoad(GENmodel *, CKTcircuit *); diff --git a/src/spicelib/devices/asrc/asrcmdel.c b/src/spicelib/devices/asrc/asrcmdel.c index ff2fa54d9..f8fee94a7 100644 --- a/src/spicelib/devices/asrc/asrcmdel.c +++ b/src/spicelib/devices/asrc/asrcmdel.c @@ -10,30 +10,8 @@ Author: 1987 Kanwar Jit Singh int -ASRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +ASRCmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - FREE(((ASRCinstance*)here)->ASRCacValues); - GENinstanceFree(here); - here = next_instance; - } - GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bjt/bjtext.h b/src/spicelib/devices/bjt/bjtext.h index 29b30859f..d4db1d732 100644 --- a/src/spicelib/devices/bjt/bjtext.h +++ b/src/spicelib/devices/bjt/bjtext.h @@ -15,7 +15,7 @@ extern void BJTdestroy(GENmodel**); extern int BJTgetic(GENmodel*,CKTcircuit*); extern int BJTload(GENmodel*,CKTcircuit*); extern int BJTmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int BJTmDelete(GENmodel**,IFuid,GENmodel*); +extern int BJTmDelete(GENmodel*); extern int BJTmParam(int,IFvalue*,GENmodel*); extern int BJTparam(int,IFvalue*,GENinstance*,IFvalue*); extern int BJTpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/bjt/bjtmdel.c b/src/spicelib/devices/bjt/bjtmdel.c index ca8faf94d..8deb4128e 100644 --- a/src/spicelib/devices/bjt/bjtmdel.c +++ b/src/spicelib/devices/bjt/bjtmdel.c @@ -16,23 +16,8 @@ Author: 1985 Thomas L. Quarles int -BJTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +BJTmDelete(GENmodel *model) { - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - if (model->GENinstances) - return E_NOTEMPTY; - *prev = model->GENnextModel; GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim1/b1mdel.c b/src/spicelib/devices/bsim1/b1mdel.c index e41be0147..3da9b006b 100644 --- a/src/spicelib/devices/bsim1/b1mdel.c +++ b/src/spicelib/devices/bsim1/b1mdel.c @@ -10,27 +10,8 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int -B1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +B1mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim1/bsim1ext.h b/src/spicelib/devices/bsim1/bsim1ext.h index ffe891703..a0acd26c8 100644 --- a/src/spicelib/devices/bsim1/bsim1ext.h +++ b/src/spicelib/devices/bsim1/bsim1ext.h @@ -13,7 +13,7 @@ extern void B1destroy(GENmodel**); extern int B1getic(GENmodel*,CKTcircuit*); extern int B1load(GENmodel*,CKTcircuit*); extern int B1mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B1mDelete(GENmodel**,IFuid,GENmodel*); +extern int B1mDelete(GENmodel*); extern int B1mParam(int,IFvalue*,GENmodel*); extern void B1mosCap(CKTcircuit*, double, double, double, double*, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim2/b2mdel.c b/src/spicelib/devices/bsim2/b2mdel.c index 4b7aebfea..25208281c 100644 --- a/src/spicelib/devices/bsim2/b2mdel.c +++ b/src/spicelib/devices/bsim2/b2mdel.c @@ -10,27 +10,8 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int -B2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +B2mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim2/bsim2ext.h b/src/spicelib/devices/bsim2/bsim2ext.h index cf88f9758..7c0938684 100644 --- a/src/spicelib/devices/bsim2/bsim2ext.h +++ b/src/spicelib/devices/bsim2/bsim2ext.h @@ -11,7 +11,7 @@ extern void B2destroy(GENmodel**); extern int B2getic(GENmodel*,CKTcircuit*); extern int B2load(GENmodel*,CKTcircuit*); extern int B2mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B2mDelete(GENmodel**,IFuid,GENmodel*); +extern int B2mDelete(GENmodel*); extern int B2mParam(int,IFvalue*,GENmodel*); extern void B2mosCap(CKTcircuit*, double, double, double, double*, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3/b3mdel.c b/src/spicelib/devices/bsim3/b3mdel.c index 4c3754340..b4d9c813a 100644 --- a/src/spicelib/devices/bsim3/b3mdel.c +++ b/src/spicelib/devices/bsim3/b3mdel.c @@ -15,27 +15,8 @@ int -BSIM3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +BSIM3mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3/bsim3ext.h b/src/spicelib/devices/bsim3/bsim3ext.h index 9c7df5bbf..ae547203e 100644 --- a/src/spicelib/devices/bsim3/bsim3ext.h +++ b/src/spicelib/devices/bsim3/bsim3ext.h @@ -13,7 +13,7 @@ extern void BSIM3destroy(GENmodel**); extern int BSIM3getic(GENmodel*,CKTcircuit*); extern int BSIM3load(GENmodel*,CKTcircuit*); extern int BSIM3mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int BSIM3mDelete(GENmodel**,IFuid,GENmodel*); +extern int BSIM3mDelete(GENmodel*); extern int BSIM3mParam(int,IFvalue*,GENmodel*); extern void BSIM3mosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddext.h b/src/spicelib/devices/bsim3soi_dd/b3soiddext.h index 45504ba43..f74b3ac98 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddext.h +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddext.h @@ -13,7 +13,7 @@ extern void B3SOIDDdestroy(GENmodel**); extern int B3SOIDDgetic(GENmodel*,CKTcircuit*); extern int B3SOIDDload(GENmodel*,CKTcircuit*); extern int B3SOIDDmAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B3SOIDDmDelete(GENmodel**,IFuid,GENmodel*); +extern int B3SOIDDmDelete(GENmodel*); extern int B3SOIDDmParam(int,IFvalue*,GENmodel*); extern void B3SOIDDmosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c index 93bdf08f4..85f60b70e 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c @@ -18,27 +18,8 @@ Modified by Paolo Nenzi 2002 int -B3SOIDDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +B3SOIDDmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdext.h b/src/spicelib/devices/bsim3soi_fd/b3soifdext.h index 4c4308640..7bde5328b 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdext.h +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdext.h @@ -13,7 +13,7 @@ extern void B3SOIFDdestroy(GENmodel**); extern int B3SOIFDgetic(GENmodel*,CKTcircuit*); extern int B3SOIFDload(GENmodel*,CKTcircuit*); extern int B3SOIFDmAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B3SOIFDmDelete(GENmodel**,IFuid,GENmodel*); +extern int B3SOIFDmDelete(GENmodel*); extern int B3SOIFDmParam(int,IFvalue*,GENmodel*); extern void B3SOIFDmosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c index d15f7dd02..6d366d737 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c @@ -17,27 +17,8 @@ File: b3soifdmdel.c 98/5/01 int -B3SOIFDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +B3SOIFDmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdext.h b/src/spicelib/devices/bsim3soi_pd/b3soipdext.h index a2ebdedd7..1cfa3ec63 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdext.h +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdext.h @@ -13,7 +13,7 @@ extern void B3SOIPDdestroy(GENmodel**); extern int B3SOIPDgetic(GENmodel*,CKTcircuit*); extern int B3SOIPDload(GENmodel*,CKTcircuit*); extern int B3SOIPDmAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B3SOIPDmDelete(GENmodel**,IFuid,GENmodel*); +extern int B3SOIPDmDelete(GENmodel*); extern int B3SOIPDmParam(int,IFvalue*,GENmodel*); extern void B3SOIPDmosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c index 9fca64c30..fdff67f2b 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c @@ -17,27 +17,8 @@ Modified by Paolo Nenzi 2002 int -B3SOIPDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +B3SOIPDmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3v0/b3v0mdel.c b/src/spicelib/devices/bsim3v0/b3v0mdel.c index bf33c9d35..f074ffc57 100644 --- a/src/spicelib/devices/bsim3v0/b3v0mdel.c +++ b/src/spicelib/devices/bsim3v0/b3v0mdel.c @@ -11,27 +11,8 @@ File: b3v0mdel.c int -BSIM3v0mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +BSIM3v0mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3v0/bsim3v0ext.h b/src/spicelib/devices/bsim3v0/bsim3v0ext.h index 85715c7c4..13d38e90a 100644 --- a/src/spicelib/devices/bsim3v0/bsim3v0ext.h +++ b/src/spicelib/devices/bsim3v0/bsim3v0ext.h @@ -12,7 +12,7 @@ extern void BSIM3v0destroy(GENmodel**); extern int BSIM3v0getic(GENmodel*,CKTcircuit*); extern int BSIM3v0load(GENmodel*,CKTcircuit*); extern int BSIM3v0mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int BSIM3v0mDelete(GENmodel**,IFuid,GENmodel*); +extern int BSIM3v0mDelete(GENmodel*); extern int BSIM3v0mParam(int,IFvalue*,GENmodel*); extern void BSIM3v0mosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3v1/b3v1mdel.c b/src/spicelib/devices/bsim3v1/b3v1mdel.c index 6dae70965..11c94eb47 100644 --- a/src/spicelib/devices/bsim3v1/b3v1mdel.c +++ b/src/spicelib/devices/bsim3v1/b3v1mdel.c @@ -17,27 +17,8 @@ int -BSIM3v1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +BSIM3v1mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3v1/bsim3v1ext.h b/src/spicelib/devices/bsim3v1/bsim3v1ext.h index 7479b4ee5..d17f5f724 100644 --- a/src/spicelib/devices/bsim3v1/bsim3v1ext.h +++ b/src/spicelib/devices/bsim3v1/bsim3v1ext.h @@ -13,7 +13,7 @@ extern void BSIM3v1destroy(GENmodel **); extern int BSIM3v1getic(GENmodel *, CKTcircuit *); extern int BSIM3v1load(GENmodel *, CKTcircuit *); extern int BSIM3v1mAsk(CKTcircuit *, GENmodel *, int, IFvalue *); -extern int BSIM3v1mDelete(GENmodel **, IFuid, GENmodel *); +extern int BSIM3v1mDelete(GENmodel *); extern int BSIM3v1mParam(int, IFvalue *, GENmodel *); extern void BSIM3v1mosCap(CKTcircuit *, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim3v32/b3v32mdel.c b/src/spicelib/devices/bsim3v32/b3v32mdel.c index cf90c0ecb..9466b312b 100644 --- a/src/spicelib/devices/bsim3v32/b3v32mdel.c +++ b/src/spicelib/devices/bsim3v32/b3v32mdel.c @@ -16,27 +16,8 @@ int -BSIM3v32mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +BSIM3v32mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim3v32/bsim3v32ext.h b/src/spicelib/devices/bsim3v32/bsim3v32ext.h index a04fb6778..597501d66 100644 --- a/src/spicelib/devices/bsim3v32/bsim3v32ext.h +++ b/src/spicelib/devices/bsim3v32/bsim3v32ext.h @@ -14,7 +14,7 @@ extern void BSIM3v32destroy(GENmodel**); extern int BSIM3v32getic(GENmodel*,CKTcircuit*); extern int BSIM3v32load(GENmodel*,CKTcircuit*); extern int BSIM3v32mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int BSIM3v32mDelete(GENmodel**,IFuid,GENmodel*); +extern int BSIM3v32mDelete(GENmodel*); extern int BSIM3v32mParam(int,IFvalue*,GENmodel*); extern void BSIM3v32mosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim4/b4mdel.c b/src/spicelib/devices/bsim4/b4mdel.c index 49e638563..564e09516 100644 --- a/src/spicelib/devices/bsim4/b4mdel.c +++ b/src/spicelib/devices/bsim4/b4mdel.c @@ -65,27 +65,8 @@ int -BSIM4mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +BSIM4mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim4/bsim4ext.h b/src/spicelib/devices/bsim4/bsim4ext.h index 4786dd2f9..814c48137 100644 --- a/src/spicelib/devices/bsim4/bsim4ext.h +++ b/src/spicelib/devices/bsim4/bsim4ext.h @@ -66,7 +66,7 @@ extern void BSIM4destroy(GENmodel**); extern int BSIM4getic(GENmodel*,CKTcircuit*); extern int BSIM4load(GENmodel*,CKTcircuit*); extern int BSIM4mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int BSIM4mDelete(GENmodel**,IFuid,GENmodel*); +extern int BSIM4mDelete(GENmodel*); extern int BSIM4mParam(int,IFvalue*,GENmodel*); extern void BSIM4mosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim4v5/b4v5mdel.c b/src/spicelib/devices/bsim4v5/b4v5mdel.c index 0738eea7c..05ac65ab5 100644 --- a/src/spicelib/devices/bsim4v5/b4v5mdel.c +++ b/src/spicelib/devices/bsim4v5/b4v5mdel.c @@ -15,27 +15,8 @@ int -BSIM4v5mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +BSIM4v5mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim4v5/bsim4v5ext.h b/src/spicelib/devices/bsim4v5/bsim4v5ext.h index b906984d4..d9f826f34 100644 --- a/src/spicelib/devices/bsim4v5/bsim4v5ext.h +++ b/src/spicelib/devices/bsim4v5/bsim4v5ext.h @@ -13,7 +13,7 @@ extern void BSIM4v5destroy(GENmodel**); extern int BSIM4v5getic(GENmodel*,CKTcircuit*); extern int BSIM4v5load(GENmodel*,CKTcircuit*); extern int BSIM4v5mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int BSIM4v5mDelete(GENmodel**,IFuid,GENmodel*); +extern int BSIM4v5mDelete(GENmodel*); extern int BSIM4v5mParam(int,IFvalue*,GENmodel*); extern void BSIM4v5mosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim4v6/b4v6mdel.c b/src/spicelib/devices/bsim4v6/b4v6mdel.c index 079f1acad..8c341a1aa 100644 --- a/src/spicelib/devices/bsim4v6/b4v6mdel.c +++ b/src/spicelib/devices/bsim4v6/b4v6mdel.c @@ -17,27 +17,8 @@ int -BSIM4v6mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +BSIM4v6mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim4v6/bsim4v6ext.h b/src/spicelib/devices/bsim4v6/bsim4v6ext.h index e2a20db49..336d1c7aa 100644 --- a/src/spicelib/devices/bsim4v6/bsim4v6ext.h +++ b/src/spicelib/devices/bsim4v6/bsim4v6ext.h @@ -13,7 +13,7 @@ extern void BSIM4v6destroy(GENmodel**); extern int BSIM4v6getic(GENmodel*,CKTcircuit*); extern int BSIM4v6load(GENmodel*,CKTcircuit*); extern int BSIM4v6mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int BSIM4v6mDelete(GENmodel**,IFuid,GENmodel*); +extern int BSIM4v6mDelete(GENmodel*); extern int BSIM4v6mParam(int,IFvalue*,GENmodel*); extern void BSIM4v6mosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsim4v7/b4v7mdel.c b/src/spicelib/devices/bsim4v7/b4v7mdel.c index 3765abf94..f8a866026 100644 --- a/src/spicelib/devices/bsim4v7/b4v7mdel.c +++ b/src/spicelib/devices/bsim4v7/b4v7mdel.c @@ -17,27 +17,8 @@ int -BSIM4v7mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +BSIM4v7mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/bsim4v7/bsim4v7ext.h b/src/spicelib/devices/bsim4v7/bsim4v7ext.h index 93919858f..9304b0cbb 100644 --- a/src/spicelib/devices/bsim4v7/bsim4v7ext.h +++ b/src/spicelib/devices/bsim4v7/bsim4v7ext.h @@ -13,7 +13,7 @@ extern void BSIM4v7destroy(GENmodel**); extern int BSIM4v7getic(GENmodel*,CKTcircuit*); extern int BSIM4v7load(GENmodel*,CKTcircuit*); extern int BSIM4v7mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int BSIM4v7mDelete(GENmodel**,IFuid,GENmodel*); +extern int BSIM4v7mDelete(GENmodel*); extern int BSIM4v7mParam(int,IFvalue*,GENmodel*); extern void BSIM4v7mosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsimsoi/b4soiext.h b/src/spicelib/devices/bsimsoi/b4soiext.h index b2133c266..8f8c00f01 100644 --- a/src/spicelib/devices/bsimsoi/b4soiext.h +++ b/src/spicelib/devices/bsimsoi/b4soiext.h @@ -15,7 +15,7 @@ extern void B4SOIdestroy(GENmodel**); extern int B4SOIgetic(GENmodel*,CKTcircuit*); extern int B4SOIload(GENmodel*,CKTcircuit*); extern int B4SOImAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int B4SOImDelete(GENmodel**,IFuid,GENmodel*); +extern int B4SOImDelete(GENmodel*); extern int B4SOImParam(int,IFvalue*,GENmodel*); extern void B4SOImosCap(CKTcircuit*, double, double, double, double, double, double, double, double, double, double, double, diff --git a/src/spicelib/devices/bsimsoi/b4soimdel.c b/src/spicelib/devices/bsimsoi/b4soimdel.c index d214a08e4..7955fb0cd 100644 --- a/src/spicelib/devices/bsimsoi/b4soimdel.c +++ b/src/spicelib/devices/bsimsoi/b4soimdel.c @@ -21,27 +21,8 @@ int -B4SOImDelete(GENmodel **models, IFuid modname, GENmodel *kill) +B4SOImDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/cap/capext.h b/src/spicelib/devices/cap/capext.h index e42b8dc31..6e1a6fd61 100644 --- a/src/spicelib/devices/cap/capext.h +++ b/src/spicelib/devices/cap/capext.h @@ -10,7 +10,7 @@ extern void CAPdestroy(GENmodel**); extern int CAPgetic(GENmodel*,CKTcircuit*); extern int CAPload(GENmodel*,CKTcircuit*); extern int CAPmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int CAPmDelete(GENmodel**,IFuid,GENmodel*); +extern int CAPmDelete(GENmodel*); extern int CAPmParam(int,IFvalue*,GENmodel*); extern int CAPparam(int,IFvalue*,GENinstance*,IFvalue*); extern int CAPpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/cap/capmdel.c b/src/spicelib/devices/cap/capmdel.c index a46daaee6..69251827f 100644 --- a/src/spicelib/devices/cap/capmdel.c +++ b/src/spicelib/devices/cap/capmdel.c @@ -11,27 +11,8 @@ Modified: Spetember 2003 Paolo Nenzi int -CAPmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +CAPmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/cccs/cccsext.h b/src/spicelib/devices/cccs/cccsext.h index 162ad9d61..d855bbf53 100644 --- a/src/spicelib/devices/cccs/cccsext.h +++ b/src/spicelib/devices/cccs/cccsext.h @@ -8,7 +8,7 @@ extern int CCCSask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int CCCSdelete(GENinstance*); extern void CCCSdestroy(GENmodel**); extern int CCCSload(GENmodel*,CKTcircuit*); -extern int CCCSmDelete(GENmodel**,IFuid,GENmodel*); +extern int CCCSmDelete(GENmodel*); extern int CCCSparam(int,IFvalue*,GENinstance*,IFvalue*); extern int CCCSpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int CCCSsAcLoad(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/cccs/cccsmdel.c b/src/spicelib/devices/cccs/cccsmdel.c index e94f15539..3ce18a5f8 100644 --- a/src/spicelib/devices/cccs/cccsmdel.c +++ b/src/spicelib/devices/cccs/cccsmdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -CCCSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +CCCSmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ccvs/ccvsext.h b/src/spicelib/devices/ccvs/ccvsext.h index bb6ba2e4c..29f7a7740 100644 --- a/src/spicelib/devices/ccvs/ccvsext.h +++ b/src/spicelib/devices/ccvs/ccvsext.h @@ -8,7 +8,7 @@ extern int CCVSdelete(GENinstance*); extern void CCVSdestroy(GENmodel**); extern int CCVSfindBr(CKTcircuit*,GENmodel*,IFuid); extern int CCVSload(GENmodel*,CKTcircuit*); -extern int CCVSmDelete(GENmodel**,IFuid,GENmodel*); +extern int CCVSmDelete(GENmodel*); extern int CCVSparam(int,IFvalue*,GENinstance*,IFvalue*); extern int CCVSpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int CCVSsAcLoad(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/ccvs/ccvsmdel.c b/src/spicelib/devices/ccvs/ccvsmdel.c index 9364224af..188cf93eb 100644 --- a/src/spicelib/devices/ccvs/ccvsmdel.c +++ b/src/spicelib/devices/ccvs/ccvsmdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -CCVSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +CCVSmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/cpl/cplext.h b/src/spicelib/devices/cpl/cplext.h index 16db90c93..048bea92c 100644 --- a/src/spicelib/devices/cpl/cplext.h +++ b/src/spicelib/devices/cpl/cplext.h @@ -9,7 +9,7 @@ extern int CPLdelete(GENinstance*); extern void CPLdestroy(GENmodel**); extern int CPLload(GENmodel*, CKTcircuit*); extern int CPLmAsk(CKTcircuit*, GENmodel*, int, IFvalue*); -extern int CPLmDelete(GENmodel**, IFuid,GENmodel*); +extern int CPLmDelete(GENmodel*); extern int CPLmParam(int,IFvalue*, GENmodel*); extern int CPLparam(int,IFvalue*, GENinstance*, IFvalue*); extern int CPLsetup(SMPmatrix*, GENmodel*, CKTcircuit*, int*); diff --git a/src/spicelib/devices/cpl/cplmdel.c b/src/spicelib/devices/cpl/cplmdel.c index 870ff946f..3d314653e 100644 --- a/src/spicelib/devices/cpl/cplmdel.c +++ b/src/spicelib/devices/cpl/cplmdel.c @@ -12,27 +12,8 @@ Author: 1992 Charles Hough int -CPLmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +CPLmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/csw/cswext.h b/src/spicelib/devices/csw/cswext.h index 25307d9cd..42cce69ee 100644 --- a/src/spicelib/devices/csw/cswext.h +++ b/src/spicelib/devices/csw/cswext.h @@ -10,7 +10,7 @@ extern int CSWdelete(GENinstance*); extern void CSWdestroy(GENmodel**); extern int CSWload(GENmodel*,CKTcircuit*); extern int CSWmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int CSWmDelete(GENmodel**,IFuid,GENmodel*); +extern int CSWmDelete(GENmodel*); extern int CSWmParam(int,IFvalue*,GENmodel*); extern int CSWparam(int,IFvalue*,GENinstance*,IFvalue*); extern int CSWpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/csw/cswmdel.c b/src/spicelib/devices/csw/cswmdel.c index f90841c6e..94067da23 100644 --- a/src/spicelib/devices/csw/cswmdel.c +++ b/src/spicelib/devices/csw/cswmdel.c @@ -10,27 +10,8 @@ Author: 1985 Gordon Jacobs int -CSWmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +CSWmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/dio/dioext.h b/src/spicelib/devices/dio/dioext.h index c929e89bc..0f1a91852 100644 --- a/src/spicelib/devices/dio/dioext.h +++ b/src/spicelib/devices/dio/dioext.h @@ -12,7 +12,7 @@ extern void DIOdestroy(GENmodel**); extern int DIOgetic(GENmodel*,CKTcircuit*); extern int DIOload(GENmodel*,CKTcircuit*); extern int DIOmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int DIOmDelete(GENmodel**,IFuid,GENmodel*); +extern int DIOmDelete(GENmodel*); extern int DIOmParam(int,IFvalue*,GENmodel*); extern int DIOparam(int,IFvalue*,GENinstance*,IFvalue*); extern int DIOpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/dio/diomdel.c b/src/spicelib/devices/dio/diomdel.c index 3b683f4df..eecb6e6d6 100644 --- a/src/spicelib/devices/dio/diomdel.c +++ b/src/spicelib/devices/dio/diomdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -DIOmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +DIOmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hfet1/hfetext.h b/src/spicelib/devices/hfet1/hfetext.h index 93774d10d..dc8bea209 100644 --- a/src/spicelib/devices/hfet1/hfetext.h +++ b/src/spicelib/devices/hfet1/hfetext.h @@ -10,7 +10,7 @@ extern void HFETAdestroy(GENmodel**); extern int HFETAgetic(GENmodel*,CKTcircuit*); extern int HFETAload(GENmodel*,CKTcircuit*); extern int HFETAmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int HFETAmDelete(GENmodel**,IFuid,GENmodel*); +extern int HFETAmDelete(GENmodel*); extern int HFETAmParam(int,IFvalue*,GENmodel*); extern int HFETAparam(int,IFvalue*,GENinstance*,IFvalue*); extern int HFETApzLoad(GENmodel*, CKTcircuit*, SPcomplex*); diff --git a/src/spicelib/devices/hfet1/hfetmdel.c b/src/spicelib/devices/hfet1/hfetmdel.c index 773723cd5..121c35309 100644 --- a/src/spicelib/devices/hfet1/hfetmdel.c +++ b/src/spicelib/devices/hfet1/hfetmdel.c @@ -14,27 +14,8 @@ Author: 1985 S. Hwang int -HFETAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +HFETAmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hfet2/hfet2ext.h b/src/spicelib/devices/hfet2/hfet2ext.h index 95690e74b..f009d3b9c 100644 --- a/src/spicelib/devices/hfet2/hfet2ext.h +++ b/src/spicelib/devices/hfet2/hfet2ext.h @@ -10,7 +10,7 @@ extern void HFET2destroy(GENmodel**); extern int HFET2getic(GENmodel*,CKTcircuit*); extern int HFET2load(GENmodel*,CKTcircuit*); extern int HFET2mAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int HFET2mDelete(GENmodel**,IFuid,GENmodel*); +extern int HFET2mDelete(GENmodel*); extern int HFET2mParam(int,IFvalue*,GENmodel*); extern int HFET2param(int,IFvalue*,GENinstance*,IFvalue*); extern int HFET2pzLoad(GENmodel*, CKTcircuit*, SPcomplex*); diff --git a/src/spicelib/devices/hfet2/hfet2mdel.c b/src/spicelib/devices/hfet2/hfet2mdel.c index c80b45c4a..bb1f50b19 100644 --- a/src/spicelib/devices/hfet2/hfet2mdel.c +++ b/src/spicelib/devices/hfet2/hfet2mdel.c @@ -14,27 +14,8 @@ Author: 1985 S. Hwang int -HFET2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +HFET2mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hisim2/hsm2ext.h b/src/spicelib/devices/hisim2/hsm2ext.h index 00802d6c7..c6e48517b 100644 --- a/src/spicelib/devices/hisim2/hsm2ext.h +++ b/src/spicelib/devices/hisim2/hsm2ext.h @@ -23,7 +23,7 @@ extern void HSM2destroy(GENmodel**); extern int HSM2getic(GENmodel*,CKTcircuit*); extern int HSM2load(GENmodel*,CKTcircuit*); extern int HSM2mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int HSM2mDelete(GENmodel**,IFuid,GENmodel*); +extern int HSM2mDelete(GENmodel*); extern int HSM2mParam(int,IFvalue*,GENmodel*); extern void HSM2mosCap(CKTcircuit*, double, double, double, double*, double, double, double, double, double, double, diff --git a/src/spicelib/devices/hisim2/hsm2mdel.c b/src/spicelib/devices/hisim2/hsm2mdel.c index 325287d12..ec4314775 100644 --- a/src/spicelib/devices/hisim2/hsm2mdel.c +++ b/src/spicelib/devices/hisim2/hsm2mdel.c @@ -61,27 +61,8 @@ to others." int -HSM2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +HSM2mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hisimhv1/hsmhvext.h b/src/spicelib/devices/hisimhv1/hsmhvext.h index bf40c6738..1677aa4e2 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvext.h +++ b/src/spicelib/devices/hisimhv1/hsmhvext.h @@ -23,7 +23,7 @@ extern void HSMHVdestroy(GENmodel**); extern int HSMHVgetic(GENmodel*,CKTcircuit*); extern int HSMHVload(GENmodel*,CKTcircuit*); extern int HSMHVmAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int HSMHVmDelete(GENmodel**,IFuid,GENmodel*); +extern int HSMHVmDelete(GENmodel*); extern int HSMHVmParam(int,IFvalue*,GENmodel*); extern void HSMHVmosCap(CKTcircuit*, double, double, double, double*, double, double, double, double, double, double, diff --git a/src/spicelib/devices/hisimhv1/hsmhvmdel.c b/src/spicelib/devices/hisimhv1/hsmhvmdel.c index b05f2fca7..c2e12046e 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvmdel.c +++ b/src/spicelib/devices/hisimhv1/hsmhvmdel.c @@ -22,27 +22,8 @@ int -HSMHVmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +HSMHVmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/hisimhv2/hsmhv2ext.h b/src/spicelib/devices/hisimhv2/hsmhv2ext.h index b67f5cd2e..7e4a64a99 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2ext.h +++ b/src/spicelib/devices/hisimhv2/hsmhv2ext.h @@ -23,7 +23,7 @@ extern void HSMHV2destroy(GENmodel**); extern int HSMHV2getic(GENmodel*,CKTcircuit*); extern int HSMHV2load(GENmodel*,CKTcircuit*); extern int HSMHV2mAsk(CKTcircuit*,GENmodel *,int, IFvalue*); -extern int HSMHV2mDelete(GENmodel**,IFuid,GENmodel*); +extern int HSMHV2mDelete(GENmodel*); extern int HSMHV2mParam(int,IFvalue*,GENmodel*); extern void HSMHV2mosCap(CKTcircuit*, double, double, double, double*, double, double, double, double, double, double, diff --git a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c index b65ebb64f..f5ceb8853 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c @@ -64,27 +64,8 @@ June 2008 (revised October 2011) int -HSMHV2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +HSMHV2mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ind/indext.h b/src/spicelib/devices/ind/indext.h index f9c912d6c..959798af5 100644 --- a/src/spicelib/devices/ind/indext.h +++ b/src/spicelib/devices/ind/indext.h @@ -11,7 +11,7 @@ extern int INDmAsk(CKTcircuit*, GENmodel*, int, IFvalue*); extern int INDdelete(GENinstance*); extern void INDdestroy(GENmodel**); extern int INDload(GENmodel*,CKTcircuit*); -extern int INDmDelete(GENmodel**,IFuid,GENmodel*); +extern int INDmDelete(GENmodel*); extern int INDmParam(int, IFvalue*, GENmodel*); extern int INDparam(int,IFvalue*,GENinstance*,IFvalue*); extern int INDpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); @@ -29,7 +29,7 @@ extern int MUTacLoad(GENmodel*,CKTcircuit*); extern int MUTask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int MUTdelete(GENinstance*); extern void MUTdestroy(GENmodel**); -extern int MUTmDelete(GENmodel**,IFuid,GENmodel*); +extern int MUTmDelete(GENmodel*); extern int MUTparam(int,IFvalue*,GENinstance*,IFvalue*); extern int MUTpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern void MUTsPrint(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/ind/indmdel.c b/src/spicelib/devices/ind/indmdel.c index 68b85c23b..d6fec5885 100644 --- a/src/spicelib/devices/ind/indmdel.c +++ b/src/spicelib/devices/ind/indmdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -INDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +INDmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ind/mutmdel.c b/src/spicelib/devices/ind/mutmdel.c index 8c0f412a8..55bbefbd1 100644 --- a/src/spicelib/devices/ind/mutmdel.c +++ b/src/spicelib/devices/ind/mutmdel.c @@ -11,27 +11,8 @@ Author: 1985 Thomas L. Quarles #ifdef MUTUAL int -MUTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +MUTmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/isrc/isrcext.h b/src/spicelib/devices/isrc/isrcext.h index 57ad03f7a..a453f01e3 100644 --- a/src/spicelib/devices/isrc/isrcext.h +++ b/src/spicelib/devices/isrc/isrcext.h @@ -9,7 +9,7 @@ extern int ISRCask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int ISRCdelete(GENinstance*); extern void ISRCdestroy(GENmodel**); extern int ISRCload(GENmodel*,CKTcircuit*); -extern int ISRCmDelete(GENmodel**,IFuid,GENmodel*); +extern int ISRCmDelete(GENmodel*); extern int ISRCparam(int,IFvalue*,GENinstance*,IFvalue*); extern int ISRCpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int ISRCtemp(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/isrc/isrcmdel.c b/src/spicelib/devices/isrc/isrcmdel.c index 1536f6473..4254d3c70 100644 --- a/src/spicelib/devices/isrc/isrcmdel.c +++ b/src/spicelib/devices/isrc/isrcmdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -ISRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +ISRCmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/jfet/jfetext.h b/src/spicelib/devices/jfet/jfetext.h index ea191dcc5..882a45f73 100644 --- a/src/spicelib/devices/jfet/jfetext.h +++ b/src/spicelib/devices/jfet/jfetext.h @@ -11,7 +11,7 @@ extern void JFETdestroy(GENmodel**); extern int JFETgetic(GENmodel*,CKTcircuit*); extern int JFETload(GENmodel*,CKTcircuit*); extern int JFETmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int JFETmDelete(GENmodel**,IFuid,GENmodel*); +extern int JFETmDelete(GENmodel*); extern int JFETmParam(int,IFvalue*,GENmodel*); extern int JFETparam(int,IFvalue*,GENinstance*,IFvalue*); extern int JFETpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/jfet/jfetmdel.c b/src/spicelib/devices/jfet/jfetmdel.c index b8fa711b0..6fc9df482 100644 --- a/src/spicelib/devices/jfet/jfetmdel.c +++ b/src/spicelib/devices/jfet/jfetmdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -JFETmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +JFETmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/jfet2/jfet2ext.h b/src/spicelib/devices/jfet2/jfet2ext.h index c4565abe5..d498027ce 100644 --- a/src/spicelib/devices/jfet2/jfet2ext.h +++ b/src/spicelib/devices/jfet2/jfet2ext.h @@ -14,7 +14,7 @@ extern void JFET2destroy(GENmodel**); extern int JFET2getic(GENmodel*,CKTcircuit*); extern int JFET2load(GENmodel*,CKTcircuit*); extern int JFET2mAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int JFET2mDelete(GENmodel**,IFuid,GENmodel*); +extern int JFET2mDelete(GENmodel*); extern int JFET2mParam(int,IFvalue*,GENmodel*); extern int JFET2param(int,IFvalue*,GENinstance*,IFvalue*); extern int JFET2setup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/jfet2/jfet2mdel.c b/src/spicelib/devices/jfet2/jfet2mdel.c index 7ebebd3da..b7ff0a00c 100644 --- a/src/spicelib/devices/jfet2/jfet2mdel.c +++ b/src/spicelib/devices/jfet2/jfet2mdel.c @@ -14,27 +14,8 @@ Modified to jfet2 for PS model definition ( Anthony E. Parker ) int -JFET2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +JFET2mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ltra/ltraext.h b/src/spicelib/devices/ltra/ltraext.h index 3524fa04e..fa1f3d972 100644 --- a/src/spicelib/devices/ltra/ltraext.h +++ b/src/spicelib/devices/ltra/ltraext.h @@ -12,7 +12,7 @@ extern int LTRAdelete(GENinstance*); extern void LTRAdestroy(GENmodel**); extern int LTRAload(GENmodel*,CKTcircuit*); extern int LTRAmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int LTRAmDelete(GENmodel**,IFuid,GENmodel*); +extern int LTRAmDelete(GENmodel*); extern int LTRAparam(int,IFvalue*,GENinstance*,IFvalue*); extern int LTRAmParam(int,IFvalue*,GENmodel*); extern int LTRAsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/ltra/ltramdel.c b/src/spicelib/devices/ltra/ltramdel.c index fd7ad3547..be14ca108 100644 --- a/src/spicelib/devices/ltra/ltramdel.c +++ b/src/spicelib/devices/ltra/ltramdel.c @@ -10,27 +10,8 @@ Author: 1990 Jaijeet S. Roychowdhury int -LTRAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +LTRAmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mes/mesext.h b/src/spicelib/devices/mes/mesext.h index 61707e059..aff6503b3 100644 --- a/src/spicelib/devices/mes/mesext.h +++ b/src/spicelib/devices/mes/mesext.h @@ -11,7 +11,7 @@ extern void MESdestroy(GENmodel**); extern int MESgetic(GENmodel*,CKTcircuit*); extern int MESload(GENmodel*,CKTcircuit*); extern int MESmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int MESmDelete(GENmodel**,IFuid,GENmodel*); +extern int MESmDelete(GENmodel*); extern int MESmParam(int,IFvalue*,GENmodel*); extern int MESparam(int,IFvalue*,GENinstance*,IFvalue*); extern int MESpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mes/mesmdel.c b/src/spicelib/devices/mes/mesmdel.c index 6e46b0b2f..d41c80cf5 100644 --- a/src/spicelib/devices/mes/mesmdel.c +++ b/src/spicelib/devices/mes/mesmdel.c @@ -10,27 +10,8 @@ Author: 1985 S. Hwang int -MESmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +MESmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mesa/mesaext.h b/src/spicelib/devices/mesa/mesaext.h index 4910567e5..673344efc 100644 --- a/src/spicelib/devices/mesa/mesaext.h +++ b/src/spicelib/devices/mesa/mesaext.h @@ -10,7 +10,7 @@ extern void MESAdestroy(GENmodel**); extern int MESAgetic(GENmodel*,CKTcircuit*); extern int MESAload(GENmodel*,CKTcircuit*); extern int MESAmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int MESAmDelete(GENmodel**,IFuid,GENmodel*); +extern int MESAmDelete(GENmodel*); extern int MESAmParam(int,IFvalue*,GENmodel*); extern int MESAparam(int,IFvalue*,GENinstance*,IFvalue*); extern int MESApzLoad(GENmodel*,CKTcircuit*, SPcomplex*); diff --git a/src/spicelib/devices/mesa/mesamdel.c b/src/spicelib/devices/mesa/mesamdel.c index d611c8cc0..aa15b1377 100644 --- a/src/spicelib/devices/mesa/mesamdel.c +++ b/src/spicelib/devices/mesa/mesamdel.c @@ -14,27 +14,8 @@ Author: 1985 S. Hwang int -MESAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +MESAmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mos1/mos1ext.h b/src/spicelib/devices/mos1/mos1ext.h index 444e94a0d..1ebd0bdfb 100644 --- a/src/spicelib/devices/mos1/mos1ext.h +++ b/src/spicelib/devices/mos1/mos1ext.h @@ -11,7 +11,7 @@ extern void MOS1destroy(GENmodel**); extern int MOS1getic(GENmodel*,CKTcircuit*); extern int MOS1load(GENmodel*,CKTcircuit*); extern int MOS1mAsk(CKTcircuit *,GENmodel *,int,IFvalue*); -extern int MOS1mDelete(GENmodel**,IFuid,GENmodel*); +extern int MOS1mDelete(GENmodel*); extern int MOS1mParam(int,IFvalue*,GENmodel*); extern int MOS1param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS1pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos1/mos1mdel.c b/src/spicelib/devices/mos1/mos1mdel.c index 19bc2a190..baffd11bd 100644 --- a/src/spicelib/devices/mos1/mos1mdel.c +++ b/src/spicelib/devices/mos1/mos1mdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -MOS1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +MOS1mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mos2/mos2ext.h b/src/spicelib/devices/mos2/mos2ext.h index e0d356e5c..c725494e8 100644 --- a/src/spicelib/devices/mos2/mos2ext.h +++ b/src/spicelib/devices/mos2/mos2ext.h @@ -12,7 +12,7 @@ extern int MOS2delete(GENinstance*); extern void MOS2destroy(GENmodel**); extern int MOS2getic(GENmodel*,CKTcircuit*); extern int MOS2load(GENmodel*,CKTcircuit*); -extern int MOS2mDelete(GENmodel**,IFuid,GENmodel*); +extern int MOS2mDelete(GENmodel*); extern int MOS2mParam(int,IFvalue*,GENmodel*); extern int MOS2param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS2pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos2/mos2mdel.c b/src/spicelib/devices/mos2/mos2mdel.c index b4ae8bdde..676b5ce74 100644 --- a/src/spicelib/devices/mos2/mos2mdel.c +++ b/src/spicelib/devices/mos2/mos2mdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -MOS2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +MOS2mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mos3/mos3ext.h b/src/spicelib/devices/mos3/mos3ext.h index ca8f4f750..88e3f53be 100644 --- a/src/spicelib/devices/mos3/mos3ext.h +++ b/src/spicelib/devices/mos3/mos3ext.h @@ -12,7 +12,7 @@ extern void MOS3destroy(GENmodel**); extern int MOS3getic(GENmodel*,CKTcircuit*); extern int MOS3load(GENmodel*,CKTcircuit*); extern int MOS3mAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int MOS3mDelete(GENmodel**,IFuid,GENmodel*); +extern int MOS3mDelete(GENmodel*); extern int MOS3mParam(int,IFvalue*,GENmodel*); extern int MOS3param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS3pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos3/mos3mdel.c b/src/spicelib/devices/mos3/mos3mdel.c index dd05d072b..c96dbf2b3 100644 --- a/src/spicelib/devices/mos3/mos3mdel.c +++ b/src/spicelib/devices/mos3/mos3mdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -MOS3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +MOS3mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mos6/mos6ext.h b/src/spicelib/devices/mos6/mos6ext.h index fd728ff56..c3ae2baac 100644 --- a/src/spicelib/devices/mos6/mos6ext.h +++ b/src/spicelib/devices/mos6/mos6ext.h @@ -10,7 +10,7 @@ extern void MOS6destroy(GENmodel**); extern int MOS6getic(GENmodel*,CKTcircuit*); extern int MOS6load(GENmodel*,CKTcircuit*); extern int MOS6mAsk(CKTcircuit *,GENmodel *,int,IFvalue*); -extern int MOS6mDelete(GENmodel**,IFuid,GENmodel*); +extern int MOS6mDelete(GENmodel*); extern int MOS6mParam(int,IFvalue*,GENmodel*); extern int MOS6param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS6pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos6/mos6mdel.c b/src/spicelib/devices/mos6/mos6mdel.c index da9fd6799..69abccb58 100644 --- a/src/spicelib/devices/mos6/mos6mdel.c +++ b/src/spicelib/devices/mos6/mos6mdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -MOS6mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +MOS6mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/mos9/mos9ext.h b/src/spicelib/devices/mos9/mos9ext.h index f3bc5fb3e..0c153ad57 100644 --- a/src/spicelib/devices/mos9/mos9ext.h +++ b/src/spicelib/devices/mos9/mos9ext.h @@ -12,7 +12,7 @@ extern void MOS9destroy(GENmodel**); extern int MOS9getic(GENmodel*,CKTcircuit*); extern int MOS9load(GENmodel*,CKTcircuit*); extern int MOS9mAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int MOS9mDelete(GENmodel**,IFuid,GENmodel*); +extern int MOS9mDelete(GENmodel*); extern int MOS9mParam(int,IFvalue*,GENmodel*); extern int MOS9param(int,IFvalue*,GENinstance*,IFvalue*); extern int MOS9pzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/mos9/mos9mdel.c b/src/spicelib/devices/mos9/mos9mdel.c index 0ae175316..fb42d040e 100644 --- a/src/spicelib/devices/mos9/mos9mdel.c +++ b/src/spicelib/devices/mos9/mos9mdel.c @@ -11,27 +11,8 @@ Modified: Alan Gillespie int -MOS9mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +MOS9mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/nbjt/nbjtext.h b/src/spicelib/devices/nbjt/nbjtext.h index ff2a85016..c6b015102 100644 --- a/src/spicelib/devices/nbjt/nbjtext.h +++ b/src/spicelib/devices/nbjt/nbjtext.h @@ -12,7 +12,7 @@ extern int NBJTdelete(GENinstance *); extern void NBJTdestroy(GENmodel **); extern int NBJTgetic(GENmodel *, CKTcircuit *); extern int NBJTload(GENmodel *, CKTcircuit *); -extern int NBJTmDelete(GENmodel **, IFuid, GENmodel *); +extern int NBJTmDelete(GENmodel *); extern int NBJTmParam(int, IFvalue *, GENmodel *); extern int NBJTparam(int, IFvalue *, GENinstance *, IFvalue *); extern int NBJTpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/nbjt/nbjtmdel.c b/src/spicelib/devices/nbjt/nbjtmdel.c index 641a1f465..00887cc8f 100644 --- a/src/spicelib/devices/nbjt/nbjtmdel.c +++ b/src/spicelib/devices/nbjt/nbjtmdel.c @@ -15,23 +15,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NBJTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +NBJTmDelete(GENmodel *model) { - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - if (model->GENinstances) - return E_NOTEMPTY; - *prev = model->GENnextModel; GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/nbjt2/nbjt2ext.h b/src/spicelib/devices/nbjt2/nbjt2ext.h index 73ba11181..cb2fe071b 100644 --- a/src/spicelib/devices/nbjt2/nbjt2ext.h +++ b/src/spicelib/devices/nbjt2/nbjt2ext.h @@ -13,7 +13,7 @@ extern int NBJT2delete(GENinstance *); extern void NBJT2destroy(GENmodel **); extern int NBJT2getic(GENmodel *, CKTcircuit *); extern int NBJT2load(GENmodel *, CKTcircuit *); -extern int NBJT2mDelete(GENmodel **, IFuid, GENmodel *); +extern int NBJT2mDelete(GENmodel *); extern int NBJT2mParam(int, IFvalue *, GENmodel *); extern int NBJT2param(int, IFvalue *, GENinstance *, IFvalue *); extern int NBJT2pzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/nbjt2/nbt2mdel.c b/src/spicelib/devices/nbjt2/nbt2mdel.c index 472af1558..7f695d6be 100644 --- a/src/spicelib/devices/nbjt2/nbt2mdel.c +++ b/src/spicelib/devices/nbjt2/nbt2mdel.c @@ -15,23 +15,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NBJT2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +NBJT2mDelete(GENmodel *model) { - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - if (model->GENinstances) - return E_NOTEMPTY; - *prev = model->GENnextModel; GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/ndev/ndevext.h b/src/spicelib/devices/ndev/ndevext.h index a42573a39..b09ad1727 100644 --- a/src/spicelib/devices/ndev/ndevext.h +++ b/src/spicelib/devices/ndev/ndevext.h @@ -15,7 +15,7 @@ extern int NDEVgetic(GENmodel *, CKTcircuit *); extern int NDEVload(GENmodel *, CKTcircuit *); extern int NDEVaccept(CKTcircuit *, GENmodel *); extern int NDEVconvTest(GENmodel *, CKTcircuit *); -extern int NDEVmDelete(GENmodel **, IFuid, GENmodel *); +extern int NDEVmDelete(GENmodel *); extern int NDEVmParam(int, IFvalue *, GENmodel *); extern int NDEVparam(int, IFvalue *, GENinstance *, IFvalue *); extern int NDEVpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/ndev/ndevmdel.c b/src/spicelib/devices/ndev/ndevmdel.c index b5d32aba1..434c2e8d2 100644 --- a/src/spicelib/devices/ndev/ndevmdel.c +++ b/src/spicelib/devices/ndev/ndevmdel.c @@ -10,11 +10,9 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NDEVmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +NDEVmDelete(GENmodel *model) { - NG_IGNORE(models); - NG_IGNORE(modname); - NG_IGNORE(kill); + NG_IGNORE(model); return OK; } diff --git a/src/spicelib/devices/numd/numdext.h b/src/spicelib/devices/numd/numdext.h index ab4a6d194..30d5ab4b2 100644 --- a/src/spicelib/devices/numd/numdext.h +++ b/src/spicelib/devices/numd/numdext.h @@ -13,7 +13,7 @@ extern int NUMDdelete(GENinstance *); extern void NUMDdestroy(GENmodel **); extern int NUMDgetic(GENmodel *, CKTcircuit *); extern int NUMDload(GENmodel *, CKTcircuit *); -extern int NUMDmDelete(GENmodel **, IFuid, GENmodel *); +extern int NUMDmDelete(GENmodel *); extern int NUMDmParam(int, IFvalue *, GENmodel *); extern int NUMDparam(int, IFvalue *, GENinstance *, IFvalue *); extern int NUMDpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/numd/numdmdel.c b/src/spicelib/devices/numd/numdmdel.c index 1b345f225..0331c85ff 100644 --- a/src/spicelib/devices/numd/numdmdel.c +++ b/src/spicelib/devices/numd/numdmdel.c @@ -10,27 +10,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +NUMDmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/numd2/nud2mdel.c b/src/spicelib/devices/numd2/nud2mdel.c index e4174ab27..e4ea59c5a 100644 --- a/src/spicelib/devices/numd2/nud2mdel.c +++ b/src/spicelib/devices/numd2/nud2mdel.c @@ -10,27 +10,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMD2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +NUMD2mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/numd2/numd2ext.h b/src/spicelib/devices/numd2/numd2ext.h index 0ee71429d..d22e7e95d 100644 --- a/src/spicelib/devices/numd2/numd2ext.h +++ b/src/spicelib/devices/numd2/numd2ext.h @@ -13,7 +13,7 @@ extern int NUMD2delete(GENinstance *); extern void NUMD2destroy(GENmodel **); extern int NUMD2getic(GENmodel *, CKTcircuit *); extern int NUMD2load(GENmodel *, CKTcircuit *); -extern int NUMD2mDelete(GENmodel **, IFuid, GENmodel *); +extern int NUMD2mDelete(GENmodel *); extern int NUMD2mParam(int, IFvalue *, GENmodel *); extern int NUMD2param(int, IFvalue *, GENinstance *, IFvalue *); extern int NUMD2pzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/numos/nummmdel.c b/src/spicelib/devices/numos/nummmdel.c index 925d994c0..a04e5be64 100644 --- a/src/spicelib/devices/numos/nummmdel.c +++ b/src/spicelib/devices/numos/nummmdel.c @@ -15,23 +15,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMOSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +NUMOSmDelete(GENmodel *model) { - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - if (model->GENinstances) - return E_NOTEMPTY; - *prev = model->GENnextModel; GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/numos/numosext.h b/src/spicelib/devices/numos/numosext.h index f5a7d50eb..818b4850f 100644 --- a/src/spicelib/devices/numos/numosext.h +++ b/src/spicelib/devices/numos/numosext.h @@ -13,7 +13,7 @@ extern int NUMOSdelete(GENinstance *); extern void NUMOSdestroy(GENmodel **); extern int NUMOSgetic(GENmodel *, CKTcircuit *); extern int NUMOSload(GENmodel *, CKTcircuit *); -extern int NUMOSmDelete(GENmodel **, IFuid, GENmodel *); +extern int NUMOSmDelete(GENmodel *); extern int NUMOSmParam(int, IFvalue *, GENmodel *); extern int NUMOSparam(int, IFvalue *, GENinstance *, IFvalue *); extern int NUMOSpzLoad(GENmodel *, CKTcircuit *, SPcomplex *); diff --git a/src/spicelib/devices/res/resext.h b/src/spicelib/devices/res/resext.h index 8d9b3156a..b54e9e2fb 100644 --- a/src/spicelib/devices/res/resext.h +++ b/src/spicelib/devices/res/resext.h @@ -9,7 +9,7 @@ extern void RESdestroy(GENmodel**); extern int RESload(GENmodel*,CKTcircuit*); extern int RESacload(GENmodel*,CKTcircuit*); extern int RESmodAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int RESmDelete(GENmodel**,IFuid,GENmodel*); +extern int RESmDelete(GENmodel*); extern int RESmParam(int,IFvalue*,GENmodel*); extern int RESparam(int,IFvalue*,GENinstance*,IFvalue*); extern int RESpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/res/resmdel.c b/src/spicelib/devices/res/resmdel.c index 850581315..506b63e60 100644 --- a/src/spicelib/devices/res/resmdel.c +++ b/src/spicelib/devices/res/resmdel.c @@ -10,27 +10,8 @@ Modified: Apr 2000 - Paolo Nenzi int -RESmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +RESmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/soi3/soi3ext.h b/src/spicelib/devices/soi3/soi3ext.h index 6e2b74ee3..0b3998efb 100644 --- a/src/spicelib/devices/soi3/soi3ext.h +++ b/src/spicelib/devices/soi3/soi3ext.h @@ -28,7 +28,7 @@ extern void SOI3destroy(GENmodel**); extern int SOI3getic(GENmodel*,CKTcircuit*); extern int SOI3load(GENmodel*,CKTcircuit*); extern int SOI3mAsk(CKTcircuit *,GENmodel *,int,IFvalue*); -extern int SOI3mDelete(GENmodel**,IFuid,GENmodel*); +extern int SOI3mDelete(GENmodel*); extern int SOI3mParam(int,IFvalue*,GENmodel*); extern void SOI3cap(double,double,double, double*,double*,double*,double*, diff --git a/src/spicelib/devices/soi3/soi3mdel.c b/src/spicelib/devices/soi3/soi3mdel.c index f7daa775e..4b3943de3 100644 --- a/src/spicelib/devices/soi3/soi3mdel.c +++ b/src/spicelib/devices/soi3/soi3mdel.c @@ -27,27 +27,8 @@ Acknowledgements : Rupert Howes and Pete Mole. int -SOI3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) +SOI3mDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/sw/swext.h b/src/spicelib/devices/sw/swext.h index 17a2600cb..6131dea66 100644 --- a/src/spicelib/devices/sw/swext.h +++ b/src/spicelib/devices/sw/swext.h @@ -10,7 +10,7 @@ extern int SWdelete(GENinstance*); extern void SWdestroy(GENmodel**); extern int SWload(GENmodel*,CKTcircuit*); extern int SWmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int SWmDelete(GENmodel**,IFuid,GENmodel*); +extern int SWmDelete(GENmodel*); extern int SWmParam(int,IFvalue*,GENmodel*); extern int SWparam(int,IFvalue*,GENinstance*,IFvalue*); extern int SWpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); diff --git a/src/spicelib/devices/sw/swmdel.c b/src/spicelib/devices/sw/swmdel.c index 312f69645..9e4063bd0 100644 --- a/src/spicelib/devices/sw/swmdel.c +++ b/src/spicelib/devices/sw/swmdel.c @@ -10,27 +10,8 @@ Author: 1985 Gordon Jacobs int -SWmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +SWmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/tra/traext.h b/src/spicelib/devices/tra/traext.h index 9cabd24ad..5ab08e43e 100644 --- a/src/spicelib/devices/tra/traext.h +++ b/src/spicelib/devices/tra/traext.h @@ -10,7 +10,7 @@ extern int TRAdelete(GENinstance*); extern void TRAdestroy(GENmodel**); extern int TRAload(GENmodel*,CKTcircuit*); extern int TRAmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int TRAmDelete(GENmodel**,IFuid,GENmodel*); +extern int TRAmDelete(GENmodel*); extern int TRAparam(int,IFvalue*,GENinstance*,IFvalue*); extern int TRAsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int TRAunsetup(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/tra/tramdel.c b/src/spicelib/devices/tra/tramdel.c index 7a24f2f34..01c4de46c 100644 --- a/src/spicelib/devices/tra/tramdel.c +++ b/src/spicelib/devices/tra/tramdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -TRAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +TRAmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/txl/txlext.h b/src/spicelib/devices/txl/txlext.h index 5226d6200..1d36a298e 100644 --- a/src/spicelib/devices/txl/txlext.h +++ b/src/spicelib/devices/txl/txlext.h @@ -7,7 +7,7 @@ extern int TXLfindBr(CKTcircuit*, GENmodel*, IFuid); extern int TXLload(GENmodel*,CKTcircuit*); extern int TXLmodAsk(CKTcircuit*, GENmodel*, int, IFvalue*); -extern int TXLmDelete(GENmodel**,IFuid,GENmodel*); +extern int TXLmDelete(GENmodel*); extern int TXLmParam(int,IFvalue*,GENmodel*); extern int TXLparam(int,IFvalue*,GENinstance*,IFvalue*); extern int TXLsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/txl/txlmdel.c b/src/spicelib/devices/txl/txlmdel.c index fa109a7d8..006186c6c 100644 --- a/src/spicelib/devices/txl/txlmdel.c +++ b/src/spicelib/devices/txl/txlmdel.c @@ -11,27 +11,8 @@ Author: 1992 Charles Hough int -TXLmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +TXLmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/urc/urcext.h b/src/spicelib/devices/urc/urcext.h index 4fded7c13..e9a243005 100644 --- a/src/spicelib/devices/urc/urcext.h +++ b/src/spicelib/devices/urc/urcext.h @@ -9,7 +9,7 @@ extern int URCask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int URCdelete(GENinstance*); extern void URCdestroy(GENmodel**); extern int URCmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int URCmDelete(GENmodel**,IFuid,GENmodel*); +extern int URCmDelete(GENmodel*); extern int URCmParam(int,IFvalue*,GENmodel*); extern int URCparam(int,IFvalue*,GENinstance*,IFvalue*); extern int URCsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/urc/urcmdel.c b/src/spicelib/devices/urc/urcmdel.c index be75b9942..a36f6e607 100644 --- a/src/spicelib/devices/urc/urcmdel.c +++ b/src/spicelib/devices/urc/urcmdel.c @@ -10,27 +10,8 @@ Author: 1987 Thomas L. Quarles int -URCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +URCmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/vbic/vbicext.h b/src/spicelib/devices/vbic/vbicext.h index 5df6699a0..aa2937494 100644 --- a/src/spicelib/devices/vbic/vbicext.h +++ b/src/spicelib/devices/vbic/vbicext.h @@ -16,7 +16,7 @@ extern void VBICdestroy(GENmodel**); extern int VBICgetic(GENmodel*,CKTcircuit*); extern int VBICload(GENmodel*,CKTcircuit*); extern int VBICmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int VBICmDelete(GENmodel**,IFuid,GENmodel*); +extern int VBICmDelete(GENmodel*); extern int VBICmParam(int,IFvalue*,GENmodel*); extern int VBICparam(int,IFvalue*,GENinstance*,IFvalue*); extern int VBICpzLoad(GENmodel*, CKTcircuit*, SPcomplex*); diff --git a/src/spicelib/devices/vbic/vbicmdel.c b/src/spicelib/devices/vbic/vbicmdel.c index e00527c88..5ef92bf25 100644 --- a/src/spicelib/devices/vbic/vbicmdel.c +++ b/src/spicelib/devices/vbic/vbicmdel.c @@ -18,23 +18,8 @@ Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH int -VBICmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +VBICmDelete(GENmodel *model) { - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - if (model->GENinstances) - return E_NOTEMPTY; - *prev = model->GENnextModel; GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/vccs/vccsext.h b/src/spicelib/devices/vccs/vccsext.h index 166995aba..d59c753b0 100644 --- a/src/spicelib/devices/vccs/vccsext.h +++ b/src/spicelib/devices/vccs/vccsext.h @@ -7,7 +7,7 @@ extern int VCCSask(CKTcircuit*,GENinstance*,int,IFvalue*,IFvalue*); extern int VCCSdelete(GENinstance*); extern void VCCSdestroy(GENmodel**); extern int VCCSload(GENmodel*,CKTcircuit*); -extern int VCCSmDelete(GENmodel**,IFuid,GENmodel*); +extern int VCCSmDelete(GENmodel*); extern int VCCSparam(int,IFvalue*,GENinstance*,IFvalue*); extern int VCCSpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int VCCSsAcLoad(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/vccs/vccsmdel.c b/src/spicelib/devices/vccs/vccsmdel.c index 7592ad685..ed934faba 100644 --- a/src/spicelib/devices/vccs/vccsmdel.c +++ b/src/spicelib/devices/vccs/vccsmdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -VCCSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +VCCSmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/vcvs/vcvsext.h b/src/spicelib/devices/vcvs/vcvsext.h index e9979fda6..6edc7b1fd 100644 --- a/src/spicelib/devices/vcvs/vcvsext.h +++ b/src/spicelib/devices/vcvs/vcvsext.h @@ -8,7 +8,7 @@ extern int VCVSdelete(GENinstance*); extern void VCVSdestroy(GENmodel**); extern int VCVSfindBr(CKTcircuit*,GENmodel*,IFuid); extern int VCVSload(GENmodel*,CKTcircuit*); -extern int VCVSmDelete(GENmodel**,IFuid,GENmodel*); +extern int VCVSmDelete(GENmodel*); extern int VCVSparam(int,IFvalue*,GENinstance*,IFvalue*); extern int VCVSpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int VCVSsAcLoad(GENmodel*,CKTcircuit*); diff --git a/src/spicelib/devices/vcvs/vcvsmdel.c b/src/spicelib/devices/vcvs/vcvsmdel.c index 39e715b24..501f85b45 100644 --- a/src/spicelib/devices/vcvs/vcvsmdel.c +++ b/src/spicelib/devices/vcvs/vcvsmdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -VCVSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +VCVSmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/spicelib/devices/vsrc/vsrcext.h b/src/spicelib/devices/vsrc/vsrcext.h index bce978c6a..eb995fe6b 100644 --- a/src/spicelib/devices/vsrc/vsrcext.h +++ b/src/spicelib/devices/vsrc/vsrcext.h @@ -11,7 +11,7 @@ extern void VSRCdestroy(GENmodel**); extern int VSRCfindBr(CKTcircuit*,GENmodel*,IFuid); extern int VSRCload(GENmodel*,CKTcircuit*); extern int VSRCmAsk(CKTcircuit*,GENmodel*,int,IFvalue*); -extern int VSRCmDelete(GENmodel**,IFuid,GENmodel*); +extern int VSRCmDelete(GENmodel*); extern int VSRCparam(int,IFvalue*,GENinstance*,IFvalue*); extern int VSRCpzLoad(GENmodel*,CKTcircuit*,SPcomplex*); extern int VSRCsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); diff --git a/src/spicelib/devices/vsrc/vsrcmdel.c b/src/spicelib/devices/vsrc/vsrcmdel.c index 7bb35b575..b3deabae2 100644 --- a/src/spicelib/devices/vsrc/vsrcmdel.c +++ b/src/spicelib/devices/vsrc/vsrcmdel.c @@ -10,27 +10,8 @@ Author: 1985 Thomas L. Quarles int -VSRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) +VSRCmDelete(GENmodel *model) { - GENinstance *here; - GENmodel **prev = models; - GENmodel *model = *prev; - - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return E_NOMOD; - - *prev = model->GENnextModel; - for (here = model->GENinstances; here;) { - GENinstance *next_instance = here->GENnextInstance; - GENinstanceFree(here); - here = next_instance; - } GENmodelFree(model); return OK; } diff --git a/src/xspice/icm/dlmain.c b/src/xspice/icm/dlmain.c index 9170f0c1f..5791ebacb 100644 --- a/src/xspice/icm/dlmain.c +++ b/src/xspice/icm/dlmain.c @@ -203,11 +203,9 @@ int MIFdelete( } int MIFmDelete( - GENmodel **inModel, - IFuid modname, GENmodel *model ) { - return (coreitf->dllitf_MIFmDelete)(inModel,modname,model); + return (coreitf->dllitf_MIFmDelete)(model); } void MIFdestroy( diff --git a/src/xspice/mif/mifdestr.c b/src/xspice/mif/mifdestr.c index 73a888493..bf2047b82 100644 --- a/src/xspice/mif/mifdestr.c +++ b/src/xspice/mif/mifdestr.c @@ -64,9 +64,9 @@ void MIFdestroy( /* the head is null */ while(*inModel) { - MIFmDelete(inModel, - (*inModel)->GENmodName, - *inModel); + GENmodel *next_model = (*inModel)->GENnextModel; + MIFmDelete(*inModel); + *inModel = next_model; } } diff --git a/src/xspice/mif/mifmdelete.c b/src/xspice/mif/mifmdelete.c index f227a9066..81fb4b24f 100644 --- a/src/xspice/mif/mifmdelete.c +++ b/src/xspice/mif/mifmdelete.c @@ -60,36 +60,8 @@ model structure. It calls MIFdelete as needed to delete all instances of the specified model. */ -int MIFmDelete( - GENmodel **models, /* The head of the model list */ - IFuid modname, /* The name of the model to delete */ - GENmodel *kill /* The model structure to be deleted */ -) +int MIFmDelete(GENmodel *model) { - GENmodel **prev = models; - GENmodel *model = *prev; - - /* Locate the model by name or pointer and cut it out of the list */ - for (; model; model = model->GENnextModel) { - if (model->GENmodName == modname || (kill && model == kill)) - break; - prev = &(model->GENnextModel); - } - - if (!model) - return(E_NOMOD); - - *prev = model->GENnextModel; - - /* Free the instances under this model if any */ - /* by removing from the head of the linked list */ - /* until the head is null */ - while (model->GENinstances) { - GENinstance *next_inst = model->GENinstances->GENnextInstance; - MIFdelete(model->GENinstances); - model->GENinstances = next_inst; - } - MIFmodel *here = (MIFmodel*) model; int i;