diff --git a/src/spicelib/devices/asrc/asrcmdel.c b/src/spicelib/devices/asrc/asrcmdel.c index 2fe0bc25e..83c7d5752 100644 --- a/src/spicelib/devices/asrc/asrcmdel.c +++ b/src/spicelib/devices/asrc/asrcmdel.c @@ -10,31 +10,31 @@ Author: 1987 Kanwar Jit Singh int -ASRCmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +ASRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ + *prev = model->GENnextModel; - for (here = (*model)->GENinstances; here;) { + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(((ASRCinstance*)here)->ASRCacValues); FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bjt/bjtmdel.c b/src/spicelib/devices/bjt/bjtmdel.c index 58e5b1f84..66db748e5 100644 --- a/src/spicelib/devices/bjt/bjtmdel.c +++ b/src/spicelib/devices/bjt/bjtmdel.c @@ -16,23 +16,23 @@ Author: 1985 Thomas L. Quarles int -BJTmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +BJTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - if ((*model)->GENinstances) + if (model->GENinstances) return E_NOTEMPTY; - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - FREE(*model); + *prev = model->GENnextModel; + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim1/b1mdel.c b/src/spicelib/devices/bsim1/b1mdel.c index 6e2d3251b..7643c1511 100644 --- a/src/spicelib/devices/bsim1/b1mdel.c +++ b/src/spicelib/devices/bsim1/b1mdel.c @@ -10,27 +10,27 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int -B1mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +B1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim2/b2mdel.c b/src/spicelib/devices/bsim2/b2mdel.c index 7e1ca5c6f..16b583859 100644 --- a/src/spicelib/devices/bsim2/b2mdel.c +++ b/src/spicelib/devices/bsim2/b2mdel.c @@ -10,27 +10,27 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int -B2mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +B2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim3/b3mdel.c b/src/spicelib/devices/bsim3/b3mdel.c index d3a80dfb0..435da678a 100644 --- a/src/spicelib/devices/bsim3/b3mdel.c +++ b/src/spicelib/devices/bsim3/b3mdel.c @@ -15,27 +15,27 @@ int -BSIM3mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +BSIM3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c index f7ae9cf41..eb34eb570 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c @@ -18,27 +18,27 @@ Modified by Paolo Nenzi 2002 int -B3SOIDDmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +B3SOIDDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c index b64291182..7de9e748b 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c @@ -17,27 +17,27 @@ File: b3soifdmdel.c 98/5/01 int -B3SOIFDmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +B3SOIFDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c index 850dcb3a6..fca9d1ced 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c @@ -17,27 +17,27 @@ Modified by Paolo Nenzi 2002 int -B3SOIPDmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +B3SOIPDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim3v0/b3v0mdel.c b/src/spicelib/devices/bsim3v0/b3v0mdel.c index aafe30f4b..530329c0b 100644 --- a/src/spicelib/devices/bsim3v0/b3v0mdel.c +++ b/src/spicelib/devices/bsim3v0/b3v0mdel.c @@ -11,27 +11,27 @@ File: b3v0mdel.c int -BSIM3v0mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +BSIM3v0mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim3v1/b3v1mdel.c b/src/spicelib/devices/bsim3v1/b3v1mdel.c index f0dd5e06c..43f20b7a0 100644 --- a/src/spicelib/devices/bsim3v1/b3v1mdel.c +++ b/src/spicelib/devices/bsim3v1/b3v1mdel.c @@ -17,27 +17,27 @@ int -BSIM3v1mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +BSIM3v1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim3v32/b3v32mdel.c b/src/spicelib/devices/bsim3v32/b3v32mdel.c index f98592b08..6c6a8708c 100644 --- a/src/spicelib/devices/bsim3v32/b3v32mdel.c +++ b/src/spicelib/devices/bsim3v32/b3v32mdel.c @@ -16,27 +16,27 @@ int -BSIM3v32mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +BSIM3v32mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim4/b4mdel.c b/src/spicelib/devices/bsim4/b4mdel.c index 48183a3a7..0af48fc90 100644 --- a/src/spicelib/devices/bsim4/b4mdel.c +++ b/src/spicelib/devices/bsim4/b4mdel.c @@ -65,27 +65,27 @@ int -BSIM4mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +BSIM4mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim4v5/b4v5mdel.c b/src/spicelib/devices/bsim4v5/b4v5mdel.c index 5decf880c..2b94591e2 100644 --- a/src/spicelib/devices/bsim4v5/b4v5mdel.c +++ b/src/spicelib/devices/bsim4v5/b4v5mdel.c @@ -15,27 +15,27 @@ int -BSIM4v5mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +BSIM4v5mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim4v6/b4v6mdel.c b/src/spicelib/devices/bsim4v6/b4v6mdel.c index 6f5f96ab9..bcf860b96 100644 --- a/src/spicelib/devices/bsim4v6/b4v6mdel.c +++ b/src/spicelib/devices/bsim4v6/b4v6mdel.c @@ -17,27 +17,27 @@ int -BSIM4v6mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +BSIM4v6mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsim4v7/b4v7mdel.c b/src/spicelib/devices/bsim4v7/b4v7mdel.c index e25bc5ce5..41029f608 100644 --- a/src/spicelib/devices/bsim4v7/b4v7mdel.c +++ b/src/spicelib/devices/bsim4v7/b4v7mdel.c @@ -17,27 +17,27 @@ int -BSIM4v7mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +BSIM4v7mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/bsimsoi/b4soimdel.c b/src/spicelib/devices/bsimsoi/b4soimdel.c index 64276fb1c..d391820de 100644 --- a/src/spicelib/devices/bsimsoi/b4soimdel.c +++ b/src/spicelib/devices/bsimsoi/b4soimdel.c @@ -21,27 +21,27 @@ int -B4SOImDelete(GENmodel **model, IFuid modname, GENmodel *kill) +B4SOImDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/cap/capmdel.c b/src/spicelib/devices/cap/capmdel.c index 8d81f36e9..d4cbb7689 100644 --- a/src/spicelib/devices/cap/capmdel.c +++ b/src/spicelib/devices/cap/capmdel.c @@ -11,27 +11,27 @@ Modified: Spetember 2003 Paolo Nenzi int -CAPmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +CAPmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/cccs/cccsmdel.c b/src/spicelib/devices/cccs/cccsmdel.c index e9f515bb2..a07815097 100644 --- a/src/spicelib/devices/cccs/cccsmdel.c +++ b/src/spicelib/devices/cccs/cccsmdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -CCCSmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +CCCSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/ccvs/ccvsmdel.c b/src/spicelib/devices/ccvs/ccvsmdel.c index 278120f61..f148141b1 100644 --- a/src/spicelib/devices/ccvs/ccvsmdel.c +++ b/src/spicelib/devices/ccvs/ccvsmdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -CCVSmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +CCVSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/cpl/cplmdel.c b/src/spicelib/devices/cpl/cplmdel.c index 5e2bf7b68..dc0d18bd9 100644 --- a/src/spicelib/devices/cpl/cplmdel.c +++ b/src/spicelib/devices/cpl/cplmdel.c @@ -12,27 +12,27 @@ Author: 1992 Charles Hough int -CPLmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +CPLmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/csw/cswmdel.c b/src/spicelib/devices/csw/cswmdel.c index 7f189ba04..e75326091 100644 --- a/src/spicelib/devices/csw/cswmdel.c +++ b/src/spicelib/devices/csw/cswmdel.c @@ -10,27 +10,27 @@ Author: 1985 Gordon Jacobs int -CSWmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +CSWmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/dio/diomdel.c b/src/spicelib/devices/dio/diomdel.c index e52740094..22972ee1a 100644 --- a/src/spicelib/devices/dio/diomdel.c +++ b/src/spicelib/devices/dio/diomdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -DIOmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +DIOmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/hfet1/hfetmdel.c b/src/spicelib/devices/hfet1/hfetmdel.c index 92be848a7..b70c495de 100644 --- a/src/spicelib/devices/hfet1/hfetmdel.c +++ b/src/spicelib/devices/hfet1/hfetmdel.c @@ -14,27 +14,27 @@ Author: 1985 S. Hwang int -HFETAmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +HFETAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/hfet2/hfet2mdel.c b/src/spicelib/devices/hfet2/hfet2mdel.c index ce7a26bbc..3a92493c2 100644 --- a/src/spicelib/devices/hfet2/hfet2mdel.c +++ b/src/spicelib/devices/hfet2/hfet2mdel.c @@ -14,27 +14,27 @@ Author: 1985 S. Hwang int -HFET2mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +HFET2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/hisim2/hsm2mdel.c b/src/spicelib/devices/hisim2/hsm2mdel.c index f3e556e00..3268cbfa4 100644 --- a/src/spicelib/devices/hisim2/hsm2mdel.c +++ b/src/spicelib/devices/hisim2/hsm2mdel.c @@ -61,27 +61,27 @@ to others." int -HSM2mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +HSM2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/hisimhv1/hsmhvmdel.c b/src/spicelib/devices/hisimhv1/hsmhvmdel.c index ebb509869..f0d31e7be 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvmdel.c +++ b/src/spicelib/devices/hisimhv1/hsmhvmdel.c @@ -22,27 +22,27 @@ int -HSMHVmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +HSMHVmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c index 8d8bfcf2f..19400f334 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c @@ -64,27 +64,27 @@ June 2008 (revised October 2011) int -HSMHV2mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +HSMHV2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/ind/indmdel.c b/src/spicelib/devices/ind/indmdel.c index e63a33e1c..cffecd376 100644 --- a/src/spicelib/devices/ind/indmdel.c +++ b/src/spicelib/devices/ind/indmdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -INDmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +INDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/ind/mutmdel.c b/src/spicelib/devices/ind/mutmdel.c index 79edfc03b..eceacb9f9 100644 --- a/src/spicelib/devices/ind/mutmdel.c +++ b/src/spicelib/devices/ind/mutmdel.c @@ -11,28 +11,28 @@ Author: 1985 Thomas L. Quarles #ifdef MUTUAL int -MUTmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +MUTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } #endif /* MUTUAL */ diff --git a/src/spicelib/devices/isrc/isrcmdel.c b/src/spicelib/devices/isrc/isrcmdel.c index e4275f492..cd1559a96 100644 --- a/src/spicelib/devices/isrc/isrcmdel.c +++ b/src/spicelib/devices/isrc/isrcmdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -ISRCmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +ISRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/jfet/jfetmdel.c b/src/spicelib/devices/jfet/jfetmdel.c index c1043e130..2e257a6d8 100644 --- a/src/spicelib/devices/jfet/jfetmdel.c +++ b/src/spicelib/devices/jfet/jfetmdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -JFETmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +JFETmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/jfet2/jfet2mdel.c b/src/spicelib/devices/jfet2/jfet2mdel.c index 191d9d21f..97a9baa6d 100644 --- a/src/spicelib/devices/jfet2/jfet2mdel.c +++ b/src/spicelib/devices/jfet2/jfet2mdel.c @@ -14,27 +14,27 @@ Modified to jfet2 for PS model definition ( Anthony E. Parker ) int -JFET2mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +JFET2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/ltra/ltramdel.c b/src/spicelib/devices/ltra/ltramdel.c index b7784e9e4..859e42609 100644 --- a/src/spicelib/devices/ltra/ltramdel.c +++ b/src/spicelib/devices/ltra/ltramdel.c @@ -10,27 +10,27 @@ Author: 1990 Jaijeet S. Roychowdhury int -LTRAmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +LTRAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/mes/mesmdel.c b/src/spicelib/devices/mes/mesmdel.c index bfe5dc38e..1d0291391 100644 --- a/src/spicelib/devices/mes/mesmdel.c +++ b/src/spicelib/devices/mes/mesmdel.c @@ -10,27 +10,27 @@ Author: 1985 S. Hwang int -MESmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +MESmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/mesa/mesamdel.c b/src/spicelib/devices/mesa/mesamdel.c index be32a4942..a7e1ccf46 100644 --- a/src/spicelib/devices/mesa/mesamdel.c +++ b/src/spicelib/devices/mesa/mesamdel.c @@ -14,27 +14,27 @@ Author: 1985 S. Hwang int -MESAmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +MESAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/mos1/mos1mdel.c b/src/spicelib/devices/mos1/mos1mdel.c index d94c4edd6..2eeabb473 100644 --- a/src/spicelib/devices/mos1/mos1mdel.c +++ b/src/spicelib/devices/mos1/mos1mdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -MOS1mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +MOS1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/mos2/mos2mdel.c b/src/spicelib/devices/mos2/mos2mdel.c index 858dea08d..0d984be86 100644 --- a/src/spicelib/devices/mos2/mos2mdel.c +++ b/src/spicelib/devices/mos2/mos2mdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -MOS2mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +MOS2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/mos3/mos3mdel.c b/src/spicelib/devices/mos3/mos3mdel.c index 3b171adcd..182b07fff 100644 --- a/src/spicelib/devices/mos3/mos3mdel.c +++ b/src/spicelib/devices/mos3/mos3mdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -MOS3mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +MOS3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/mos9/mos9mdel.c b/src/spicelib/devices/mos9/mos9mdel.c index 633f5ea62..2f88307b4 100644 --- a/src/spicelib/devices/mos9/mos9mdel.c +++ b/src/spicelib/devices/mos9/mos9mdel.c @@ -11,27 +11,27 @@ Modified: Alan Gillespie int -MOS9mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +MOS9mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/nbjt/nbjtmdel.c b/src/spicelib/devices/nbjt/nbjtmdel.c index 2ee620847..95318f2cc 100644 --- a/src/spicelib/devices/nbjt/nbjtmdel.c +++ b/src/spicelib/devices/nbjt/nbjtmdel.c @@ -15,23 +15,23 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NBJTmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +NBJTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - if ((*model)->GENinstances) + if (model->GENinstances) return E_NOTEMPTY; - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - FREE(*model); + *prev = model->GENnextModel; + FREE(model); return OK; } diff --git a/src/spicelib/devices/nbjt2/nbt2mdel.c b/src/spicelib/devices/nbjt2/nbt2mdel.c index 105984a6c..8dd9a9000 100644 --- a/src/spicelib/devices/nbjt2/nbt2mdel.c +++ b/src/spicelib/devices/nbjt2/nbt2mdel.c @@ -15,23 +15,23 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NBJT2mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +NBJT2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - if ((*model)->GENinstances) + if (model->GENinstances) return E_NOTEMPTY; - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - FREE(*model); + *prev = model->GENnextModel; + FREE(model); return OK; } diff --git a/src/spicelib/devices/ndev/ndevmdel.c b/src/spicelib/devices/ndev/ndevmdel.c index 062f9f2ad..b5d32aba1 100644 --- a/src/spicelib/devices/ndev/ndevmdel.c +++ b/src/spicelib/devices/ndev/ndevmdel.c @@ -10,9 +10,9 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NDEVmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +NDEVmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { - NG_IGNORE(model); + NG_IGNORE(models); NG_IGNORE(modname); NG_IGNORE(kill); diff --git a/src/spicelib/devices/numd/numdmdel.c b/src/spicelib/devices/numd/numdmdel.c index 9b1f0791b..55198c462 100644 --- a/src/spicelib/devices/numd/numdmdel.c +++ b/src/spicelib/devices/numd/numdmdel.c @@ -10,27 +10,27 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMDmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +NUMDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/numd2/nud2mdel.c b/src/spicelib/devices/numd2/nud2mdel.c index a413a53e5..99f9ca044 100644 --- a/src/spicelib/devices/numd2/nud2mdel.c +++ b/src/spicelib/devices/numd2/nud2mdel.c @@ -10,27 +10,27 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMD2mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +NUMD2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/numos/nummmdel.c b/src/spicelib/devices/numos/nummmdel.c index 69dc99d55..95f9ea466 100644 --- a/src/spicelib/devices/numos/nummmdel.c +++ b/src/spicelib/devices/numos/nummmdel.c @@ -15,23 +15,23 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMOSmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +NUMOSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - if ((*model)->GENinstances) + if (model->GENinstances) return E_NOTEMPTY; - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - FREE(*model); + *prev = model->GENnextModel; + FREE(model); return OK; } diff --git a/src/spicelib/devices/res/resmdel.c b/src/spicelib/devices/res/resmdel.c index 37d7d8958..1c47d623b 100644 --- a/src/spicelib/devices/res/resmdel.c +++ b/src/spicelib/devices/res/resmdel.c @@ -10,27 +10,27 @@ Modified: Apr 2000 - Paolo Nenzi int -RESmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +RESmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/soi3/soi3mdel.c b/src/spicelib/devices/soi3/soi3mdel.c index ee88347e0..22b31424e 100644 --- a/src/spicelib/devices/soi3/soi3mdel.c +++ b/src/spicelib/devices/soi3/soi3mdel.c @@ -27,27 +27,27 @@ Acknowledgements : Rupert Howes and Pete Mole. int -SOI3mDelete(GENmodel **model, IFuid modname, GENmodel *kill) +SOI3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/sw/swmdel.c b/src/spicelib/devices/sw/swmdel.c index e38d6877c..903e98c8d 100644 --- a/src/spicelib/devices/sw/swmdel.c +++ b/src/spicelib/devices/sw/swmdel.c @@ -10,27 +10,27 @@ Author: 1985 Gordon Jacobs int -SWmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +SWmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/tra/tramdel.c b/src/spicelib/devices/tra/tramdel.c index 93f3c9151..2473b0cfc 100644 --- a/src/spicelib/devices/tra/tramdel.c +++ b/src/spicelib/devices/tra/tramdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -TRAmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +TRAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/txl/txlmdel.c b/src/spicelib/devices/txl/txlmdel.c index d5aef93ef..fb589cae5 100644 --- a/src/spicelib/devices/txl/txlmdel.c +++ b/src/spicelib/devices/txl/txlmdel.c @@ -11,27 +11,27 @@ Author: 1992 Charles Hough int -TXLmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +TXLmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/urc/urcmdel.c b/src/spicelib/devices/urc/urcmdel.c index ba6db3427..b97bdf28c 100644 --- a/src/spicelib/devices/urc/urcmdel.c +++ b/src/spicelib/devices/urc/urcmdel.c @@ -10,27 +10,27 @@ Author: 1987 Thomas L. Quarles int -URCmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +URCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/vbic/vbicmdel.c b/src/spicelib/devices/vbic/vbicmdel.c index 9ef4d439e..af690acfd 100644 --- a/src/spicelib/devices/vbic/vbicmdel.c +++ b/src/spicelib/devices/vbic/vbicmdel.c @@ -18,23 +18,23 @@ Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH int -VBICmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +VBICmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - if ((*model)->GENinstances) + if (model->GENinstances) return E_NOTEMPTY; - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - FREE(*model); + *prev = model->GENnextModel; + FREE(model); return OK; } diff --git a/src/spicelib/devices/vccs/vccsmdel.c b/src/spicelib/devices/vccs/vccsmdel.c index f4d38c023..804830d65 100644 --- a/src/spicelib/devices/vccs/vccsmdel.c +++ b/src/spicelib/devices/vccs/vccsmdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -VCCSmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +VCCSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/vcvs/vcvsmdel.c b/src/spicelib/devices/vcvs/vcvsmdel.c index 4adc62155..bfff0d194 100644 --- a/src/spicelib/devices/vcvs/vcvsmdel.c +++ b/src/spicelib/devices/vcvs/vcvsmdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -VCVSmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +VCVSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; } diff --git a/src/spicelib/devices/vsrc/vsrcmdel.c b/src/spicelib/devices/vsrc/vsrcmdel.c index 42593c002..ad2cd2af2 100644 --- a/src/spicelib/devices/vsrc/vsrcmdel.c +++ b/src/spicelib/devices/vsrc/vsrcmdel.c @@ -10,27 +10,27 @@ Author: 1985 Thomas L. Quarles int -VSRCmDelete(GENmodel **model, IFuid modname, GENmodel *kill) +VSRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) { GENinstance *here; - GENmodel **oldmod; + GENmodel **prev = models; + GENmodel *model = *prev; - oldmod = model; - for (; *model; model = &((*model)->GENnextModel)) { - if ((*model)->GENmodName == modname || (kill && *model == kill)) + for (; model; model = model->GENnextModel) { + if (model->GENmodName == modname || (kill && model == kill)) goto delgot; - oldmod = model; + prev = &(model->GENnextModel); } return E_NOMOD; delgot: - *oldmod = (*model)->GENnextModel; /* cut deleted device out of list */ - for (here = (*model)->GENinstances; here;) { + *prev = model->GENnextModel; + for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; FREE(here); here = next_instance; } - FREE(*model); + FREE(model); return OK; }