From 5ecf02796bb8fc74947728bed4eb1e7459d37b75 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 4 Jan 2018 18:13:31 +0100 Subject: [PATCH] devices/**/XXXdel.c, use GENmodel and GENinstance --- src/spicelib/devices/asrc/asrcdel.c | 20 ++++++++----------- src/spicelib/devices/bjt/bjtdel.c | 20 ++++++++----------- src/spicelib/devices/bsim1/b1del.c | 20 ++++++++----------- src/spicelib/devices/bsim2/b2del.c | 20 ++++++++----------- src/spicelib/devices/bsim3/b3del.c | 20 ++++++++----------- src/spicelib/devices/bsim3soi_dd/b3soidddel.c | 20 ++++++++----------- src/spicelib/devices/bsim3soi_fd/b3soifddel.c | 20 ++++++++----------- src/spicelib/devices/bsim3soi_pd/b3soipddel.c | 20 ++++++++----------- src/spicelib/devices/bsim3v0/b3v0del.c | 20 ++++++++----------- src/spicelib/devices/bsim3v1/b3v1del.c | 20 ++++++++----------- src/spicelib/devices/bsim3v32/b3v32del.c | 20 ++++++++----------- src/spicelib/devices/bsim4/b4del.c | 20 ++++++++----------- src/spicelib/devices/bsim4v5/b4v5del.c | 20 ++++++++----------- src/spicelib/devices/bsim4v6/b4v6del.c | 20 ++++++++----------- src/spicelib/devices/bsim4v7/b4v7del.c | 20 ++++++++----------- src/spicelib/devices/bsimsoi/b4soidel.c | 20 ++++++++----------- src/spicelib/devices/cap/capdel.c | 20 ++++++++----------- src/spicelib/devices/cccs/cccsdel.c | 20 ++++++++----------- src/spicelib/devices/ccvs/ccvsdel.c | 20 ++++++++----------- src/spicelib/devices/cpl/cpldel.c | 20 ++++++++----------- src/spicelib/devices/csw/cswdel.c | 20 ++++++++----------- src/spicelib/devices/dio/diodel.c | 20 ++++++++----------- src/spicelib/devices/hfet1/hfetdel.c | 20 ++++++++----------- src/spicelib/devices/hfet2/hfet2del.c | 20 ++++++++----------- src/spicelib/devices/hisim2/hsm2del.c | 20 ++++++++----------- src/spicelib/devices/hisimhv1/hsmhvdel.c | 20 ++++++++----------- src/spicelib/devices/hisimhv2/hsmhv2del.c | 20 ++++++++----------- src/spicelib/devices/ind/inddel.c | 20 ++++++++----------- src/spicelib/devices/ind/mutdel.c | 20 ++++++++----------- src/spicelib/devices/isrc/isrcdel.c | 20 ++++++++----------- src/spicelib/devices/jfet/jfetdel.c | 20 ++++++++----------- src/spicelib/devices/jfet2/jfet2del.c | 20 ++++++++----------- src/spicelib/devices/ltra/ltradel.c | 20 ++++++++----------- src/spicelib/devices/mes/mesdel.c | 20 ++++++++----------- src/spicelib/devices/mesa/mesadel.c | 20 ++++++++----------- src/spicelib/devices/mos1/mos1del.c | 20 ++++++++----------- src/spicelib/devices/mos2/mos2del.c | 20 ++++++++----------- src/spicelib/devices/mos3/mos3del.c | 20 ++++++++----------- src/spicelib/devices/mos9/mos9del.c | 20 ++++++++----------- src/spicelib/devices/nbjt/nbjtdel.c | 20 ++++++++----------- src/spicelib/devices/nbjt2/nbt2del.c | 20 ++++++++----------- src/spicelib/devices/ndev/ndevdel.c | 20 ++++++++----------- src/spicelib/devices/numd/numddel.c | 20 ++++++++----------- src/spicelib/devices/numd2/nud2del.c | 20 ++++++++----------- src/spicelib/devices/numos/nummdel.c | 20 ++++++++----------- src/spicelib/devices/res/resdel.c | 20 ++++++++----------- src/spicelib/devices/soi3/soi3del.c | 20 ++++++++----------- src/spicelib/devices/sw/swdelete.c | 20 ++++++++----------- src/spicelib/devices/tra/tradel.c | 20 ++++++++----------- src/spicelib/devices/txl/txldel.c | 20 ++++++++----------- src/spicelib/devices/urc/urcdel.c | 20 ++++++++----------- src/spicelib/devices/vbic/vbicdel.c | 20 ++++++++----------- src/spicelib/devices/vccs/vccsdel.c | 20 ++++++++----------- src/spicelib/devices/vcvs/vcvsdel.c | 20 ++++++++----------- src/spicelib/devices/vsrc/vsrcdel.c | 20 ++++++++----------- 55 files changed, 440 insertions(+), 660 deletions(-) diff --git a/src/spicelib/devices/asrc/asrcdel.c b/src/spicelib/devices/asrc/asrcdel.c index c75a4a7b5..5c19d0cbb 100644 --- a/src/spicelib/devices/asrc/asrcdel.c +++ b/src/spicelib/devices/asrc/asrcdel.c @@ -10,22 +10,18 @@ Author: 1987 Kanwar Jit Singh int -ASRCdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +ASRCdelete(GENmodel *model, IFuid name, GENinstance **kill) { - ASRCinstance **fast = (ASRCinstance **) kill; - ASRCmodel *model = (ASRCmodel *) inModel; - ASRCinstance **prev = NULL; - ASRCinstance *here; - - for (; model; model = model->ASRCnextModel) { - prev = &(model->ASRCinstances); - for (here = *prev; here; here = *prev) { - if (here->ASRCname == name || (fast && here == *fast)) { - *prev = here->ASRCnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->ASRCnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bjt/bjtdel.c b/src/spicelib/devices/bjt/bjtdel.c index 0ba7d5a90..3d06b6600 100644 --- a/src/spicelib/devices/bjt/bjtdel.c +++ b/src/spicelib/devices/bjt/bjtdel.c @@ -15,22 +15,18 @@ Author: 1985 Thomas L. Quarles int -BJTdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +BJTdelete(GENmodel *model, IFuid name, GENinstance **kill) { - BJTmodel *model = (BJTmodel *) inModel; - BJTinstance **fast = (BJTinstance **) kill; - BJTinstance **prev = NULL; - BJTinstance *here; - - for (; model; model = model->BJTnextModel) { - prev = &(model->BJTinstances); - for (here = *prev; here; here = *prev) { - if (here->BJTname == name || (fast && here == *fast)) { - *prev = here->BJTnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->BJTnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim1/b1del.c b/src/spicelib/devices/bsim1/b1del.c index 1720b976f..faac55943 100644 --- a/src/spicelib/devices/bsim1/b1del.c +++ b/src/spicelib/devices/bsim1/b1del.c @@ -11,22 +11,18 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int -B1delete(GENmodel *inModel, IFuid name, GENinstance **kill) +B1delete(GENmodel *model, IFuid name, GENinstance **kill) { - B1instance **fast = (B1instance **) kill; - B1model *model = (B1model *) inModel; - B1instance **prev = NULL; - B1instance *here; - - for (; model; model = model->B1nextModel) { - prev = &(model->B1instances); - for (here = *prev; here; here = *prev) { - if (here->B1name == name || (fast && here == *fast)) { - *prev = here->B1nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->B1nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim2/b2del.c b/src/spicelib/devices/bsim2/b2del.c index ef1d4a69c..818a717fb 100644 --- a/src/spicelib/devices/bsim2/b2del.c +++ b/src/spicelib/devices/bsim2/b2del.c @@ -11,22 +11,18 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int -B2delete(GENmodel *inModel, IFuid name, GENinstance **kill) +B2delete(GENmodel *model, IFuid name, GENinstance **kill) { - B2instance **fast = (B2instance **) kill; - B2model *model = (B2model *) inModel; - B2instance **prev = NULL; - B2instance *here; - - for (; model; model = model->B2nextModel) { - prev = &(model->B2instances); - for (here = *prev; here; here = *prev) { - if (here->B2name == name || (fast && here == *fast)) { - *prev = here->B2nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->B2nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim3/b3del.c b/src/spicelib/devices/bsim3/b3del.c index ba88f5144..0ef7efabc 100644 --- a/src/spicelib/devices/bsim3/b3del.c +++ b/src/spicelib/devices/bsim3/b3del.c @@ -17,22 +17,18 @@ int -BSIM3delete(GENmodel *inModel, IFuid name, GENinstance **kill) +BSIM3delete(GENmodel *model, IFuid name, GENinstance **kill) { - BSIM3instance **fast = (BSIM3instance **) kill; - BSIM3model *model = (BSIM3model *) inModel; - BSIM3instance **prev = NULL; - BSIM3instance *here; - - for (; model; model = model->BSIM3nextModel) { - prev = &(model->BSIM3instances); - for (here = *prev; here; here = *prev) { - if (here->BSIM3name == name || (fast && here == *fast)) { - *prev = here->BSIM3nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->BSIM3nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim3soi_dd/b3soidddel.c b/src/spicelib/devices/bsim3soi_dd/b3soidddel.c index 4afc90e26..c9989993f 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soidddel.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soidddel.c @@ -18,22 +18,18 @@ Modified by Paolo Nenzi 2002 int -B3SOIDDdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +B3SOIDDdelete(GENmodel *model, IFuid name, GENinstance **kill) { - B3SOIDDinstance **fast = (B3SOIDDinstance **) kill; - B3SOIDDmodel *model = (B3SOIDDmodel *) inModel; - B3SOIDDinstance **prev = NULL; - B3SOIDDinstance *here; - - for (; model; model = model->B3SOIDDnextModel) { - prev = &(model->B3SOIDDinstances); - for (here = *prev; here; here = *prev) { - if (here->B3SOIDDname == name || (fast && here == *fast)) { - *prev = here->B3SOIDDnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->B3SOIDDnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifddel.c b/src/spicelib/devices/bsim3soi_fd/b3soifddel.c index 37aa3a19a..26ae2b27d 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifddel.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifddel.c @@ -18,22 +18,18 @@ File: b3soifddel.c 98/5/01 int -B3SOIFDdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +B3SOIFDdelete(GENmodel *model, IFuid name, GENinstance **kill) { - B3SOIFDinstance **fast = (B3SOIFDinstance **) kill; - B3SOIFDmodel *model = (B3SOIFDmodel *) inModel; - B3SOIFDinstance **prev = NULL; - B3SOIFDinstance *here; - - for (; model; model = model->B3SOIFDnextModel) { - prev = &(model->B3SOIFDinstances); - for (here = *prev; here; here = *prev) { - if (here->B3SOIFDname == name || (fast && here == *fast)) { - *prev = here->B3SOIFDnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->B3SOIFDnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipddel.c b/src/spicelib/devices/bsim3soi_pd/b3soipddel.c index 8cdba19c8..0c7d2f4b2 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipddel.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipddel.c @@ -18,22 +18,18 @@ Modified by Paolo Nenzi 2002 int -B3SOIPDdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +B3SOIPDdelete(GENmodel *model, IFuid name, GENinstance **kill) { - B3SOIPDinstance **fast = (B3SOIPDinstance **) kill; - B3SOIPDmodel *model = (B3SOIPDmodel *) inModel; - B3SOIPDinstance **prev = NULL; - B3SOIPDinstance *here; - - for (; model; model = model->B3SOIPDnextModel) { - prev = &(model->B3SOIPDinstances); - for (here = *prev; here; here = *prev) { - if (here->B3SOIPDname == name || (fast && here == *fast)) { - *prev = here->B3SOIPDnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->B3SOIPDnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim3v0/b3v0del.c b/src/spicelib/devices/bsim3v0/b3v0del.c index 6a783e16e..7495f57dc 100644 --- a/src/spicelib/devices/bsim3v0/b3v0del.c +++ b/src/spicelib/devices/bsim3v0/b3v0del.c @@ -12,22 +12,18 @@ File: b3v0del.c int -BSIM3v0delete(GENmodel *inModel, IFuid name, GENinstance **kill) +BSIM3v0delete(GENmodel *model, IFuid name, GENinstance **kill) { - BSIM3v0instance **fast = (BSIM3v0instance **) kill; - BSIM3v0model *model = (BSIM3v0model *) inModel; - BSIM3v0instance **prev = NULL; - BSIM3v0instance *here; - - for (; model; model = model->BSIM3v0nextModel) { - prev = &(model->BSIM3v0instances); - for (here = *prev; here; here = *prev) { - if (here->BSIM3v0name == name || (fast && here == *fast)) { - *prev = here->BSIM3v0nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->BSIM3v0nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim3v1/b3v1del.c b/src/spicelib/devices/bsim3v1/b3v1del.c index 289db98ba..dd4e25407 100644 --- a/src/spicelib/devices/bsim3v1/b3v1del.c +++ b/src/spicelib/devices/bsim3v1/b3v1del.c @@ -18,22 +18,18 @@ int -BSIM3v1delete(GENmodel *inModel, IFuid name, GENinstance **kill) +BSIM3v1delete(GENmodel *model, IFuid name, GENinstance **kill) { - BSIM3v1instance **fast = (BSIM3v1instance **) kill; - BSIM3v1model *model = (BSIM3v1model *) inModel; - BSIM3v1instance **prev = NULL; - BSIM3v1instance *here; - - for (; model; model = model->BSIM3v1nextModel) { - prev = &(model->BSIM3v1instances); - for (here = *prev; here; here = *prev) { - if (here->BSIM3v1name == name || (fast && here == *fast)) { - *prev = here->BSIM3v1nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->BSIM3v1nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim3v32/b3v32del.c b/src/spicelib/devices/bsim3v32/b3v32del.c index 81dec6a62..e2f2a44ac 100644 --- a/src/spicelib/devices/bsim3v32/b3v32del.c +++ b/src/spicelib/devices/bsim3v32/b3v32del.c @@ -18,22 +18,18 @@ int -BSIM3v32delete(GENmodel *inModel, IFuid name, GENinstance **kill) +BSIM3v32delete(GENmodel *model, IFuid name, GENinstance **kill) { - BSIM3v32instance **fast = (BSIM3v32instance **) kill; - BSIM3v32model *model = (BSIM3v32model *) inModel; - BSIM3v32instance **prev = NULL; - BSIM3v32instance *here; - - for (; model; model = model->BSIM3v32nextModel) { - prev = &(model->BSIM3v32instances); - for (here = *prev; here; here = *prev) { - if (here->BSIM3v32name == name || (fast && here == *fast)) { - *prev = here->BSIM3v32nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->BSIM3v32nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim4/b4del.c b/src/spicelib/devices/bsim4/b4del.c index bfeba8ab6..ae96166a8 100644 --- a/src/spicelib/devices/bsim4/b4del.c +++ b/src/spicelib/devices/bsim4/b4del.c @@ -66,22 +66,18 @@ int -BSIM4delete(GENmodel *inModel, IFuid name, GENinstance **kill) +BSIM4delete(GENmodel *model, IFuid name, GENinstance **kill) { - BSIM4instance **fast = (BSIM4instance **) kill; - BSIM4model *model = (BSIM4model *) inModel; - BSIM4instance **prev = NULL; - BSIM4instance *here; - - for (; model; model = model->BSIM4nextModel) { - prev = &(model->BSIM4instances); - for (here = *prev; here; here = *prev) { - if (here->BSIM4name == name || (fast && here == *fast)) { - *prev = here->BSIM4nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->BSIM4nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim4v5/b4v5del.c b/src/spicelib/devices/bsim4v5/b4v5del.c index 7036d0360..3908fd5fc 100644 --- a/src/spicelib/devices/bsim4v5/b4v5del.c +++ b/src/spicelib/devices/bsim4v5/b4v5del.c @@ -16,22 +16,18 @@ int -BSIM4v5delete(GENmodel *inModel, IFuid name, GENinstance **kill) +BSIM4v5delete(GENmodel *model, IFuid name, GENinstance **kill) { - BSIM4v5instance **fast = (BSIM4v5instance **) kill; - BSIM4v5model *model = (BSIM4v5model *) inModel; - BSIM4v5instance **prev = NULL; - BSIM4v5instance *here; - - for (; model; model = model->BSIM4v5nextModel) { - prev = &(model->BSIM4v5instances); - for (here = *prev; here; here = *prev) { - if (here->BSIM4v5name == name || (fast && here == *fast)) { - *prev = here->BSIM4v5nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->BSIM4v5nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim4v6/b4v6del.c b/src/spicelib/devices/bsim4v6/b4v6del.c index db3b4abbc..35957b750 100644 --- a/src/spicelib/devices/bsim4v6/b4v6del.c +++ b/src/spicelib/devices/bsim4v6/b4v6del.c @@ -18,22 +18,18 @@ int -BSIM4v6delete(GENmodel *inModel, IFuid name, GENinstance **kill) +BSIM4v6delete(GENmodel *model, IFuid name, GENinstance **kill) { - BSIM4v6instance **fast = (BSIM4v6instance **) kill; - BSIM4v6model *model = (BSIM4v6model *) inModel; - BSIM4v6instance **prev = NULL; - BSIM4v6instance *here; - - for (; model; model = model->BSIM4v6nextModel) { - prev = &(model->BSIM4v6instances); - for (here = *prev; here; here = *prev) { - if (here->BSIM4v6name == name || (fast && here == *fast)) { - *prev = here->BSIM4v6nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->BSIM4v6nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsim4v7/b4v7del.c b/src/spicelib/devices/bsim4v7/b4v7del.c index a1d692464..e9cff5952 100644 --- a/src/spicelib/devices/bsim4v7/b4v7del.c +++ b/src/spicelib/devices/bsim4v7/b4v7del.c @@ -18,22 +18,18 @@ int -BSIM4v7delete(GENmodel *inModel, IFuid name, GENinstance **kill) +BSIM4v7delete(GENmodel *model, IFuid name, GENinstance **kill) { - BSIM4v7instance **fast = (BSIM4v7instance **) kill; - BSIM4v7model *model = (BSIM4v7model *) inModel; - BSIM4v7instance **prev = NULL; - BSIM4v7instance *here; - - for (; model; model = model->BSIM4v7nextModel) { - prev = &(model->BSIM4v7instances); - for (here = *prev; here; here = *prev) { - if (here->BSIM4v7name == name || (fast && here == *fast)) { - *prev = here->BSIM4v7nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->BSIM4v7nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/bsimsoi/b4soidel.c b/src/spicelib/devices/bsimsoi/b4soidel.c index 828aef044..d3dd23c35 100644 --- a/src/spicelib/devices/bsimsoi/b4soidel.c +++ b/src/spicelib/devices/bsimsoi/b4soidel.c @@ -21,22 +21,18 @@ int -B4SOIdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +B4SOIdelete(GENmodel *model, IFuid name, GENinstance **kill) { - B4SOIinstance **fast = (B4SOIinstance **) kill; - B4SOImodel *model = (B4SOImodel *) inModel; - B4SOIinstance **prev = NULL; - B4SOIinstance *here; - - for (; model; model = model->B4SOInextModel) { - prev = &(model->B4SOIinstances); - for (here = *prev; here; here = *prev) { - if (here->B4SOIname == name || (fast && here == *fast)) { - *prev = here->B4SOInextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->B4SOInextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/cap/capdel.c b/src/spicelib/devices/cap/capdel.c index 218233e36..2e9fbc31b 100644 --- a/src/spicelib/devices/cap/capdel.c +++ b/src/spicelib/devices/cap/capdel.c @@ -11,22 +11,18 @@ Modified: September 2003 Paolo Nenzi int -CAPdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +CAPdelete(GENmodel *model, IFuid name, GENinstance **kill) { - CAPinstance **fast = (CAPinstance **) kill; - CAPmodel *model = (CAPmodel *) inModel; - CAPinstance **prev = NULL; - CAPinstance *here; - - for (; model; model = model->CAPnextModel) { - prev = &(model->CAPinstances); - for (here = *prev; here; here = *prev) { - if (here->CAPname == name || (fast && here == *fast)) { - *prev = here->CAPnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->CAPnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/cccs/cccsdel.c b/src/spicelib/devices/cccs/cccsdel.c index b9e2e38d4..23fae4694 100644 --- a/src/spicelib/devices/cccs/cccsdel.c +++ b/src/spicelib/devices/cccs/cccsdel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -CCCSdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +CCCSdelete(GENmodel *model, IFuid name, GENinstance **kill) { - CCCSmodel *model = (CCCSmodel *) inModel; - CCCSinstance **fast = (CCCSinstance **) kill; - CCCSinstance **prev = NULL; - CCCSinstance *here; - - for (; model; model = model->CCCSnextModel) { - prev = &(model->CCCSinstances); - for (here = *prev; here; here = *prev) { - if (here->CCCSname == name || (fast && here == *fast)) { - *prev = here->CCCSnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->CCCSnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/ccvs/ccvsdel.c b/src/spicelib/devices/ccvs/ccvsdel.c index d5c318be0..26bf62d73 100644 --- a/src/spicelib/devices/ccvs/ccvsdel.c +++ b/src/spicelib/devices/ccvs/ccvsdel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -CCVSdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +CCVSdelete(GENmodel *model, IFuid name, GENinstance **kill) { - CCVSmodel *model = (CCVSmodel *) inModel; - CCVSinstance **fast = (CCVSinstance **) kill; - CCVSinstance **prev = NULL; - CCVSinstance *here; - - for (; model; model = model->CCVSnextModel) { - prev = &(model->CCVSinstances); - for (here = *prev; here; here = *prev) { - if (here->CCVSname == name || (fast && here == *fast)) { - *prev = here->CCVSnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->CCVSnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/cpl/cpldel.c b/src/spicelib/devices/cpl/cpldel.c index 2711b54d7..0a5555f86 100644 --- a/src/spicelib/devices/cpl/cpldel.c +++ b/src/spicelib/devices/cpl/cpldel.c @@ -11,22 +11,18 @@ Author: 1992 Charles Hough int -CPLdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +CPLdelete(GENmodel *model, IFuid name, GENinstance **kill) { - CPLmodel *model = (CPLmodel *) inModel; - CPLinstance **fast = (CPLinstance **) kill; - CPLinstance **prev = NULL; - CPLinstance *here; - - for (; model; model = model->CPLnextModel) { - prev = &(model->CPLinstances); - for (here = *prev; here; here = *prev) { - if (here->CPLname == name || (fast && here == *fast)) { - *prev = here->CPLnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->CPLnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/csw/cswdel.c b/src/spicelib/devices/csw/cswdel.c index b5624244f..6d781de85 100644 --- a/src/spicelib/devices/csw/cswdel.c +++ b/src/spicelib/devices/csw/cswdel.c @@ -10,22 +10,18 @@ Author: 1985 Gordon Jacobs int -CSWdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +CSWdelete(GENmodel *model, IFuid name, GENinstance **kill) { - CSWmodel *model = (CSWmodel *) inModel; - CSWinstance **fast = (CSWinstance **) kill; - CSWinstance **prev = NULL; - CSWinstance *here; - - for (; model; model = model->CSWnextModel) { - prev = &(model->CSWinstances); - for (here = *prev; here; here = *prev) { - if (here->CSWname == name || (fast && here == *fast)) { - *prev = here->CSWnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->CSWnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/dio/diodel.c b/src/spicelib/devices/dio/diodel.c index 9d2c30b7f..285e12732 100644 --- a/src/spicelib/devices/dio/diodel.c +++ b/src/spicelib/devices/dio/diodel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -DIOdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +DIOdelete(GENmodel *model, IFuid name, GENinstance **kill) { - DIOmodel *model = (DIOmodel *) inModel; - DIOinstance **fast = (DIOinstance **) kill; - DIOinstance **prev = NULL; - DIOinstance *here; - - for (; model; model = model->DIOnextModel) { - prev = &(model->DIOinstances); - for (here = *prev; here; here = *prev) { - if (here->DIOname == name || (fast && here == *fast)) { - *prev = here->DIOnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->DIOnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/hfet1/hfetdel.c b/src/spicelib/devices/hfet1/hfetdel.c index a94fa8db1..e4e207fd4 100644 --- a/src/spicelib/devices/hfet1/hfetdel.c +++ b/src/spicelib/devices/hfet1/hfetdel.c @@ -14,22 +14,18 @@ Author: 1985 S. Hwang int -HFETAdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +HFETAdelete(GENmodel *model, IFuid name, GENinstance **kill) { - HFETAmodel *model = (HFETAmodel *) inModel; - HFETAinstance **fast = (HFETAinstance **) kill; - HFETAinstance **prev = NULL; - HFETAinstance *here; - - for (; model; model = model->HFETAnextModel) { - prev = &(model->HFETAinstances); - for (here = *prev; here; here = *prev) { - if (here->HFETAname == name || (fast && here == *fast)) { - *prev = here->HFETAnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->HFETAnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/hfet2/hfet2del.c b/src/spicelib/devices/hfet2/hfet2del.c index 4b3628c83..a523edf22 100644 --- a/src/spicelib/devices/hfet2/hfet2del.c +++ b/src/spicelib/devices/hfet2/hfet2del.c @@ -14,22 +14,18 @@ Author: 1985 S. Hwang int -HFET2delete(GENmodel *inModel, IFuid name, GENinstance **kill) +HFET2delete(GENmodel *model, IFuid name, GENinstance **kill) { - HFET2model *model = (HFET2model *) inModel; - HFET2instance **fast = (HFET2instance **) kill; - HFET2instance **prev = NULL; - HFET2instance *here; - - for (; model; model = model->HFET2nextModel) { - prev = &(model->HFET2instances); - for (here = *prev; here; here = *prev) { - if (here->HFET2name == name || (fast && here == *fast)) { - *prev = here->HFET2nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->HFET2nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/hisim2/hsm2del.c b/src/spicelib/devices/hisim2/hsm2del.c index 4e475e130..dd261146c 100644 --- a/src/spicelib/devices/hisim2/hsm2del.c +++ b/src/spicelib/devices/hisim2/hsm2del.c @@ -62,22 +62,18 @@ to others." int -HSM2delete(GENmodel *inModel, IFuid name, GENinstance **kill) +HSM2delete(GENmodel *model, IFuid name, GENinstance **kill) { - HSM2instance **fast = (HSM2instance **) kill; - HSM2model *model = (HSM2model *) inModel; - HSM2instance **prev = NULL; - HSM2instance *here; - - for (; model; model = model->HSM2nextModel) { - prev = &(model->HSM2instances); - for (here = *prev; here; here = *prev) { - if (here->HSM2name == name || (fast && here == *fast)) { - *prev = here->HSM2nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->HSM2nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/hisimhv1/hsmhvdel.c b/src/spicelib/devices/hisimhv1/hsmhvdel.c index fa29c8f93..a8bee3383 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvdel.c +++ b/src/spicelib/devices/hisimhv1/hsmhvdel.c @@ -23,22 +23,18 @@ int -HSMHVdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +HSMHVdelete(GENmodel *model, IFuid name, GENinstance **kill) { - HSMHVinstance **fast = (HSMHVinstance **) kill; - HSMHVmodel *model = (HSMHVmodel *) inModel; - HSMHVinstance **prev = NULL; - HSMHVinstance *here; - - for (; model; model = model->HSMHVnextModel) { - prev = &(model->HSMHVinstances); - for (here = *prev; here; here = *prev) { - if (here->HSMHVname == name || (fast && here == *fast)) { - *prev = here->HSMHVnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->HSMHVnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/hisimhv2/hsmhv2del.c b/src/spicelib/devices/hisimhv2/hsmhv2del.c index 4f3937bd0..577aba1c4 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2del.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2del.c @@ -65,22 +65,18 @@ June 2008 (revised October 2011) int -HSMHV2delete(GENmodel *inModel, IFuid name, GENinstance **kill) +HSMHV2delete(GENmodel *model, IFuid name, GENinstance **kill) { - HSMHV2instance **fast = (HSMHV2instance **) kill; - HSMHV2model *model = (HSMHV2model *) inModel; - HSMHV2instance **prev = NULL; - HSMHV2instance *here; - - for (; model; model = model->HSMHV2nextModel) { - prev = &(model->HSMHV2instances); - for (here = *prev; here; here = *prev) { - if (here->HSMHV2name == name || (fast && here == *fast)) { - *prev = here->HSMHV2nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->HSMHV2nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/ind/inddel.c b/src/spicelib/devices/ind/inddel.c index 836968ae0..aa4473191 100644 --- a/src/spicelib/devices/ind/inddel.c +++ b/src/spicelib/devices/ind/inddel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -INDdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +INDdelete(GENmodel *model, IFuid name, GENinstance **kill) { - INDmodel *model = (INDmodel *) inModel; - INDinstance **fast = (INDinstance **) kill; - INDinstance **prev = NULL; - INDinstance *here; - - for (; model; model = model->INDnextModel) { - prev = &(model->INDinstances); - for (here = *prev; here; here = *prev) { - if (here->INDname == name || (fast && here == *fast)) { - *prev = here->INDnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->INDnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/ind/mutdel.c b/src/spicelib/devices/ind/mutdel.c index 06d78ae38..65f62c733 100644 --- a/src/spicelib/devices/ind/mutdel.c +++ b/src/spicelib/devices/ind/mutdel.c @@ -11,22 +11,18 @@ Author: 1985 Thomas L. Quarles #ifdef MUTUAL int -MUTdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +MUTdelete(GENmodel *model, IFuid name, GENinstance **kill) { - MUTmodel *model = (MUTmodel *) inModel; - MUTinstance **fast = (MUTinstance **) kill; - MUTinstance **prev = NULL; - MUTinstance *here; - - for (; model; model = model->MUTnextModel) { - prev = &(model->MUTinstances); - for (here = *prev; here; here = *prev) { - if (here->MUTname == name || (fast && here == *fast)) { - *prev = here->MUTnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->MUTnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/isrc/isrcdel.c b/src/spicelib/devices/isrc/isrcdel.c index 729e10cec..ffb666c1f 100644 --- a/src/spicelib/devices/isrc/isrcdel.c +++ b/src/spicelib/devices/isrc/isrcdel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -ISRCdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +ISRCdelete(GENmodel *model, IFuid name, GENinstance **kill) { - ISRCmodel *model = (ISRCmodel *) inModel; - ISRCinstance **fast = (ISRCinstance **) kill; - ISRCinstance **prev = NULL; - ISRCinstance *here; - - for (; model; model = model->ISRCnextModel) { - prev = &(model->ISRCinstances); - for (here = *prev; here; here = *prev) { - if (here->ISRCname == name || (fast && here == *fast)) { - *prev = here->ISRCnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->ISRCnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/jfet/jfetdel.c b/src/spicelib/devices/jfet/jfetdel.c index 51dfdb7da..f26dbb62d 100644 --- a/src/spicelib/devices/jfet/jfetdel.c +++ b/src/spicelib/devices/jfet/jfetdel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -JFETdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +JFETdelete(GENmodel *model, IFuid name, GENinstance **kill) { - JFETmodel *model = (JFETmodel *) inModel; - JFETinstance **fast = (JFETinstance **) kill; - JFETinstance **prev = NULL; - JFETinstance *here; - - for (; model; model = model->JFETnextModel) { - prev = &(model->JFETinstances); - for (here = *prev; here; here = *prev) { - if (here->JFETname == name || (fast && here == *fast)) { - *prev = here->JFETnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->JFETnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/jfet2/jfet2del.c b/src/spicelib/devices/jfet2/jfet2del.c index 036ef1649..b6e5b61d1 100644 --- a/src/spicelib/devices/jfet2/jfet2del.c +++ b/src/spicelib/devices/jfet2/jfet2del.c @@ -14,22 +14,18 @@ Modified to jfet2 for PS model definition ( Anthony E. Parker ) int -JFET2delete(GENmodel *inModel, IFuid name, GENinstance **kill) +JFET2delete(GENmodel *model, IFuid name, GENinstance **kill) { - JFET2model *model = (JFET2model *) inModel; - JFET2instance **fast = (JFET2instance **) kill; - JFET2instance **prev = NULL; - JFET2instance *here; - - for (; model; model = model->JFET2nextModel) { - prev = &(model->JFET2instances); - for (here = *prev; here; here = *prev) { - if (here->JFET2name == name || (fast && here == *fast)) { - *prev = here->JFET2nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->JFET2nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/ltra/ltradel.c b/src/spicelib/devices/ltra/ltradel.c index f5ea489bf..2840b4ee0 100644 --- a/src/spicelib/devices/ltra/ltradel.c +++ b/src/spicelib/devices/ltra/ltradel.c @@ -10,22 +10,18 @@ Author: 1990 Jaijeet S. Roychowdhury int -LTRAdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +LTRAdelete(GENmodel *model, IFuid name, GENinstance **kill) { - LTRAinstance **fast = (LTRAinstance **) kill; - LTRAmodel *model = (LTRAmodel *) inModel; - LTRAinstance **prev = NULL; - LTRAinstance *here; - - for (; model; model = model->LTRAnextModel) { - prev = &(model->LTRAinstances); - for (here = *prev; here; here = *prev) { - if (here->LTRAname == name || (fast && here == *fast)) { - *prev = here->LTRAnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->LTRAnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/mes/mesdel.c b/src/spicelib/devices/mes/mesdel.c index 14a38681a..c470fab6d 100644 --- a/src/spicelib/devices/mes/mesdel.c +++ b/src/spicelib/devices/mes/mesdel.c @@ -10,22 +10,18 @@ Author: 1985 S. Hwang int -MESdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +MESdelete(GENmodel *model, IFuid name, GENinstance **kill) { - MESmodel *model = (MESmodel *) inModel; - MESinstance **fast = (MESinstance **) kill; - MESinstance **prev = NULL; - MESinstance *here; - - for (; model; model = model->MESnextModel) { - prev = &(model->MESinstances); - for (here = *prev; here; here = *prev) { - if (here->MESname == name || (fast && here == *fast)) { - *prev = here->MESnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->MESnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/mesa/mesadel.c b/src/spicelib/devices/mesa/mesadel.c index 0a4c104fa..38697ce93 100644 --- a/src/spicelib/devices/mesa/mesadel.c +++ b/src/spicelib/devices/mesa/mesadel.c @@ -14,22 +14,18 @@ Author: 1985 S. Hwang int -MESAdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +MESAdelete(GENmodel *model, IFuid name, GENinstance **kill) { - MESAmodel *model = (MESAmodel *) inModel; - MESAinstance **fast = (MESAinstance **) kill; - MESAinstance **prev = NULL; - MESAinstance *here; - - for (; model; model = model->MESAnextModel) { - prev = &(model->MESAinstances); - for (here = *prev; here; here = *prev) { - if (here->MESAname == name || (fast && here == *fast)) { - *prev = here->MESAnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->MESAnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/mos1/mos1del.c b/src/spicelib/devices/mos1/mos1del.c index ed45007f4..fae053cda 100644 --- a/src/spicelib/devices/mos1/mos1del.c +++ b/src/spicelib/devices/mos1/mos1del.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -MOS1delete(GENmodel *inModel, IFuid name, GENinstance **kill) +MOS1delete(GENmodel *model, IFuid name, GENinstance **kill) { - MOS1model *model = (MOS1model *) inModel; - MOS1instance **fast = (MOS1instance **) kill; - MOS1instance **prev = NULL; - MOS1instance *here; - - for (; model; model = model->MOS1nextModel) { - prev = &(model->MOS1instances); - for (here = *prev; here; here = *prev) { - if (here->MOS1name == name || (fast && here == *fast)) { - *prev = here->MOS1nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->MOS1nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/mos2/mos2del.c b/src/spicelib/devices/mos2/mos2del.c index f4dd81701..105d3025e 100644 --- a/src/spicelib/devices/mos2/mos2del.c +++ b/src/spicelib/devices/mos2/mos2del.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -MOS2delete(GENmodel *inModel, IFuid name, GENinstance **kill) +MOS2delete(GENmodel *model, IFuid name, GENinstance **kill) { - MOS2model *model = (MOS2model *) inModel; - MOS2instance **fast = (MOS2instance **) kill; - MOS2instance **prev = NULL; - MOS2instance *here; - - for (; model; model = model->MOS2nextModel) { - prev = &(model->MOS2instances); - for (here = *prev; here; here = *prev) { - if (here->MOS2name == name || (fast && here == *fast)) { - *prev = here->MOS2nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->MOS2nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/mos3/mos3del.c b/src/spicelib/devices/mos3/mos3del.c index 97870b146..0a55ce9af 100644 --- a/src/spicelib/devices/mos3/mos3del.c +++ b/src/spicelib/devices/mos3/mos3del.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -MOS3delete(GENmodel *inModel, IFuid name, GENinstance **kill) +MOS3delete(GENmodel *model, IFuid name, GENinstance **kill) { - MOS3model *model = (MOS3model *) inModel; - MOS3instance **fast = (MOS3instance **) kill; - MOS3instance **prev = NULL; - MOS3instance *here; - - for (; model; model = model->MOS3nextModel) { - prev = &(model->MOS3instances); - for (here = *prev; here; here = *prev) { - if (here->MOS3name == name || (fast && here == *fast)) { - *prev = here->MOS3nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->MOS3nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/mos9/mos9del.c b/src/spicelib/devices/mos9/mos9del.c index 240765d2d..b5628def3 100644 --- a/src/spicelib/devices/mos9/mos9del.c +++ b/src/spicelib/devices/mos9/mos9del.c @@ -11,22 +11,18 @@ Modified: Alan Gillespie int -MOS9delete(GENmodel *inModel, IFuid name, GENinstance **kill) +MOS9delete(GENmodel *model, IFuid name, GENinstance **kill) { - MOS9model *model = (MOS9model *) inModel; - MOS9instance **fast = (MOS9instance **) kill; - MOS9instance **prev = NULL; - MOS9instance *here; - - for (; model; model = model->MOS9nextModel) { - prev = &(model->MOS9instances); - for (here = *prev; here; here = *prev) { - if (here->MOS9name == name || (fast && here == *fast)) { - *prev = here->MOS9nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->MOS9nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/nbjt/nbjtdel.c b/src/spicelib/devices/nbjt/nbjtdel.c index ce871e376..a55dfade9 100644 --- a/src/spicelib/devices/nbjt/nbjtdel.c +++ b/src/spicelib/devices/nbjt/nbjtdel.c @@ -15,22 +15,18 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NBJTdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +NBJTdelete(GENmodel *model, IFuid name, GENinstance **kill) { - NBJTmodel *model = (NBJTmodel *) inModel; - NBJTinstance **fast = (NBJTinstance **) kill; - NBJTinstance **prev = NULL; - NBJTinstance *here; - - for (; model; model = model->NBJTnextModel) { - prev = &(model->NBJTinstances); - for (here = *prev; here; here = *prev) { - if (here->NBJTname == name || (fast && here == *fast)) { - *prev = here->NBJTnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->NBJTnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/nbjt2/nbt2del.c b/src/spicelib/devices/nbjt2/nbt2del.c index b33851eb6..2a138f409 100644 --- a/src/spicelib/devices/nbjt2/nbt2del.c +++ b/src/spicelib/devices/nbjt2/nbt2del.c @@ -15,22 +15,18 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NBJT2delete(GENmodel *inModel, IFuid name, GENinstance **kill) +NBJT2delete(GENmodel *model, IFuid name, GENinstance **kill) { - NBJT2model *model = (NBJT2model *) inModel; - NBJT2instance **fast = (NBJT2instance **) kill; - NBJT2instance **prev = NULL; - NBJT2instance *here; - - for (; model; model = model->NBJT2nextModel) { - prev = &(model->NBJT2instances); - for (here = *prev; here; here = *prev) { - if (here->NBJT2name == name || (fast && here == *fast)) { - *prev = here->NBJT2nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->NBJT2nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/ndev/ndevdel.c b/src/spicelib/devices/ndev/ndevdel.c index d87fc0ede..a8db556d4 100644 --- a/src/spicelib/devices/ndev/ndevdel.c +++ b/src/spicelib/devices/ndev/ndevdel.c @@ -11,22 +11,18 @@ University of Science and Technology of China int -NDEVdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +NDEVdelete(GENmodel *model, IFuid name, GENinstance **kill) { - NDEVmodel *model = (NDEVmodel *) inModel; - NDEVinstance **fast = (NDEVinstance **) kill; - NDEVinstance **prev = NULL; - NDEVinstance *here; - - for (; model; model = model->NDEVnextModel) { - prev = &(model->NDEVinstances); - for (here = *prev; here; here = *prev) { - if (here->NDEVname == name || (fast && here == *fast)) { - *prev = here->NDEVnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->NDEVnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/numd/numddel.c b/src/spicelib/devices/numd/numddel.c index c1d3f57cb..4d5651093 100644 --- a/src/spicelib/devices/numd/numddel.c +++ b/src/spicelib/devices/numd/numddel.c @@ -10,22 +10,18 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMDdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +NUMDdelete(GENmodel *model, IFuid name, GENinstance **kill) { - NUMDmodel *model = (NUMDmodel *) inModel; - NUMDinstance **fast = (NUMDinstance **) kill; - NUMDinstance **prev = NULL; - NUMDinstance *here; - - for (; model; model = model->NUMDnextModel) { - prev = &(model->NUMDinstances); - for (here = *prev; here; here = *prev) { - if (here->NUMDname == name || (fast && here == *fast)) { - *prev = here->NUMDnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->NUMDnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/numd2/nud2del.c b/src/spicelib/devices/numd2/nud2del.c index 3d47dd739..5379f3943 100644 --- a/src/spicelib/devices/numd2/nud2del.c +++ b/src/spicelib/devices/numd2/nud2del.c @@ -10,22 +10,18 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMD2delete(GENmodel *inModel, IFuid name, GENinstance **kill) +NUMD2delete(GENmodel *model, IFuid name, GENinstance **kill) { - NUMD2model *model = (NUMD2model *) inModel; - NUMD2instance **fast = (NUMD2instance **) kill; - NUMD2instance **prev = NULL; - NUMD2instance *here; - - for (; model; model = model->NUMD2nextModel) { - prev = &(model->NUMD2instances); - for (here = *prev; here; here = *prev) { - if (here->NUMD2name == name || (fast && here == *fast)) { - *prev = here->NUMD2nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->NUMD2nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/numos/nummdel.c b/src/spicelib/devices/numos/nummdel.c index 740f98983..343cb314c 100644 --- a/src/spicelib/devices/numos/nummdel.c +++ b/src/spicelib/devices/numos/nummdel.c @@ -15,22 +15,18 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group int -NUMOSdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +NUMOSdelete(GENmodel *model, IFuid name, GENinstance **kill) { - NUMOSmodel *model = (NUMOSmodel *) inModel; - NUMOSinstance **fast = (NUMOSinstance **) kill; - NUMOSinstance **prev = NULL; - NUMOSinstance *here; - - for (; model; model = model->NUMOSnextModel) { - prev = &(model->NUMOSinstances); - for (here = *prev; here; here = *prev) { - if (here->NUMOSname == name || (fast && here == *fast)) { - *prev = here->NUMOSnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->NUMOSnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/res/resdel.c b/src/spicelib/devices/res/resdel.c index 06761fc0e..f466a8a02 100644 --- a/src/spicelib/devices/res/resdel.c +++ b/src/spicelib/devices/res/resdel.c @@ -10,22 +10,18 @@ Modified: Apr 2000 - Paolo Nenzi int -RESdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +RESdelete(GENmodel *model, IFuid name, GENinstance **kill) { - RESmodel *model = (RESmodel *) inModel; - RESinstance **fast = (RESinstance **) kill; - RESinstance **prev = NULL; - RESinstance *here; - - for (; model; model = model->RESnextModel) { - prev = &(model->RESinstances); - for (here = *prev; here; here = *prev) { - if (here->RESname == name || (fast && here == *fast)) { - *prev = here->RESnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->RESnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/soi3/soi3del.c b/src/spicelib/devices/soi3/soi3del.c index c0d4afdd0..af4d2ce88 100644 --- a/src/spicelib/devices/soi3/soi3del.c +++ b/src/spicelib/devices/soi3/soi3del.c @@ -27,22 +27,18 @@ Acknowledgements : Rupert Howes and Pete Mole. int -SOI3delete(GENmodel *inModel, IFuid name, GENinstance **kill) +SOI3delete(GENmodel *model, IFuid name, GENinstance **kill) { - SOI3model *model = (SOI3model *) inModel; - SOI3instance **fast = (SOI3instance **) kill; - SOI3instance **prev = NULL; - SOI3instance *here; - - for (; model; model = model->SOI3nextModel) { - prev = &(model->SOI3instances); - for (here = *prev; here; here = *prev) { - if (here->SOI3name == name || (fast && here == *fast)) { - *prev = here->SOI3nextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->SOI3nextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/sw/swdelete.c b/src/spicelib/devices/sw/swdelete.c index 62811e2bd..fd874ce81 100644 --- a/src/spicelib/devices/sw/swdelete.c +++ b/src/spicelib/devices/sw/swdelete.c @@ -10,22 +10,18 @@ Author: 1985 Gordon Jacobs int -SWdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +SWdelete(GENmodel *model, IFuid name, GENinstance **kill) { - SWmodel *model = (SWmodel *) inModel; - SWinstance **fast = (SWinstance **) kill; - SWinstance **prev = NULL; - SWinstance *here; - - for (; model; model = model->SWnextModel) { - prev = &(model->SWinstances); - for (here = *prev; here; here = *prev) { - if (here->SWname == name || (fast && here == *fast)) { - *prev = here->SWnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->SWnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/tra/tradel.c b/src/spicelib/devices/tra/tradel.c index c6bde6e35..4ca19180c 100644 --- a/src/spicelib/devices/tra/tradel.c +++ b/src/spicelib/devices/tra/tradel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -TRAdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +TRAdelete(GENmodel *model, IFuid name, GENinstance **kill) { - TRAinstance **fast = (TRAinstance **) kill; - TRAmodel *model = (TRAmodel *) inModel; - TRAinstance **prev = NULL; - TRAinstance *here; - - for (; model; model = model->TRAnextModel) { - prev = &(model->TRAinstances); - for (here = *prev; here; here = *prev) { - if (here->TRAname == name || (fast && here == *fast)) { - *prev = here->TRAnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->TRAnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/txl/txldel.c b/src/spicelib/devices/txl/txldel.c index 025a5d996..c6e7fb3e8 100644 --- a/src/spicelib/devices/txl/txldel.c +++ b/src/spicelib/devices/txl/txldel.c @@ -11,22 +11,18 @@ Author: 1992 Charles Hough int -TXLdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +TXLdelete(GENmodel *model, IFuid name, GENinstance **kill) { - TXLmodel *model = (TXLmodel *) inModel; - TXLinstance **fast = (TXLinstance **) kill; - TXLinstance **prev = NULL; - TXLinstance *here; - - for (; model; model = model->TXLnextModel) { - prev = &(model->TXLinstances); - for (here = *prev; here; here = *prev) { - if (here->TXLname == name || (fast && here == *fast)) { - *prev = here->TXLnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->TXLnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/urc/urcdel.c b/src/spicelib/devices/urc/urcdel.c index fbc15fef4..d0fa6a572 100644 --- a/src/spicelib/devices/urc/urcdel.c +++ b/src/spicelib/devices/urc/urcdel.c @@ -10,22 +10,18 @@ Author: 1987 Thomas L. Quarles int -URCdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +URCdelete(GENmodel *model, IFuid name, GENinstance **kill) { - URCmodel *model = (URCmodel *) inModel; - URCinstance **fast = (URCinstance **) kill; - URCinstance **prev = NULL; - URCinstance *here; - - for (; model; model = model->URCnextModel) { - prev = &(model->URCinstances); - for (here = *prev; here; here = *prev) { - if (here->URCname == name || (fast && here == *fast)) { - *prev = here->URCnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->URCnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/vbic/vbicdel.c b/src/spicelib/devices/vbic/vbicdel.c index aa2ec2485..a5123100a 100644 --- a/src/spicelib/devices/vbic/vbicdel.c +++ b/src/spicelib/devices/vbic/vbicdel.c @@ -17,22 +17,18 @@ Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH int -VBICdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +VBICdelete(GENmodel *model, IFuid name, GENinstance **kill) { - VBICmodel *model = (VBICmodel *) inModel; - VBICinstance **fast = (VBICinstance **) kill; - VBICinstance **prev = NULL; - VBICinstance *here; - - for (; model; model = model->VBICnextModel) { - prev = &(model->VBICinstances); - for (here = *prev; here; here = *prev) { - if (here->VBICname == name || (fast && here == *fast)) { - *prev = here->VBICnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->VBICnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/vccs/vccsdel.c b/src/spicelib/devices/vccs/vccsdel.c index 370379da0..1a7e94e6d 100644 --- a/src/spicelib/devices/vccs/vccsdel.c +++ b/src/spicelib/devices/vccs/vccsdel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -VCCSdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +VCCSdelete(GENmodel *model, IFuid name, GENinstance **kill) { - VCCSmodel *model = (VCCSmodel *) inModel; - VCCSinstance **fast = (VCCSinstance **) kill; - VCCSinstance **prev = NULL; - VCCSinstance *here; - - for (; model; model = model->VCCSnextModel) { - prev = &(model->VCCSinstances); - for (here = *prev; here; here = *prev) { - if (here->VCCSname == name || (fast && here == *fast)) { - *prev = here->VCCSnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->VCCSnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/vcvs/vcvsdel.c b/src/spicelib/devices/vcvs/vcvsdel.c index 0f9cf8927..1ce2fc137 100644 --- a/src/spicelib/devices/vcvs/vcvsdel.c +++ b/src/spicelib/devices/vcvs/vcvsdel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -VCVSdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +VCVSdelete(GENmodel *model, IFuid name, GENinstance **kill) { - VCVSmodel *model = (VCVSmodel *) inModel; - VCVSinstance **fast = (VCVSinstance **) kill; - VCVSinstance **prev = NULL; - VCVSinstance *here; - - for (; model; model = model->VCVSnextModel) { - prev = &(model->VCVSinstances); - for (here = *prev; here; here = *prev) { - if (here->VCVSname == name || (fast && here == *fast)) { - *prev = here->VCVSnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->VCVSnextInstance); + prev = &(here->GENnextInstance); } } diff --git a/src/spicelib/devices/vsrc/vsrcdel.c b/src/spicelib/devices/vsrc/vsrcdel.c index 796d9e2df..740a4628e 100644 --- a/src/spicelib/devices/vsrc/vsrcdel.c +++ b/src/spicelib/devices/vsrc/vsrcdel.c @@ -10,22 +10,18 @@ Author: 1985 Thomas L. Quarles int -VSRCdelete(GENmodel *inModel, IFuid name, GENinstance **kill) +VSRCdelete(GENmodel *model, IFuid name, GENinstance **kill) { - VSRCmodel *model = (VSRCmodel *) inModel; - VSRCinstance **fast = (VSRCinstance **) kill; - VSRCinstance **prev = NULL; - VSRCinstance *here; - - for (; model; model = model->VSRCnextModel) { - prev = &(model->VSRCinstances); - for (here = *prev; here; here = *prev) { - if (here->VSRCname == name || (fast && here == *fast)) { - *prev = here->VSRCnextInstance; + for (; model; model = model->GENnextModel) { + GENinstance **prev = &(model->GENinstances); + GENinstance *here = *prev; + for (; here; here = *prev) { + if (here->GENname == name || (kill && here == *kill)) { + *prev = here->GENnextInstance; FREE(here); return OK; } - prev = &(here->VSRCnextInstance); + prev = &(here->GENnextInstance); } }