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 324780885..16cbe36f4 100644 --- a/src/spicelib/devices/asrc/asrcmdel.c +++ b/src/spicelib/devices/asrc/asrcmdel.c @@ -10,39 +10,8 @@ Author: 1987 Kanwar Jit Singh int -ASRCmDelete(GENmodel **modList, IFuid modname, GENmodel *killModel) +ASRCmDelete(GENmodel *gen_model) { - ASRCmodel **model = (ASRCmodel **) modList; - ASRCmodel *modfast = (ASRCmodel *) killModel; - ASRCinstance *here; - ASRCinstance *prev = NULL; - ASRCmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->ASRCnextModel)) { - if ((*model)->ASRCmodName == modname || (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - - *oldmod = (*model)->ASRCnextModel; /* cut deleted device out of list */ - - for (here = (*model)->ASRCinstances; here; here = here->ASRCnextInstance) { - if (prev) { - ASRCdelete((GENinstance *) prev); - FREE(prev); - } - prev = here; - } - - if (prev) { - ASRCdelete((GENinstance *) prev); - FREE(prev); - } - FREE(*model); - return(OK); + NG_IGNORE(gen_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 cc5a317b6..6d8bbdb23 100644 --- a/src/spicelib/devices/bjt/bjtmdel.c +++ b/src/spicelib/devices/bjt/bjtmdel.c @@ -16,24 +16,8 @@ Author: 1985 Thomas L. Quarles int -BJTmDelete(GENmodel **inModels, IFuid modname, GENmodel *kill) +BJTmDelete(GENmodel *gen_model) { - BJTmodel **model = (BJTmodel **) inModels; - BJTmodel *modfast = (BJTmodel *) kill; - BJTmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->BJTnextModel)) { - if ((*model)->BJTmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - if ((*model)->BJTinstances) return(E_NOTEMPTY); - *oldmod = (*model)->BJTnextModel; /* cut deleted device out of list */ - FREE(*model); - return(OK); + NG_IGNORE(gen_model); + return OK; } diff --git a/src/spicelib/devices/bsim1/b1mdel.c b/src/spicelib/devices/bsim1/b1mdel.c index 86d6c3d37..3969637a7 100644 --- a/src/spicelib/devices/bsim1/b1mdel.c +++ b/src/spicelib/devices/bsim1/b1mdel.c @@ -10,30 +10,8 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int -B1mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +B1mDelete(GENmodel *gen_model) { - B1model **model = (B1model **) inModel; - B1model *modfast = (B1model *) kill; - B1instance *here; - B1instance *prev = NULL; - B1model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->B1nextModel)) { - if ((*model)->B1modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->B1nextModel; /* cut deleted device out of list */ - for (here = (*model)->B1instances; here; here = here->B1nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 3e67bd692..2cf186a9a 100644 --- a/src/spicelib/devices/bsim2/b2mdel.c +++ b/src/spicelib/devices/bsim2/b2mdel.c @@ -10,30 +10,8 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int -B2mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +B2mDelete(GENmodel *gen_model) { - B2model **model = (B2model **) inModel; - B2model *modfast = (B2model *) kill; - B2instance *here; - B2instance *prev = NULL; - B2model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->B2nextModel)) { - if ((*model)->B2modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->B2nextModel; /* cut deleted device out of list */ - for (here = (*model)->B2instances; here; here = here->B2nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 95a2b518c..91fcaa0ba 100644 --- a/src/spicelib/devices/bsim3/b3mdel.c +++ b/src/spicelib/devices/bsim3/b3mdel.c @@ -15,34 +15,8 @@ int -BSIM3mDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +BSIM3mDelete(GENmodel *gen_model) { - BSIM3model **model = (BSIM3model **) inModel; - BSIM3model *modfast = (BSIM3model *) kill; - BSIM3instance *here; - BSIM3instance *prev = NULL; - BSIM3model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->BSIM3nextModel)) - { if ((*model)->BSIM3modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->BSIM3nextModel; /* cut deleted device out of list */ - for (here = (*model)->BSIM3instances; here; here = here->BSIM3nextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 fdbc0e94c..235262bf6 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c @@ -18,31 +18,8 @@ Modified by Paolo Nenzi 2002 int -B3SOIDDmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +B3SOIDDmDelete(GENmodel *gen_model) { - B3SOIDDmodel **model = (B3SOIDDmodel **) inModel; - B3SOIDDmodel *modfast = (B3SOIDDmodel *) kill; - B3SOIDDinstance *here; - B3SOIDDinstance *prev = NULL; - B3SOIDDmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->B3SOIDDnextModel)) - { if ((*model)->B3SOIDDmodName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->B3SOIDDnextModel; /* cut deleted device out of list */ - for (here = (*model)->B3SOIDDinstances; here; here = here->B3SOIDDnextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 d6007a017..45f82ada1 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c @@ -17,31 +17,8 @@ File: b3soifdmdel.c 98/5/01 int -B3SOIFDmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +B3SOIFDmDelete(GENmodel *gen_model) { - B3SOIFDmodel **model = (B3SOIFDmodel **) inModel; - B3SOIFDmodel *modfast = (B3SOIFDmodel *) kill; - B3SOIFDinstance *here; - B3SOIFDinstance *prev = NULL; - B3SOIFDmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->B3SOIFDnextModel)) - { if ((*model)->B3SOIFDmodName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->B3SOIFDnextModel; /* cut deleted device out of list */ - for (here = (*model)->B3SOIFDinstances; here; here = here->B3SOIFDnextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 a9a5ca3da..01ab0dd62 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c @@ -17,31 +17,8 @@ Modified by Paolo Nenzi 2002 int -B3SOIPDmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +B3SOIPDmDelete(GENmodel *gen_model) { - B3SOIPDmodel **model = (B3SOIPDmodel **) inModel; - B3SOIPDmodel *modfast = (B3SOIPDmodel *) kill; - B3SOIPDinstance *here; - B3SOIPDinstance *prev = NULL; - B3SOIPDmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->B3SOIPDnextModel)) - { if ((*model)->B3SOIPDmodName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->B3SOIPDnextModel; /* cut deleted device out of list */ - for (here = (*model)->B3SOIPDinstances; here; here = here->B3SOIPDnextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_model); + return OK; } diff --git a/src/spicelib/devices/bsim3v0/b3v0mdel.c b/src/spicelib/devices/bsim3v0/b3v0mdel.c index 763ed6371..35830f3f2 100644 --- a/src/spicelib/devices/bsim3v0/b3v0mdel.c +++ b/src/spicelib/devices/bsim3v0/b3v0mdel.c @@ -11,31 +11,8 @@ File: b3v0mdel.c int -BSIM3v0mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +BSIM3v0mDelete(GENmodel *gen_model) { - BSIM3v0model **model = (BSIM3v0model **) inModel; - BSIM3v0model *modfast = (BSIM3v0model *) kill; - BSIM3v0instance *here; - BSIM3v0instance *prev = NULL; - BSIM3v0model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->BSIM3v0nextModel)) - { if ((*model)->BSIM3v0modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->BSIM3v0nextModel; /* cut deleted device out of list */ - for (here = (*model)->BSIM3v0instances; here; here = here->BSIM3v0nextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 b7b6437b5..66cc6205a 100644 --- a/src/spicelib/devices/bsim3v1/b3v1mdel.c +++ b/src/spicelib/devices/bsim3v1/b3v1mdel.c @@ -17,31 +17,8 @@ int -BSIM3v1mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +BSIM3v1mDelete(GENmodel *gen_model) { - BSIM3v1model **model = (BSIM3v1model **) inModel; - BSIM3v1model *modfast = (BSIM3v1model *) kill; - BSIM3v1instance *here; - BSIM3v1instance *prev = NULL; - BSIM3v1model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->BSIM3v1nextModel)) - { if ((*model)->BSIM3v1modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->BSIM3v1nextModel; /* cut deleted device out of list */ - for (here = (*model)->BSIM3v1instances; here; here = here->BSIM3v1nextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 fbd4a094d..3dc07b10d 100644 --- a/src/spicelib/devices/bsim3v32/b3v32mdel.c +++ b/src/spicelib/devices/bsim3v32/b3v32mdel.c @@ -16,31 +16,8 @@ int -BSIM3v32mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +BSIM3v32mDelete(GENmodel *gen_model) { - BSIM3v32model **model = (BSIM3v32model **) inModel; - BSIM3v32model *modfast = (BSIM3v32model *) kill; - BSIM3v32instance *here; - BSIM3v32instance *prev = NULL; - BSIM3v32model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->BSIM3v32nextModel)) - { if ((*model)->BSIM3v32modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->BSIM3v32nextModel; /* cut deleted device out of list */ - for (here = (*model)->BSIM3v32instances; here; here = here->BSIM3v32nextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 b1657a4d1..b936b98e3 100644 --- a/src/spicelib/devices/bsim4/b4mdel.c +++ b/src/spicelib/devices/bsim4/b4mdel.c @@ -65,34 +65,8 @@ int -BSIM4mDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +BSIM4mDelete(GENmodel *gen_model) { - BSIM4model **model = (BSIM4model **) inModel; - BSIM4model *modfast = (BSIM4model *) kill; - BSIM4instance *here; - BSIM4instance *prev = NULL; - BSIM4model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->BSIM4nextModel)) - { if ((*model)->BSIM4modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->BSIM4nextModel; /* cut deleted device out of list */ - for (here = (*model)->BSIM4instances; here; here = here->BSIM4nextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 bc0be65a9..9b62f55fa 100644 --- a/src/spicelib/devices/bsim4v5/b4v5mdel.c +++ b/src/spicelib/devices/bsim4v5/b4v5mdel.c @@ -15,34 +15,8 @@ int -BSIM4v5mDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +BSIM4v5mDelete(GENmodel *gen_model) { - BSIM4v5model **model = (BSIM4v5model **) inModel; - BSIM4v5model *modfast = (BSIM4v5model *) kill; - BSIM4v5instance *here; - BSIM4v5instance *prev = NULL; - BSIM4v5model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->BSIM4v5nextModel)) - { if ((*model)->BSIM4v5modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->BSIM4v5nextModel; /* cut deleted device out of list */ - for (here = (*model)->BSIM4v5instances; here; here = here->BSIM4v5nextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 d4f98751d..8d03a77c2 100644 --- a/src/spicelib/devices/bsim4v6/b4v6mdel.c +++ b/src/spicelib/devices/bsim4v6/b4v6mdel.c @@ -17,34 +17,8 @@ int -BSIM4v6mDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +BSIM4v6mDelete(GENmodel *gen_model) { - BSIM4v6model **model = (BSIM4v6model **) inModel; - BSIM4v6model *modfast = (BSIM4v6model *) kill; - BSIM4v6instance *here; - BSIM4v6instance *prev = NULL; - BSIM4v6model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->BSIM4v6nextModel)) - { if ((*model)->BSIM4v6modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->BSIM4v6nextModel; /* cut deleted device out of list */ - for (here = (*model)->BSIM4v6instances; here; here = here->BSIM4v6nextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 5401b640b..2cb348d98 100644 --- a/src/spicelib/devices/bsim4v7/b4v7mdel.c +++ b/src/spicelib/devices/bsim4v7/b4v7mdel.c @@ -17,34 +17,8 @@ int -BSIM4v7mDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +BSIM4v7mDelete(GENmodel *gen_model) { - BSIM4v7model **model = (BSIM4v7model **) inModel; - BSIM4v7model *modfast = (BSIM4v7model *) kill; - BSIM4v7instance *here; - BSIM4v7instance *prev = NULL; - BSIM4v7model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->BSIM4v7nextModel)) - { if ((*model)->BSIM4v7modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->BSIM4v7nextModel; /* cut deleted device out of list */ - for (here = (*model)->BSIM4v7instances; here; here = here->BSIM4v7nextInstance) - { if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 efd6eeac5..853573358 100644 --- a/src/spicelib/devices/bsimsoi/b4soimdel.c +++ b/src/spicelib/devices/bsimsoi/b4soimdel.c @@ -21,35 +21,8 @@ int -B4SOImDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +B4SOImDelete(GENmodel *gen_model) { - B4SOImodel **model = (B4SOImodel **) inModel; - B4SOImodel *modfast = (B4SOImodel *) kill; - B4SOIinstance *here; - B4SOIinstance *prev = NULL; - B4SOImodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->B4SOInextModel)) - { if ((*model)->B4SOImodName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->B4SOInextModel; /* cut deleted device out of list */ - for (here = (*model)->B4SOIinstances; here; here = here->B4SOInextInstance) - { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 d35ec7c48..90f916d0c 100644 --- a/src/spicelib/devices/cap/capmdel.c +++ b/src/spicelib/devices/cap/capmdel.c @@ -11,30 +11,8 @@ Modified: Spetember 2003 Paolo Nenzi int -CAPmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +CAPmDelete(GENmodel *gen_model) { - CAPmodel *modfast = (CAPmodel *) kill; - CAPmodel **model = (CAPmodel **) inModel; - CAPinstance *here; - CAPinstance *prev = NULL; - CAPmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->CAPnextModel)) { - if ((*model)->CAPmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->CAPnextModel; /* cut deleted device out of list */ - for (here = (*model)->CAPinstances; here; here = here->CAPnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 3c2a09738..a4b2e2c1d 100644 --- a/src/spicelib/devices/cccs/cccsmdel.c +++ b/src/spicelib/devices/cccs/cccsmdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -CCCSmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +CCCSmDelete(GENmodel *gen_model) { - CCCSmodel **model = (CCCSmodel **) inModel; - CCCSmodel *modfast = (CCCSmodel *) kill; - CCCSinstance *here; - CCCSinstance *prev = NULL; - CCCSmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->CCCSnextModel)) { - if ((*model)->CCCSmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->CCCSnextModel; /* cut deleted device out of list */ - for (here = (*model)->CCCSinstances; here; here = here->CCCSnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 dc765c907..a829e5198 100644 --- a/src/spicelib/devices/ccvs/ccvsmdel.c +++ b/src/spicelib/devices/ccvs/ccvsmdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -CCVSmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +CCVSmDelete(GENmodel *gen_model) { - CCVSmodel **model = (CCVSmodel **) inModel; - CCVSmodel *modfast = (CCVSmodel *) kill; - CCVSinstance *here; - CCVSinstance *prev = NULL; - CCVSmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->CCVSnextModel)) { - if ((*model)->CCVSmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->CCVSnextModel; /* cut deleted device out of list */ - for (here = (*model)->CCVSinstances; here; here = here->CCVSnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 0461eb3ab..d1e1cfa1f 100644 --- a/src/spicelib/devices/cpl/cplmdel.c +++ b/src/spicelib/devices/cpl/cplmdel.c @@ -12,30 +12,8 @@ Author: 1992 Charles Hough int -CPLmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +CPLmDelete(GENmodel *gen_model) { - CPLmodel **model = (CPLmodel **) inModel; - CPLmodel *modfast = (CPLmodel *) kill; - CPLinstance *here; - CPLinstance *prev = NULL; - CPLmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->CPLnextModel)) { - if ((*model)->CPLmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->CPLnextModel; /* cut deleted device out of list */ - for (here = (*model)->CPLinstances; here; here = here->CPLnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 150bb2430..729fd8407 100644 --- a/src/spicelib/devices/csw/cswmdel.c +++ b/src/spicelib/devices/csw/cswmdel.c @@ -10,30 +10,8 @@ Author: 1985 Gordon Jacobs int -CSWmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +CSWmDelete(GENmodel *gen_model) { - CSWmodel **model = (CSWmodel **) inModel; - CSWmodel *modfast = (CSWmodel *) kill; - CSWinstance *here; - CSWinstance *prev = NULL; - CSWmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->CSWnextModel)) { - if ((*model)->CSWmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->CSWnextModel; /* cut deleted device out of list */ - for (here = (*model)->CSWinstances; here; here = here->CSWnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 0a52cc5eb..f4d845701 100644 --- a/src/spicelib/devices/dio/diomdel.c +++ b/src/spicelib/devices/dio/diomdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -DIOmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +DIOmDelete(GENmodel *gen_model) { - DIOmodel **model = (DIOmodel **) inModel; - DIOmodel *modfast = (DIOmodel *) kill; - DIOinstance *here; - DIOinstance *prev = NULL; - DIOmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->DIOnextModel)) { - if ((*model)->DIOmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->DIOnextModel; /* cut deleted device out of list */ - for (here = (*model)->DIOinstances; here; here = here->DIOnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 c478485a9..130566802 100644 --- a/src/spicelib/devices/hfet1/hfetmdel.c +++ b/src/spicelib/devices/hfet1/hfetmdel.c @@ -14,30 +14,8 @@ Author: 1985 S. Hwang int -HFETAmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +HFETAmDelete(GENmodel *gen_model) { - HFETAmodel **model = (HFETAmodel **) inModel; - HFETAmodel *modfast = (HFETAmodel *) kill; - HFETAinstance *here; - HFETAinstance *prev = NULL; - HFETAmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->HFETAnextModel)) { - if ((*model)->HFETAmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->HFETAnextModel; /* cut deleted device out of list */ - for (here = (*model)->HFETAinstances; here; here = here->HFETAnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 01d253089..904b5d9eb 100644 --- a/src/spicelib/devices/hfet2/hfet2mdel.c +++ b/src/spicelib/devices/hfet2/hfet2mdel.c @@ -14,30 +14,8 @@ Author: 1985 S. Hwang int -HFET2mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +HFET2mDelete(GENmodel *gen_model) { - HFET2model **model = (HFET2model **) inModel; - HFET2model *modfast = (HFET2model *) kill; - HFET2instance *here; - HFET2instance *prev = NULL; - HFET2model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->HFET2nextModel)) { - if ((*model)->HFET2modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->HFET2nextModel; /* cut deleted device out of list */ - for (here = (*model)->HFET2instances; here; here = here->HFET2nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 5d015e1b4..02f7352de 100644 --- a/src/spicelib/devices/hisim2/hsm2mdel.c +++ b/src/spicelib/devices/hisim2/hsm2mdel.c @@ -61,34 +61,8 @@ to others." int -HSM2mDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +HSM2mDelete(GENmodel *gen_model) { - HSM2model **model = (HSM2model **) inModel; - HSM2model *modfast = (HSM2model *) kill; - HSM2instance *here; - HSM2instance *prev = NULL; - HSM2model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->HSM2nextModel)) { - if ((*model)->HSM2modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->HSM2nextModel; /* cut deleted device out of list */ - for (here = (*model)->HSM2instances; - here; here = here->HSM2nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 423494e6c..0e8eee4cb 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvmdel.c +++ b/src/spicelib/devices/hisimhv1/hsmhvmdel.c @@ -22,34 +22,8 @@ int -HSMHVmDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +HSMHVmDelete(GENmodel *gen_model) { - HSMHVmodel **model = (HSMHVmodel **) inModel; - HSMHVmodel *modfast = (HSMHVmodel *) kill; - HSMHVinstance *here; - HSMHVinstance *prev = NULL; - HSMHVmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->HSMHVnextModel)) { - if ((*model)->HSMHVmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->HSMHVnextModel; /* cut deleted device out of list */ - for (here = (*model)->HSMHVinstances; - here; here = here->HSMHVnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 4e879ce5f..940f6e010 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c @@ -64,34 +64,8 @@ June 2008 (revised October 2011) int -HSMHV2mDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +HSMHV2mDelete(GENmodel *gen_model) { - HSMHV2model **model = (HSMHV2model **) inModel; - HSMHV2model *modfast = (HSMHV2model *) kill; - HSMHV2instance *here; - HSMHV2instance *prev = NULL; - HSMHV2model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->HSMHV2nextModel)) { - if ((*model)->HSMHV2modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->HSMHV2nextModel; /* cut deleted device out of list */ - for (here = (*model)->HSMHV2instances; - here; here = here->HSMHV2nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 806545c5f..5fa94a360 100644 --- a/src/spicelib/devices/ind/indmdel.c +++ b/src/spicelib/devices/ind/indmdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -INDmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +INDmDelete(GENmodel *gen_model) { - INDmodel **model = (INDmodel **) inModel; - INDmodel *modfast = (INDmodel *) kill; - INDinstance *here; - INDinstance *prev = NULL; - INDmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->INDnextModel)) { - if ((*model)->INDmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->INDnextModel; /* cut deleted device out of list */ - for (here = (*model)->INDinstances; here; here = here->INDnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_model); + return OK; } diff --git a/src/spicelib/devices/ind/mutmdel.c b/src/spicelib/devices/ind/mutmdel.c index 64084e1ca..638e00f97 100644 --- a/src/spicelib/devices/ind/mutmdel.c +++ b/src/spicelib/devices/ind/mutmdel.c @@ -11,31 +11,9 @@ Author: 1985 Thomas L. Quarles #ifdef MUTUAL int -MUTmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +MUTmDelete(GENmodel *gen_model) { - MUTmodel **model = (MUTmodel **) inModel; - MUTmodel *modfast = (MUTmodel *) kill; - MUTinstance *here; - MUTinstance *prev = NULL; - MUTmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->MUTnextModel)) { - if ((*model)->MUTmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->MUTnextModel; /* cut deleted device out of list */ - for (here = (*model)->MUTinstances; here; here = here->MUTnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_model); + return OK; } #endif /* MUTUAL */ 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 113aebd68..5184d7781 100644 --- a/src/spicelib/devices/isrc/isrcmdel.c +++ b/src/spicelib/devices/isrc/isrcmdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -ISRCmDelete(GENmodel **inModel, IFuid modname, GENmodel *fast) +ISRCmDelete(GENmodel *gen_model) { - ISRCmodel **model = (ISRCmodel **) inModel; - ISRCmodel *modfast = (ISRCmodel *) fast; - ISRCinstance *here; - ISRCinstance *prev = NULL; - ISRCmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->ISRCnextModel)) { - if ((*model)->ISRCmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->ISRCnextModel; /* cut deleted device out of list */ - for (here = (*model)->ISRCinstances; here; here = here->ISRCnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 6091a268f..f65a36079 100644 --- a/src/spicelib/devices/jfet/jfetmdel.c +++ b/src/spicelib/devices/jfet/jfetmdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -JFETmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +JFETmDelete(GENmodel *gen_model) { - JFETmodel **model = (JFETmodel **) inModel; - JFETmodel *modfast = (JFETmodel *) kill; - JFETinstance *here; - JFETinstance *prev = NULL; - JFETmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->JFETnextModel)) { - if ((*model)->JFETmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->JFETnextModel; /* cut deleted device out of list */ - for (here = (*model)->JFETinstances; here; here = here->JFETnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 5446e786a..1a6731c9c 100644 --- a/src/spicelib/devices/jfet2/jfet2mdel.c +++ b/src/spicelib/devices/jfet2/jfet2mdel.c @@ -14,30 +14,8 @@ Modified to jfet2 for PS model definition ( Anthony E. Parker ) int -JFET2mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +JFET2mDelete(GENmodel *gen_model) { - JFET2model **model = (JFET2model **) inModel; - JFET2model *modfast = (JFET2model *) kill; - JFET2instance *here; - JFET2instance *prev = NULL; - JFET2model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->JFET2nextModel)) { - if ((*model)->JFET2modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->JFET2nextModel; /* cut deleted device out of list */ - for (here = (*model)->JFET2instances; here; here = here->JFET2nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 c7a260101..279b52a63 100644 --- a/src/spicelib/devices/ltra/ltramdel.c +++ b/src/spicelib/devices/ltra/ltramdel.c @@ -10,33 +10,8 @@ Author: 1990 Jaijeet S. Roychowdhury int -LTRAmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +LTRAmDelete(GENmodel *gen_model) { - LTRAmodel **model = (LTRAmodel **) inModel; - LTRAmodel *modfast = (LTRAmodel *) kill; - LTRAinstance *here; - LTRAinstance *prev = NULL; - LTRAmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->LTRAnextModel)) { - if ((*model)->LTRAmodName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->LTRAnextModel; /* cut deleted device out of list */ - for (here = (*model)->LTRAinstances; here; here = here->LTRAnextInstance) { - if (prev) - FREE(prev); - prev = here; - } - if (prev) - FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 b369dafd7..43d32cfea 100644 --- a/src/spicelib/devices/mes/mesmdel.c +++ b/src/spicelib/devices/mes/mesmdel.c @@ -10,30 +10,8 @@ Author: 1985 S. Hwang int -MESmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +MESmDelete(GENmodel *gen_model) { - MESmodel **model = (MESmodel **) inModel; - MESmodel *modfast = (MESmodel *) kill; - MESinstance *here; - MESinstance *prev = NULL; - MESmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->MESnextModel)) { - if ((*model)->MESmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->MESnextModel; /* cut deleted device out of list */ - for (here = (*model)->MESinstances; here; here = here->MESnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 5c84309f6..1084778f5 100644 --- a/src/spicelib/devices/mesa/mesamdel.c +++ b/src/spicelib/devices/mesa/mesamdel.c @@ -14,30 +14,8 @@ Author: 1985 S. Hwang int -MESAmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +MESAmDelete(GENmodel *gen_model) { - MESAmodel **model = (MESAmodel **) inModel; - MESAmodel *modfast = (MESAmodel *) kill; - MESAinstance *here; - MESAinstance *prev = NULL; - MESAmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->MESAnextModel)) { - if ((*model)->MESAmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->MESAnextModel; /* cut deleted device out of list */ - for (here = (*model)->MESAinstances; here; here = here->MESAnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 3d3157763..5e95311cc 100644 --- a/src/spicelib/devices/mos1/mos1mdel.c +++ b/src/spicelib/devices/mos1/mos1mdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -MOS1mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +MOS1mDelete(GENmodel *gen_model) { - MOS1model **model = (MOS1model **) inModel; - MOS1model *modfast = (MOS1model *) kill; - MOS1instance *here; - MOS1instance *prev = NULL; - MOS1model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->MOS1nextModel)) { - if ((*model)->MOS1modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->MOS1nextModel; /* cut deleted device out of list */ - for (here = (*model)->MOS1instances; here; here = here->MOS1nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 fc64d0d9c..b47d5d254 100644 --- a/src/spicelib/devices/mos2/mos2mdel.c +++ b/src/spicelib/devices/mos2/mos2mdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -MOS2mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +MOS2mDelete(GENmodel *gen_model) { - MOS2model **model = (MOS2model **) inModel; - MOS2model *modfast = (MOS2model *) kill; - MOS2instance *here; - MOS2instance *prev = NULL; - MOS2model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->MOS2nextModel)) { - if ((*model)->MOS2modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->MOS2nextModel; /* cut deleted device out of list */ - for (here = (*model)->MOS2instances; here; here = here->MOS2nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 d61ef685d..ed2d06e40 100644 --- a/src/spicelib/devices/mos3/mos3mdel.c +++ b/src/spicelib/devices/mos3/mos3mdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -MOS3mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +MOS3mDelete(GENmodel *gen_model) { - MOS3model **model = (MOS3model **) inModel; - MOS3model *modfast = (MOS3model *) kill; - MOS3instance *here; - MOS3instance *prev = NULL; - MOS3model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->MOS3nextModel)) { - if ((*model)->MOS3modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->MOS3nextModel; /* cut deleted device out of list */ - for (here = (*model)->MOS3instances; here; here = here->MOS3nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 45a2d6710..cd148fbc4 100644 --- a/src/spicelib/devices/mos6/mos6mdel.c +++ b/src/spicelib/devices/mos6/mos6mdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -MOS6mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +MOS6mDelete(GENmodel *gen_model) { - MOS6model **model = (MOS6model **) inModel; - MOS6model *modfast = (MOS6model *) kill; - MOS6instance *here; - MOS6instance *prev = NULL; - MOS6model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->MOS6nextModel)) { - if ((*model)->MOS6modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->MOS6nextModel; /* cut deleted device out of list */ - for (here = (*model)->MOS6instances; here; here = here->MOS6nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 7f4462468..d9c9a21e6 100644 --- a/src/spicelib/devices/mos9/mos9mdel.c +++ b/src/spicelib/devices/mos9/mos9mdel.c @@ -11,30 +11,8 @@ Modified: Alan Gillespie int -MOS9mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +MOS9mDelete(GENmodel *gen_model) { - MOS9model **model = (MOS9model **) inModel; - MOS9model *modfast = (MOS9model *) kill; - MOS9instance *here; - MOS9instance *prev = NULL; - MOS9model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->MOS9nextModel)) { - if ((*model)->MOS9modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->MOS9nextModel; /* cut deleted device out of list */ - for (here = (*model)->MOS9instances; here; here = here->MOS9nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 7b9cfec78..9f1ac2307 100644 --- a/src/spicelib/devices/nbjt/nbjtmdel.c +++ b/src/spicelib/devices/nbjt/nbjtmdel.c @@ -15,26 +15,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NBJTmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +NBJTmDelete(GENmodel *gen_model) { - NBJTmodel **model = (NBJTmodel **) inModel; - NBJTmodel *modfast = (NBJTmodel *) kill; - NBJTmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->NBJTnextModel)) { - if ((*model)->NBJTmodName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - if ((*model)->NBJTinstances) - return(E_NOTEMPTY); - *oldmod = (*model)->NBJTnextModel; /* cut deleted device out of list */ - FREE(*model); - return(OK); + NG_IGNORE(gen_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 663065ea0..f156c86b9 100644 --- a/src/spicelib/devices/nbjt2/nbt2mdel.c +++ b/src/spicelib/devices/nbjt2/nbt2mdel.c @@ -15,26 +15,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NBJT2mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +NBJT2mDelete(GENmodel *gen_model) { - NBJT2model **model = (NBJT2model **) inModel; - NBJT2model *modfast = (NBJT2model *) kill; - NBJT2model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->NBJT2nextModel)) { - if ((*model)->NBJT2modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - if ((*model)->NBJT2instances) - return(E_NOTEMPTY); - *oldmod = (*model)->NBJT2nextModel; /* cut deleted device out of list */ - FREE(*model); - return(OK); + NG_IGNORE(gen_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 4263163bb..62fe1aefe 100644 --- a/src/spicelib/devices/ndev/ndevmdel.c +++ b/src/spicelib/devices/ndev/ndevmdel.c @@ -10,14 +10,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NDEVmDelete( - GENmodel **inModel, - IFuid modname, - GENmodel *kill) +NDEVmDelete(GENmodel *gen_model) { - NG_IGNORE(inModel); - NG_IGNORE(modname); - NG_IGNORE(kill); - - return(OK); + NG_IGNORE(gen_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 80743bd14..4fbafca96 100644 --- a/src/spicelib/devices/numd/numdmdel.c +++ b/src/spicelib/devices/numd/numdmdel.c @@ -10,33 +10,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMDmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +NUMDmDelete(GENmodel *gen_model) { - NUMDmodel **model = (NUMDmodel **) inModel; - NUMDmodel *modfast = (NUMDmodel *) kill; - NUMDinstance *inst; - NUMDinstance *prev = NULL; - NUMDmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->NUMDnextModel)) { - if ((*model)->NUMDmodName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->NUMDnextModel; /* cut deleted device out of list */ - for (inst = (*model)->NUMDinstances; inst; inst = inst->NUMDnextInstance) { - if (prev) - FREE(prev); - prev = inst; - } - if (prev) - FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_model); + return OK; } diff --git a/src/spicelib/devices/numd2/nud2mdel.c b/src/spicelib/devices/numd2/nud2mdel.c index b32514046..52cb8e85c 100644 --- a/src/spicelib/devices/numd2/nud2mdel.c +++ b/src/spicelib/devices/numd2/nud2mdel.c @@ -10,33 +10,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMD2mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +NUMD2mDelete(GENmodel *gen_model) { - NUMD2model **model = (NUMD2model **) inModel; - NUMD2model *modfast = (NUMD2model *) kill; - NUMD2instance *inst; - NUMD2instance *prev = NULL; - NUMD2model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->NUMD2nextModel)) { - if ((*model)->NUMD2modName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->NUMD2nextModel; /* cut deleted device out of list */ - for (inst = (*model)->NUMD2instances; inst; inst = inst->NUMD2nextInstance) { - if (prev) - FREE(prev); - prev = inst; - } - if (prev) - FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 c191a21a4..c05613144 100644 --- a/src/spicelib/devices/numos/nummmdel.c +++ b/src/spicelib/devices/numos/nummmdel.c @@ -15,26 +15,8 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMOSmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +NUMOSmDelete(GENmodel *gen_model) { - NUMOSmodel **model = (NUMOSmodel **) inModel; - NUMOSmodel *modfast = (NUMOSmodel *) kill; - NUMOSmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->NUMOSnextModel)) { - if ((*model)->NUMOSmodName == modname || - (modfast && *model == modfast)) - goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - if ((*model)->NUMOSinstances) - return(E_NOTEMPTY); - *oldmod = (*model)->NUMOSnextModel; /* cut deleted device out of list */ - FREE(*model); - return(OK); + NG_IGNORE(gen_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 8dfdb4d59..b7dc54ec2 100644 --- a/src/spicelib/devices/res/resmdel.c +++ b/src/spicelib/devices/res/resmdel.c @@ -10,30 +10,8 @@ Modified: Apr 2000 - Paolo Nenzi int -RESmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +RESmDelete(GENmodel *gen_model) { - RESmodel **model = (RESmodel **) inModel; - RESmodel *modfast = (RESmodel *) kill; - RESinstance *here; - RESinstance *prev = NULL; - RESmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->RESnextModel)) { - if ((*model)->RESmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->RESnextModel; /* cut deleted device out of list */ - for (here = (*model)->RESinstances; here; here = here->RESnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 abf28f0ce..85a47750a 100644 --- a/src/spicelib/devices/soi3/soi3mdel.c +++ b/src/spicelib/devices/soi3/soi3mdel.c @@ -27,30 +27,8 @@ Acknowledgements : Rupert Howes and Pete Mole. int -SOI3mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +SOI3mDelete(GENmodel *gen_model) { - SOI3model **model = (SOI3model **) inModel; - SOI3model *modfast = (SOI3model *) kill; - SOI3instance *here; - SOI3instance *prev = NULL; - SOI3model **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->SOI3nextModel)) { - if ((*model)->SOI3modName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->SOI3nextModel; /* cut deleted device out of list */ - for (here = (*model)->SOI3instances; here; here = here->SOI3nextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 27884f09e..c7e6ac5cc 100644 --- a/src/spicelib/devices/sw/swmdel.c +++ b/src/spicelib/devices/sw/swmdel.c @@ -10,30 +10,8 @@ Author: 1985 Gordon Jacobs int -SWmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +SWmDelete(GENmodel *gen_model) { - SWmodel **model = (SWmodel **) inModel; - SWmodel *modfast = (SWmodel *) kill; - SWinstance *here; - SWinstance *prev = NULL; - SWmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->SWnextModel)) { - if ((*model)->SWmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->SWnextModel; /* cut deleted device out of list */ - for (here = (*model)->SWinstances; here; here = here->SWnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 6040e769f..39b3d5a1e 100644 --- a/src/spicelib/devices/tra/tramdel.c +++ b/src/spicelib/devices/tra/tramdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -TRAmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +TRAmDelete(GENmodel *gen_model) { - TRAmodel **model = (TRAmodel **) inModel; - TRAmodel *modfast = (TRAmodel *) kill; - TRAinstance *here; - TRAinstance *prev = NULL; - TRAmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->TRAnextModel)) { - if ((*model)->TRAmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->TRAnextModel; /* cut deleted device out of list */ - for (here = (*model)->TRAinstances; here; here = here->TRAnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 649ae2f93..a50ae0c5b 100644 --- a/src/spicelib/devices/txl/txlmdel.c +++ b/src/spicelib/devices/txl/txlmdel.c @@ -11,30 +11,8 @@ Author: 1992 Charles Hough int -TXLmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +TXLmDelete(GENmodel *gen_model) { - TXLmodel **model = (TXLmodel **) inModel; - TXLmodel *modfast = (TXLmodel *) kill; - TXLinstance *here; - TXLinstance *prev = NULL; - TXLmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->TXLnextModel)) { - if ((*model)->TXLmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->TXLnextModel; /* cut deleted device out of list */ - for (here = (*model)->TXLinstances; here; here = here->TXLnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 ab8644d5e..e2cab752d 100644 --- a/src/spicelib/devices/urc/urcmdel.c +++ b/src/spicelib/devices/urc/urcmdel.c @@ -10,30 +10,8 @@ Author: 1987 Thomas L. Quarles int -URCmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +URCmDelete(GENmodel *gen_model) { - URCmodel **model = (URCmodel **) inModel; - URCmodel *modfast = (URCmodel *) kill; - URCinstance *here; - URCinstance *prev = NULL; - URCmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->URCnextModel)) { - if ((*model)->URCmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->URCnextModel; /* cut deleted device out of list */ - for (here = (*model)->URCinstances; here; here = here->URCnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 53c186911..06fe82064 100644 --- a/src/spicelib/devices/vbic/vbicmdel.c +++ b/src/spicelib/devices/vbic/vbicmdel.c @@ -18,24 +18,8 @@ Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH int -VBICmDelete(GENmodel **inModels, IFuid modname, GENmodel *kill) +VBICmDelete(GENmodel *gen_model) { - VBICmodel **model = (VBICmodel **) inModels; - VBICmodel *modfast = (VBICmodel *) kill; - VBICmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->VBICnextModel)) { - if ((*model)->VBICmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - if ((*model)->VBICinstances) return(E_NOTEMPTY); - *oldmod = (*model)->VBICnextModel; /* cut deleted device out of list */ - FREE(*model); - return(OK); + NG_IGNORE(gen_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 251da5213..405f3d64c 100644 --- a/src/spicelib/devices/vccs/vccsmdel.c +++ b/src/spicelib/devices/vccs/vccsmdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -VCCSmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +VCCSmDelete(GENmodel *gen_model) { - VCCSmodel **model = (VCCSmodel **) inModel; - VCCSmodel *modfast = (VCCSmodel *) kill; - VCCSinstance *here; - VCCSinstance *prev = NULL; - VCCSmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->VCCSnextModel)) { - if ((*model)->VCCSmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->VCCSnextModel; /* cut deleted device out of list */ - for (here = (*model)->VCCSinstances; here; here = here->VCCSnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 deb94b183..2609821bf 100644 --- a/src/spicelib/devices/vcvs/vcvsmdel.c +++ b/src/spicelib/devices/vcvs/vcvsmdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -VCVSmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +VCVSmDelete(GENmodel *gen_model) { - VCVSmodel **model = (VCVSmodel **) inModel; - VCVSmodel *modfast = (VCVSmodel *) kill; - VCVSinstance *here; - VCVSinstance *prev = NULL; - VCVSmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->VCVSnextModel)) { - if ((*model)->VCVSmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->VCVSnextModel; /* cut deleted device out of list */ - for (here = (*model)->VCVSinstances; here; here = here->VCVSnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_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 981a9e987..9971b2f79 100644 --- a/src/spicelib/devices/vsrc/vsrcmdel.c +++ b/src/spicelib/devices/vsrc/vsrcmdel.c @@ -10,30 +10,8 @@ Author: 1985 Thomas L. Quarles int -VSRCmDelete(GENmodel **inModel, IFuid modname, GENmodel *fast) +VSRCmDelete(GENmodel *gen_model) { - VSRCmodel **model = (VSRCmodel **) inModel; - VSRCmodel *modfast = (VSRCmodel *) fast; - VSRCinstance *here; - VSRCinstance *prev = NULL; - VSRCmodel **oldmod; - - oldmod = model; - for (; *model; model = &((*model)->VSRCnextModel)) { - if ((*model)->VSRCmodName == modname || - (modfast && *model == modfast)) goto delgot; - oldmod = model; - } - - return(E_NOMOD); - - delgot: - *oldmod = (*model)->VSRCnextModel; /* cut deleted device out of list */ - for (here = (*model)->VSRCinstances; here; here = here->VSRCnextInstance) { - if (prev) FREE(prev); - prev = here; - } - if (prev) FREE(prev); - FREE(*model); - return(OK); + NG_IGNORE(gen_model); + return OK; }