From 982ba45bab8a762825d7a1230101e668307e6fca Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 7 Jan 2018 12:59:36 +0100 Subject: [PATCH] devices/**/XXXmdel.c, drop goto --- src/spicelib/devices/asrc/asrcmdel.c | 7 +++---- src/spicelib/devices/bjt/bjtmdel.c | 6 +++--- src/spicelib/devices/bsim1/b1mdel.c | 6 +++--- src/spicelib/devices/bsim2/b2mdel.c | 6 +++--- src/spicelib/devices/bsim3/b3mdel.c | 6 +++--- src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c | 6 +++--- src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c | 6 +++--- src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c | 6 +++--- src/spicelib/devices/bsim3v0/b3v0mdel.c | 6 +++--- src/spicelib/devices/bsim3v1/b3v1mdel.c | 6 +++--- src/spicelib/devices/bsim3v32/b3v32mdel.c | 6 +++--- src/spicelib/devices/bsim4/b4mdel.c | 6 +++--- src/spicelib/devices/bsim4v5/b4v5mdel.c | 6 +++--- src/spicelib/devices/bsim4v6/b4v6mdel.c | 6 +++--- src/spicelib/devices/bsim4v7/b4v7mdel.c | 6 +++--- src/spicelib/devices/bsimsoi/b4soimdel.c | 6 +++--- src/spicelib/devices/cap/capmdel.c | 6 +++--- src/spicelib/devices/cccs/cccsmdel.c | 6 +++--- src/spicelib/devices/ccvs/ccvsmdel.c | 6 +++--- src/spicelib/devices/cpl/cplmdel.c | 6 +++--- src/spicelib/devices/csw/cswmdel.c | 6 +++--- src/spicelib/devices/dio/diomdel.c | 6 +++--- src/spicelib/devices/hfet1/hfetmdel.c | 6 +++--- src/spicelib/devices/hfet2/hfet2mdel.c | 6 +++--- src/spicelib/devices/hisim2/hsm2mdel.c | 6 +++--- src/spicelib/devices/hisimhv1/hsmhvmdel.c | 6 +++--- src/spicelib/devices/hisimhv2/hsmhv2mdel.c | 6 +++--- src/spicelib/devices/ind/indmdel.c | 6 +++--- src/spicelib/devices/ind/mutmdel.c | 6 +++--- src/spicelib/devices/isrc/isrcmdel.c | 6 +++--- src/spicelib/devices/jfet/jfetmdel.c | 6 +++--- src/spicelib/devices/jfet2/jfet2mdel.c | 6 +++--- src/spicelib/devices/ltra/ltramdel.c | 6 +++--- src/spicelib/devices/mes/mesmdel.c | 6 +++--- src/spicelib/devices/mesa/mesamdel.c | 6 +++--- src/spicelib/devices/mos1/mos1mdel.c | 6 +++--- src/spicelib/devices/mos2/mos2mdel.c | 6 +++--- src/spicelib/devices/mos3/mos3mdel.c | 6 +++--- src/spicelib/devices/mos9/mos9mdel.c | 6 +++--- src/spicelib/devices/nbjt/nbjtmdel.c | 6 +++--- src/spicelib/devices/nbjt2/nbt2mdel.c | 6 +++--- src/spicelib/devices/numd/numdmdel.c | 6 +++--- src/spicelib/devices/numd2/nud2mdel.c | 6 +++--- src/spicelib/devices/numos/nummmdel.c | 6 +++--- src/spicelib/devices/res/resmdel.c | 6 +++--- src/spicelib/devices/soi3/soi3mdel.c | 6 +++--- src/spicelib/devices/sw/swmdel.c | 6 +++--- src/spicelib/devices/tra/tramdel.c | 6 +++--- src/spicelib/devices/txl/txlmdel.c | 6 +++--- src/spicelib/devices/urc/urcmdel.c | 6 +++--- src/spicelib/devices/vbic/vbicmdel.c | 6 +++--- src/spicelib/devices/vccs/vccsmdel.c | 6 +++--- src/spicelib/devices/vcvs/vcvsmdel.c | 6 +++--- src/spicelib/devices/vsrc/vsrcmdel.c | 6 +++--- 54 files changed, 162 insertions(+), 163 deletions(-) diff --git a/src/spicelib/devices/asrc/asrcmdel.c b/src/spicelib/devices/asrc/asrcmdel.c index 83c7d5752..ba77d59cb 100644 --- a/src/spicelib/devices/asrc/asrcmdel.c +++ b/src/spicelib/devices/asrc/asrcmdel.c @@ -18,13 +18,12 @@ ASRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; - - delgot: + if (!model) + return E_NOMOD; *prev = model->GENnextModel; diff --git a/src/spicelib/devices/bjt/bjtmdel.c b/src/spicelib/devices/bjt/bjtmdel.c index 66db748e5..89ff70cea 100644 --- a/src/spicelib/devices/bjt/bjtmdel.c +++ b/src/spicelib/devices/bjt/bjtmdel.c @@ -23,13 +23,13 @@ BJTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; diff --git a/src/spicelib/devices/bsim1/b1mdel.c b/src/spicelib/devices/bsim1/b1mdel.c index 7643c1511..7cd890290 100644 --- a/src/spicelib/devices/bsim1/b1mdel.c +++ b/src/spicelib/devices/bsim1/b1mdel.c @@ -18,13 +18,13 @@ B1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim2/b2mdel.c b/src/spicelib/devices/bsim2/b2mdel.c index 16b583859..9794ab403 100644 --- a/src/spicelib/devices/bsim2/b2mdel.c +++ b/src/spicelib/devices/bsim2/b2mdel.c @@ -18,13 +18,13 @@ B2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim3/b3mdel.c b/src/spicelib/devices/bsim3/b3mdel.c index 435da678a..677effac4 100644 --- a/src/spicelib/devices/bsim3/b3mdel.c +++ b/src/spicelib/devices/bsim3/b3mdel.c @@ -23,13 +23,13 @@ BSIM3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c index eb34eb570..267eaf892 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soiddmdel.c @@ -26,13 +26,13 @@ B3SOIDDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c index 7de9e748b..bb08533fb 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifdmdel.c @@ -25,13 +25,13 @@ B3SOIFDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c index fca9d1ced..40ac2d9ae 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipdmdel.c @@ -25,13 +25,13 @@ B3SOIPDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim3v0/b3v0mdel.c b/src/spicelib/devices/bsim3v0/b3v0mdel.c index 530329c0b..8e3f346e8 100644 --- a/src/spicelib/devices/bsim3v0/b3v0mdel.c +++ b/src/spicelib/devices/bsim3v0/b3v0mdel.c @@ -19,13 +19,13 @@ BSIM3v0mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim3v1/b3v1mdel.c b/src/spicelib/devices/bsim3v1/b3v1mdel.c index 43f20b7a0..55221840e 100644 --- a/src/spicelib/devices/bsim3v1/b3v1mdel.c +++ b/src/spicelib/devices/bsim3v1/b3v1mdel.c @@ -25,13 +25,13 @@ BSIM3v1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim3v32/b3v32mdel.c b/src/spicelib/devices/bsim3v32/b3v32mdel.c index 6c6a8708c..0025189fd 100644 --- a/src/spicelib/devices/bsim3v32/b3v32mdel.c +++ b/src/spicelib/devices/bsim3v32/b3v32mdel.c @@ -24,13 +24,13 @@ BSIM3v32mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim4/b4mdel.c b/src/spicelib/devices/bsim4/b4mdel.c index 0af48fc90..156088aca 100644 --- a/src/spicelib/devices/bsim4/b4mdel.c +++ b/src/spicelib/devices/bsim4/b4mdel.c @@ -73,13 +73,13 @@ BSIM4mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim4v5/b4v5mdel.c b/src/spicelib/devices/bsim4v5/b4v5mdel.c index 2b94591e2..ce1ad89b2 100644 --- a/src/spicelib/devices/bsim4v5/b4v5mdel.c +++ b/src/spicelib/devices/bsim4v5/b4v5mdel.c @@ -23,13 +23,13 @@ BSIM4v5mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim4v6/b4v6mdel.c b/src/spicelib/devices/bsim4v6/b4v6mdel.c index bcf860b96..3a69a9616 100644 --- a/src/spicelib/devices/bsim4v6/b4v6mdel.c +++ b/src/spicelib/devices/bsim4v6/b4v6mdel.c @@ -25,13 +25,13 @@ BSIM4v6mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsim4v7/b4v7mdel.c b/src/spicelib/devices/bsim4v7/b4v7mdel.c index 41029f608..8f1386aa1 100644 --- a/src/spicelib/devices/bsim4v7/b4v7mdel.c +++ b/src/spicelib/devices/bsim4v7/b4v7mdel.c @@ -25,13 +25,13 @@ BSIM4v7mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/bsimsoi/b4soimdel.c b/src/spicelib/devices/bsimsoi/b4soimdel.c index d391820de..30f8746b8 100644 --- a/src/spicelib/devices/bsimsoi/b4soimdel.c +++ b/src/spicelib/devices/bsimsoi/b4soimdel.c @@ -29,13 +29,13 @@ B4SOImDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/cap/capmdel.c b/src/spicelib/devices/cap/capmdel.c index d4cbb7689..3396307f5 100644 --- a/src/spicelib/devices/cap/capmdel.c +++ b/src/spicelib/devices/cap/capmdel.c @@ -19,13 +19,13 @@ CAPmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/cccs/cccsmdel.c b/src/spicelib/devices/cccs/cccsmdel.c index a07815097..5c9e85051 100644 --- a/src/spicelib/devices/cccs/cccsmdel.c +++ b/src/spicelib/devices/cccs/cccsmdel.c @@ -18,13 +18,13 @@ CCCSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/ccvs/ccvsmdel.c b/src/spicelib/devices/ccvs/ccvsmdel.c index f148141b1..0544403d4 100644 --- a/src/spicelib/devices/ccvs/ccvsmdel.c +++ b/src/spicelib/devices/ccvs/ccvsmdel.c @@ -18,13 +18,13 @@ CCVSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/cpl/cplmdel.c b/src/spicelib/devices/cpl/cplmdel.c index dc0d18bd9..264d36a5c 100644 --- a/src/spicelib/devices/cpl/cplmdel.c +++ b/src/spicelib/devices/cpl/cplmdel.c @@ -20,13 +20,13 @@ CPLmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/csw/cswmdel.c b/src/spicelib/devices/csw/cswmdel.c index e75326091..6173d5fe0 100644 --- a/src/spicelib/devices/csw/cswmdel.c +++ b/src/spicelib/devices/csw/cswmdel.c @@ -18,13 +18,13 @@ CSWmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/dio/diomdel.c b/src/spicelib/devices/dio/diomdel.c index 22972ee1a..7e376b9b1 100644 --- a/src/spicelib/devices/dio/diomdel.c +++ b/src/spicelib/devices/dio/diomdel.c @@ -18,13 +18,13 @@ DIOmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/hfet1/hfetmdel.c b/src/spicelib/devices/hfet1/hfetmdel.c index b70c495de..8131ef0e7 100644 --- a/src/spicelib/devices/hfet1/hfetmdel.c +++ b/src/spicelib/devices/hfet1/hfetmdel.c @@ -22,13 +22,13 @@ HFETAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/hfet2/hfet2mdel.c b/src/spicelib/devices/hfet2/hfet2mdel.c index 3a92493c2..57b9a0b87 100644 --- a/src/spicelib/devices/hfet2/hfet2mdel.c +++ b/src/spicelib/devices/hfet2/hfet2mdel.c @@ -22,13 +22,13 @@ HFET2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/hisim2/hsm2mdel.c b/src/spicelib/devices/hisim2/hsm2mdel.c index 3268cbfa4..eae5d772a 100644 --- a/src/spicelib/devices/hisim2/hsm2mdel.c +++ b/src/spicelib/devices/hisim2/hsm2mdel.c @@ -69,13 +69,13 @@ HSM2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/hisimhv1/hsmhvmdel.c b/src/spicelib/devices/hisimhv1/hsmhvmdel.c index f0d31e7be..088f5298f 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvmdel.c +++ b/src/spicelib/devices/hisimhv1/hsmhvmdel.c @@ -30,13 +30,13 @@ HSMHVmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c index 19400f334..f92131ce9 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2mdel.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2mdel.c @@ -72,13 +72,13 @@ HSMHV2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/ind/indmdel.c b/src/spicelib/devices/ind/indmdel.c index cffecd376..0bb698e21 100644 --- a/src/spicelib/devices/ind/indmdel.c +++ b/src/spicelib/devices/ind/indmdel.c @@ -18,13 +18,13 @@ INDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/ind/mutmdel.c b/src/spicelib/devices/ind/mutmdel.c index eceacb9f9..16ea6f4bd 100644 --- a/src/spicelib/devices/ind/mutmdel.c +++ b/src/spicelib/devices/ind/mutmdel.c @@ -19,13 +19,13 @@ MUTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/isrc/isrcmdel.c b/src/spicelib/devices/isrc/isrcmdel.c index cd1559a96..78b2c9de9 100644 --- a/src/spicelib/devices/isrc/isrcmdel.c +++ b/src/spicelib/devices/isrc/isrcmdel.c @@ -18,13 +18,13 @@ ISRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/jfet/jfetmdel.c b/src/spicelib/devices/jfet/jfetmdel.c index 2e257a6d8..e89c5de81 100644 --- a/src/spicelib/devices/jfet/jfetmdel.c +++ b/src/spicelib/devices/jfet/jfetmdel.c @@ -18,13 +18,13 @@ JFETmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/jfet2/jfet2mdel.c b/src/spicelib/devices/jfet2/jfet2mdel.c index 97a9baa6d..e96d45769 100644 --- a/src/spicelib/devices/jfet2/jfet2mdel.c +++ b/src/spicelib/devices/jfet2/jfet2mdel.c @@ -22,13 +22,13 @@ JFET2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/ltra/ltramdel.c b/src/spicelib/devices/ltra/ltramdel.c index 859e42609..f7d55089d 100644 --- a/src/spicelib/devices/ltra/ltramdel.c +++ b/src/spicelib/devices/ltra/ltramdel.c @@ -18,13 +18,13 @@ LTRAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/mes/mesmdel.c b/src/spicelib/devices/mes/mesmdel.c index 1d0291391..76578171a 100644 --- a/src/spicelib/devices/mes/mesmdel.c +++ b/src/spicelib/devices/mes/mesmdel.c @@ -18,13 +18,13 @@ MESmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/mesa/mesamdel.c b/src/spicelib/devices/mesa/mesamdel.c index a7e1ccf46..2231528be 100644 --- a/src/spicelib/devices/mesa/mesamdel.c +++ b/src/spicelib/devices/mesa/mesamdel.c @@ -22,13 +22,13 @@ MESAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/mos1/mos1mdel.c b/src/spicelib/devices/mos1/mos1mdel.c index 2eeabb473..c15061fdf 100644 --- a/src/spicelib/devices/mos1/mos1mdel.c +++ b/src/spicelib/devices/mos1/mos1mdel.c @@ -18,13 +18,13 @@ MOS1mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/mos2/mos2mdel.c b/src/spicelib/devices/mos2/mos2mdel.c index 0d984be86..f62af9857 100644 --- a/src/spicelib/devices/mos2/mos2mdel.c +++ b/src/spicelib/devices/mos2/mos2mdel.c @@ -18,13 +18,13 @@ MOS2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/mos3/mos3mdel.c b/src/spicelib/devices/mos3/mos3mdel.c index 182b07fff..fae010af4 100644 --- a/src/spicelib/devices/mos3/mos3mdel.c +++ b/src/spicelib/devices/mos3/mos3mdel.c @@ -18,13 +18,13 @@ MOS3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/mos9/mos9mdel.c b/src/spicelib/devices/mos9/mos9mdel.c index 2f88307b4..7f9bc46fc 100644 --- a/src/spicelib/devices/mos9/mos9mdel.c +++ b/src/spicelib/devices/mos9/mos9mdel.c @@ -19,13 +19,13 @@ MOS9mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/nbjt/nbjtmdel.c b/src/spicelib/devices/nbjt/nbjtmdel.c index 95318f2cc..29696e97f 100644 --- a/src/spicelib/devices/nbjt/nbjtmdel.c +++ b/src/spicelib/devices/nbjt/nbjtmdel.c @@ -22,13 +22,13 @@ NBJTmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; diff --git a/src/spicelib/devices/nbjt2/nbt2mdel.c b/src/spicelib/devices/nbjt2/nbt2mdel.c index 8dd9a9000..7b899fea5 100644 --- a/src/spicelib/devices/nbjt2/nbt2mdel.c +++ b/src/spicelib/devices/nbjt2/nbt2mdel.c @@ -22,13 +22,13 @@ NBJT2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; diff --git a/src/spicelib/devices/numd/numdmdel.c b/src/spicelib/devices/numd/numdmdel.c index 55198c462..2cb1cf537 100644 --- a/src/spicelib/devices/numd/numdmdel.c +++ b/src/spicelib/devices/numd/numdmdel.c @@ -18,13 +18,13 @@ NUMDmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/numd2/nud2mdel.c b/src/spicelib/devices/numd2/nud2mdel.c index 99f9ca044..b5dd133a7 100644 --- a/src/spicelib/devices/numd2/nud2mdel.c +++ b/src/spicelib/devices/numd2/nud2mdel.c @@ -18,13 +18,13 @@ NUMD2mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/numos/nummmdel.c b/src/spicelib/devices/numos/nummmdel.c index 95f9ea466..9d6aa84c4 100644 --- a/src/spicelib/devices/numos/nummmdel.c +++ b/src/spicelib/devices/numos/nummmdel.c @@ -22,13 +22,13 @@ NUMOSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; diff --git a/src/spicelib/devices/res/resmdel.c b/src/spicelib/devices/res/resmdel.c index 1c47d623b..044b2b44b 100644 --- a/src/spicelib/devices/res/resmdel.c +++ b/src/spicelib/devices/res/resmdel.c @@ -18,13 +18,13 @@ RESmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/soi3/soi3mdel.c b/src/spicelib/devices/soi3/soi3mdel.c index 22b31424e..53a07e648 100644 --- a/src/spicelib/devices/soi3/soi3mdel.c +++ b/src/spicelib/devices/soi3/soi3mdel.c @@ -35,13 +35,13 @@ SOI3mDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/sw/swmdel.c b/src/spicelib/devices/sw/swmdel.c index 903e98c8d..336b57033 100644 --- a/src/spicelib/devices/sw/swmdel.c +++ b/src/spicelib/devices/sw/swmdel.c @@ -18,13 +18,13 @@ SWmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/tra/tramdel.c b/src/spicelib/devices/tra/tramdel.c index 2473b0cfc..4a64458d5 100644 --- a/src/spicelib/devices/tra/tramdel.c +++ b/src/spicelib/devices/tra/tramdel.c @@ -18,13 +18,13 @@ TRAmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/txl/txlmdel.c b/src/spicelib/devices/txl/txlmdel.c index fb589cae5..66291f75c 100644 --- a/src/spicelib/devices/txl/txlmdel.c +++ b/src/spicelib/devices/txl/txlmdel.c @@ -19,13 +19,13 @@ TXLmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/urc/urcmdel.c b/src/spicelib/devices/urc/urcmdel.c index b97bdf28c..0950fd45a 100644 --- a/src/spicelib/devices/urc/urcmdel.c +++ b/src/spicelib/devices/urc/urcmdel.c @@ -18,13 +18,13 @@ URCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/vbic/vbicmdel.c b/src/spicelib/devices/vbic/vbicmdel.c index af690acfd..d676a03d7 100644 --- a/src/spicelib/devices/vbic/vbicmdel.c +++ b/src/spicelib/devices/vbic/vbicmdel.c @@ -25,13 +25,13 @@ VBICmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: if (model->GENinstances) return E_NOTEMPTY; *prev = model->GENnextModel; diff --git a/src/spicelib/devices/vccs/vccsmdel.c b/src/spicelib/devices/vccs/vccsmdel.c index 804830d65..727eed09b 100644 --- a/src/spicelib/devices/vccs/vccsmdel.c +++ b/src/spicelib/devices/vccs/vccsmdel.c @@ -18,13 +18,13 @@ VCCSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/vcvs/vcvsmdel.c b/src/spicelib/devices/vcvs/vcvsmdel.c index bfff0d194..65443d6ed 100644 --- a/src/spicelib/devices/vcvs/vcvsmdel.c +++ b/src/spicelib/devices/vcvs/vcvsmdel.c @@ -18,13 +18,13 @@ VCVSmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance; diff --git a/src/spicelib/devices/vsrc/vsrcmdel.c b/src/spicelib/devices/vsrc/vsrcmdel.c index ad2cd2af2..00cb4deff 100644 --- a/src/spicelib/devices/vsrc/vsrcmdel.c +++ b/src/spicelib/devices/vsrc/vsrcmdel.c @@ -18,13 +18,13 @@ VSRCmDelete(GENmodel **models, IFuid modname, GENmodel *kill) for (; model; model = model->GENnextModel) { if (model->GENmodName == modname || (kill && model == kill)) - goto delgot; + break; prev = &(model->GENnextModel); } - return E_NOMOD; + if (!model) + return E_NOMOD; - delgot: *prev = model->GENnextModel; for (here = model->GENinstances; here;) { GENinstance *next_instance = here->GENnextInstance;