diff --git a/src/spicelib/devices/asrc/asrcdel.c b/src/spicelib/devices/asrc/asrcdel.c index 13af4b5bc..4a7ce7f96 100644 --- a/src/spicelib/devices/asrc/asrcdel.c +++ b/src/spicelib/devices/asrc/asrcdel.c @@ -12,23 +12,22 @@ Author: 1987 Kanwar Jit Singh int ASRCdelete(GENmodel *model, IFuid name, GENinstance **fast) { - ASRCinstance **instPtr = (ASRCinstance**) fast; - ASRCmodel *modPtr = (ASRCmodel*) model; - + ASRCinstance **instPtr = (ASRCinstance **) fast; + ASRCmodel *modPtr = (ASRCmodel *) model; ASRCinstance **prev = NULL; ASRCinstance *here; - for (; modPtr ; modPtr = modPtr->ASRCnextModel) { + for (; modPtr; modPtr = modPtr->ASRCnextModel) { prev = &(modPtr->ASRCinstances); - for (here = *prev; here ; here = *prev) { + for (here = *prev; here; here = *prev) { if (here->ASRCname == name || (instPtr && here == *instPtr)) { *prev = here->ASRCnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->ASRCnextInstance); } } - return(E_NODEV); + return E_NODEV; } diff --git a/src/spicelib/devices/bjt/bjtdel.c b/src/spicelib/devices/bjt/bjtdel.c index 20a18407f..0ba7d5a90 100644 --- a/src/spicelib/devices/bjt/bjtdel.c +++ b/src/spicelib/devices/bjt/bjtdel.c @@ -16,24 +16,23 @@ Author: 1985 Thomas L. Quarles int BJTdelete(GENmodel *inModel, IFuid name, GENinstance **kill) - { - BJTmodel *model = (BJTmodel*)inModel; - BJTinstance **fast = (BJTinstance**)kill; - + BJTmodel *model = (BJTmodel *) inModel; + BJTinstance **fast = (BJTinstance **) kill; BJTinstance **prev = NULL; BJTinstance *here; - for( ; model ; model = model->BJTnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->BJTname == name || (fast && here == *fast)) { + *prev = here->BJTnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->BJTnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/bsim1/b1del.c b/src/spicelib/devices/bsim1/b1del.c index db401deb1..c40b153c0 100644 --- a/src/spicelib/devices/bsim1/b1del.c +++ b/src/spicelib/devices/bsim1/b1del.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Hong J. Park, Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "bsim1def.h" @@ -14,24 +12,23 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int B1delete(GENmodel *inModel, IFuid name, GENinstance **inInst) - { - - B1instance **fast = (B1instance**)inInst; - B1model *model = (B1model*)inModel; + B1instance **fast = (B1instance **) inInst; + B1model *model = (B1model *) inModel; B1instance **prev = NULL; B1instance *here; - for( ; model ; model = model->B1nextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->B1name == name || (fast && here == *fast)) { + *prev = here->B1nextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->B1nextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/bsim2/b2del.c b/src/spicelib/devices/bsim2/b2del.c index d4183d819..09d1e4f25 100644 --- a/src/spicelib/devices/bsim2/b2del.c +++ b/src/spicelib/devices/bsim2/b2del.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Hong J. Park, Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "bsim2def.h" @@ -15,22 +13,22 @@ Author: 1985 Hong J. Park, Thomas L. Quarles int B2delete(GENmodel *inModel, IFuid name, GENinstance **inInst) { - - B2instance **fast = (B2instance**)inInst; - B2model *model = (B2model*)inModel; + B2instance **fast = (B2instance **) inInst; + B2model *model = (B2model *) inModel; B2instance **prev = NULL; B2instance *here; - for( ; model ; model = model->B2nextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->B2name == name || (fast && here == *fast)) { + *prev = here->B2nextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->B2nextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/bsim3/b3del.c b/src/spicelib/devices/bsim3/b3del.c index 109df9621..4127b20b6 100644 --- a/src/spicelib/devices/bsim3/b3del.c +++ b/src/spicelib/devices/bsim3/b3del.c @@ -18,27 +18,26 @@ int BSIM3delete( -GENmodel *inModel, -IFuid name, -GENinstance **inInst) + GENmodel *inModel, + IFuid name, + GENinstance **inInst) { -BSIM3instance **fast = (BSIM3instance**)inInst; -BSIM3model *model = (BSIM3model*)inModel; -BSIM3instance **prev = NULL; -BSIM3instance *here; + BSIM3instance **fast = (BSIM3instance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->BSIM3nextInstance); - } + for (; model; model = model->BSIM3nextModel) { + prev = &(model->BSIM3instances); + for (here = *prev; here; here = *prev) { + if (here->BSIM3name == name || (fast && here == *fast)) { + *prev = here->BSIM3nextInstance; + FREE(here); + return OK; + } + prev = &(here->BSIM3nextInstance); + } } - return(E_NODEV); + + return E_NODEV; } - - diff --git a/src/spicelib/devices/bsim3soi_dd/b3soidddel.c b/src/spicelib/devices/bsim3soi_dd/b3soidddel.c index f9793d576..8876584f4 100644 --- a/src/spicelib/devices/bsim3soi_dd/b3soidddel.c +++ b/src/spicelib/devices/bsim3soi_dd/b3soidddel.c @@ -6,7 +6,7 @@ Modified by Paolo Nenzi 2002 **********/ /* - * Revision 2.1 99/9/27 Pin Su + * Revision 2.1 99/9/27 Pin Su * BSIMDD2.1 release */ @@ -20,23 +20,22 @@ Modified by Paolo Nenzi 2002 int B3SOIDDdelete(GENmodel *inModel, IFuid name, GENinstance **inInst) { -B3SOIDDinstance **fast = (B3SOIDDinstance**)inInst; -B3SOIDDmodel *model = (B3SOIDDmodel*)inModel; -B3SOIDDinstance **prev = NULL; -B3SOIDDinstance *here; + B3SOIDDinstance **fast = (B3SOIDDinstance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->B3SOIDDnextInstance); - } + for (; model; model = model->B3SOIDDnextModel) { + prev = &(model->B3SOIDDinstances); + for (here = *prev; here; here = *prev) { + if (here->B3SOIDDname == name || (fast && here == *fast)) { + *prev = here->B3SOIDDnextInstance; + FREE(here); + return OK; + } + prev = &(here->B3SOIDDnextInstance); + } } - return(E_NODEV); + + return E_NODEV; } - - diff --git a/src/spicelib/devices/bsim3soi_fd/b3soifddel.c b/src/spicelib/devices/bsim3soi_fd/b3soifddel.c index d7cf88912..bef9aff26 100644 --- a/src/spicelib/devices/bsim3soi_fd/b3soifddel.c +++ b/src/spicelib/devices/bsim3soi_fd/b3soifddel.c @@ -6,7 +6,7 @@ File: b3soifddel.c 98/5/01 **********/ /* - * Revision 2.1 99/9/27 Pin Su + * Revision 2.1 99/9/27 Pin Su * BSIMFD2.1 release */ @@ -20,23 +20,22 @@ File: b3soifddel.c 98/5/01 int B3SOIFDdelete(GENmodel *inModel, IFuid name, GENinstance **inInst) { -B3SOIFDinstance **fast = (B3SOIFDinstance**)inInst; -B3SOIFDmodel *model = (B3SOIFDmodel*)inModel; -B3SOIFDinstance **prev = NULL; -B3SOIFDinstance *here; + B3SOIFDinstance **fast = (B3SOIFDinstance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->B3SOIFDnextInstance); - } + for (; model; model = model->B3SOIFDnextModel) { + prev = &(model->B3SOIFDinstances); + for (here = *prev; here; here = *prev) { + if (here->B3SOIFDname == name || (fast && here == *fast)) { + *prev = here->B3SOIFDnextInstance; + FREE(here); + return OK; + } + prev = &(here->B3SOIFDnextInstance); + } } - return(E_NODEV); + + return E_NODEV; } - - diff --git a/src/spicelib/devices/bsim3soi_pd/b3soipddel.c b/src/spicelib/devices/bsim3soi_pd/b3soipddel.c index 32b92c400..77abda474 100644 --- a/src/spicelib/devices/bsim3soi_pd/b3soipddel.c +++ b/src/spicelib/devices/bsim3soi_pd/b3soipddel.c @@ -6,7 +6,7 @@ Modified by Paolo Nenzi 2002 **********/ /* - * Revision 2.2.3 02/3/5 Pin Su + * Revision 2.2.3 02/3/5 Pin Su * BSIMPD2.2.3 release */ @@ -20,23 +20,22 @@ Modified by Paolo Nenzi 2002 int B3SOIPDdelete(GENmodel *inModel, IFuid name, GENinstance **inInst) { -B3SOIPDinstance **fast = (B3SOIPDinstance**)inInst; -B3SOIPDmodel *model = (B3SOIPDmodel*)inModel; -B3SOIPDinstance **prev = NULL; -B3SOIPDinstance *here; + B3SOIPDinstance **fast = (B3SOIPDinstance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->B3SOIPDnextInstance); - } + for (; model; model = model->B3SOIPDnextModel) { + prev = &(model->B3SOIPDinstances); + for (here = *prev; here; here = *prev) { + if (here->B3SOIPDname == name || (fast && here == *fast)) { + *prev = here->B3SOIPDnextInstance; + FREE(here); + return OK; + } + prev = &(here->B3SOIPDnextInstance); + } } - return(E_NODEV); + + return E_NODEV; } - - diff --git a/src/spicelib/devices/bsim3v0/b3v0del.c b/src/spicelib/devices/bsim3v0/b3v0del.c index e7167fa8c..eb52aab2e 100644 --- a/src/spicelib/devices/bsim3v0/b3v0del.c +++ b/src/spicelib/devices/bsim3v0/b3v0del.c @@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1995 Min-Chie Jeng and Mansun Chan. File: b3v0del.c **********/ -/* - */ #include "ngspice/ngspice.h" #include "bsim3v0def.h" @@ -16,23 +14,22 @@ File: b3v0del.c int BSIM3v0delete(GENmodel *inModel, IFuid name, GENinstance **inInst) { -BSIM3v0instance **fast = (BSIM3v0instance**)inInst; -BSIM3v0model *model = (BSIM3v0model*)inModel; -BSIM3v0instance **prev = NULL; -BSIM3v0instance *here; + BSIM3v0instance **fast = (BSIM3v0instance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->BSIM3v0nextInstance); - } + for (; model; model = model->BSIM3v0nextModel) { + prev = &(model->BSIM3v0instances); + for (here = *prev; here; here = *prev) { + if (here->BSIM3v0name == name || (fast && here == *fast)) { + *prev = here->BSIM3v0nextInstance; + FREE(here); + return OK; + } + prev = &(here->BSIM3v0nextInstance); + } } - return(E_NODEV); + + return E_NODEV; } - - diff --git a/src/spicelib/devices/bsim3v1/b3v1del.c b/src/spicelib/devices/bsim3v1/b3v1del.c index b5ad544af..862bd4c3a 100644 --- a/src/spicelib/devices/bsim3v1/b3v1del.c +++ b/src/spicelib/devices/bsim3v1/b3v1del.c @@ -1,16 +1,15 @@ /********** * Copyright 1990 Regents of the University of California. All rights reserved. * File: b3v1del.c - * Author: 1995 Min-Chie Jeng and Mansun Chan. + * Author: 1995 Min-Chie Jeng and Mansun Chan. * Modified by Paolo Nenzi 2002 **********/ - -/* - * Release Notes: + +/* + * Release Notes: * BSIM3v3.1, Released by yuhua 96/12/08 */ - #include "ngspice/ngspice.h" #include "bsim3v1def.h" #include "ngspice/sperror.h" @@ -21,23 +20,22 @@ int BSIM3v1delete(GENmodel *inModel, IFuid name, GENinstance **inInst) { -BSIM3v1instance **fast = (BSIM3v1instance**)inInst; -BSIM3v1model *model = (BSIM3v1model*)inModel; -BSIM3v1instance **prev = NULL; -BSIM3v1instance *here; + BSIM3v1instance **fast = (BSIM3v1instance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->BSIM3v1nextInstance); - } + for (; model; model = model->BSIM3v1nextModel) { + prev = &(model->BSIM3v1instances); + for (here = *prev; here; here = *prev) { + if (here->BSIM3v1name == name || (fast && here == *fast)) { + *prev = here->BSIM3v1nextInstance; + FREE(here); + return OK; + } + prev = &(here->BSIM3v1nextInstance); + } } - return(E_NODEV); + + return E_NODEV; } - - diff --git a/src/spicelib/devices/bsim3v32/b3v32del.c b/src/spicelib/devices/bsim3v32/b3v32del.c index 6a1b80508..76427492d 100644 --- a/src/spicelib/devices/bsim3v32/b3v32del.c +++ b/src/spicelib/devices/bsim3v32/b3v32del.c @@ -18,23 +18,24 @@ int -BSIM3v32delete (GENmodel *inModel, IFuid name, GENinstance **inInst) +BSIM3v32delete(GENmodel *inModel, IFuid name, GENinstance **inInst) { -BSIM3v32instance **fast = (BSIM3v32instance**)inInst; -BSIM3v32model *model = (BSIM3v32model*)inModel; -BSIM3v32instance **prev = NULL; -BSIM3v32instance *here; + BSIM3v32instance **fast = (BSIM3v32instance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->BSIM3v32nextInstance); - } + for (; model; model = model->BSIM3v32nextModel) { + prev = &(model->BSIM3v32instances); + for (here = *prev; here; here = *prev) { + if (here->BSIM3v32name == name || (fast && here == *fast)) { + *prev = here->BSIM3v32nextInstance; + FREE(here); + return OK; + } + prev = &(here->BSIM3v32nextInstance); + } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/bsim4/b4del.c b/src/spicelib/devices/bsim4/b4del.c index 53a594341..6700ce023 100644 --- a/src/spicelib/devices/bsim4/b4del.c +++ b/src/spicelib/devices/bsim4/b4del.c @@ -67,25 +67,26 @@ int BSIM4delete( -GENmodel *inModel, -IFuid name, -GENinstance **inInst) + GENmodel *inModel, + IFuid name, + GENinstance **inInst) { -BSIM4instance **fast = (BSIM4instance**)inInst; -BSIM4model *model = (BSIM4model*)inModel; -BSIM4instance **prev = NULL; -BSIM4instance *here; + BSIM4instance **fast = (BSIM4instance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->BSIM4nextInstance); - } + for (; model; model = model->BSIM4nextModel) { + prev = &(model->BSIM4instances); + for (here = *prev; here; here = *prev) { + if (here->BSIM4name == name || (fast && here == *fast)) { + *prev = here->BSIM4nextInstance; + FREE(here); + return OK; + } + prev = &(here->BSIM4nextInstance); + } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/bsim4v5/b4v5del.c b/src/spicelib/devices/bsim4v5/b4v5del.c index 1143324d6..9b3311f74 100644 --- a/src/spicelib/devices/bsim4v5/b4v5del.c +++ b/src/spicelib/devices/bsim4v5/b4v5del.c @@ -17,25 +17,26 @@ int BSIM4v5delete( -GENmodel *inModel, -IFuid name, -GENinstance **inInst) + GENmodel *inModel, + IFuid name, + GENinstance **inInst) { -BSIM4v5instance **fast = (BSIM4v5instance**)inInst; -BSIM4v5model *model = (BSIM4v5model*)inModel; -BSIM4v5instance **prev = NULL; -BSIM4v5instance *here; + BSIM4v5instance **fast = (BSIM4v5instance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->BSIM4v5nextInstance); - } + for (; model; model = model->BSIM4v5nextModel) { + prev = &(model->BSIM4v5instances); + for (here = *prev; here; here = *prev) { + if (here->BSIM4v5name == name || (fast && here == *fast)) { + *prev = here->BSIM4v5nextInstance; + FREE(here); + return OK; + } + prev = &(here->BSIM4v5nextInstance); + } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/bsim4v6/b4v6del.c b/src/spicelib/devices/bsim4v6/b4v6del.c index d9bc48cea..56ad3830b 100644 --- a/src/spicelib/devices/bsim4v6/b4v6del.c +++ b/src/spicelib/devices/bsim4v6/b4v6del.c @@ -19,25 +19,26 @@ int BSIM4v6delete( -GENmodel *inModel, -IFuid name, -GENinstance **inInst) + GENmodel *inModel, + IFuid name, + GENinstance **inInst) { -BSIM4v6instance **fast = (BSIM4v6instance**)inInst; -BSIM4v6model *model = (BSIM4v6model*)inModel; -BSIM4v6instance **prev = NULL; -BSIM4v6instance *here; + BSIM4v6instance **fast = (BSIM4v6instance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->BSIM4v6nextInstance); - } + for (; model; model = model->BSIM4v6nextModel) { + prev = &(model->BSIM4v6instances); + for (here = *prev; here; here = *prev) { + if (here->BSIM4v6name == name || (fast && here == *fast)) { + *prev = here->BSIM4v6nextInstance; + FREE(here); + return OK; + } + prev = &(here->BSIM4v6nextInstance); + } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/bsim4v7/b4v7del.c b/src/spicelib/devices/bsim4v7/b4v7del.c index 2ab1b61d3..d4c1bcb12 100644 --- a/src/spicelib/devices/bsim4v7/b4v7del.c +++ b/src/spicelib/devices/bsim4v7/b4v7del.c @@ -19,25 +19,26 @@ int BSIM4v7delete( -GENmodel *inModel, -IFuid name, -GENinstance **inInst) + GENmodel *inModel, + IFuid name, + GENinstance **inInst) { -BSIM4v7instance **fast = (BSIM4v7instance**)inInst; -BSIM4v7model *model = (BSIM4v7model*)inModel; -BSIM4v7instance **prev = NULL; -BSIM4v7instance *here; + BSIM4v7instance **fast = (BSIM4v7instance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->BSIM4v7nextInstance); - } + for (; model; model = model->BSIM4v7nextModel) { + prev = &(model->BSIM4v7instances); + for (here = *prev; here; here = *prev) { + if (here->BSIM4v7name == name || (fast && here == *fast)) { + *prev = here->BSIM4v7nextInstance; + FREE(here); + return OK; + } + prev = &(here->BSIM4v7nextInstance); + } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/bsimsoi/b4soidel.c b/src/spicelib/devices/bsimsoi/b4soidel.c index cc8bf0fc9..dfef0e7f0 100644 --- a/src/spicelib/devices/bsimsoi/b4soidel.c +++ b/src/spicelib/devices/bsimsoi/b4soidel.c @@ -1,6 +1,5 @@ /*** B4SOI 12/16/2010 Released by Tanvir Morshed ***/ - /********** * Copyright 2010 Regents of the University of California. All rights reserved. * Authors: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang @@ -15,7 +14,6 @@ **********/ #include "ngspice/ngspice.h" - #include "b4soidef.h" #include "ngspice/sperror.h" #include "ngspice/gendefs.h" @@ -24,27 +22,26 @@ int B4SOIdelete( -GENmodel *inModel, -IFuid name, -GENinstance **inInst) + GENmodel *inModel, + IFuid name, + GENinstance **inInst) { -B4SOIinstance **fast = (B4SOIinstance**)inInst; -B4SOImodel *model = (B4SOImodel*)inModel; -B4SOIinstance **prev = NULL; -B4SOIinstance *here; + B4SOIinstance **fast = (B4SOIinstance **) inInst; + 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; - FREE(here); - return(OK); - } - prev = &(here->B4SOInextInstance); - } + for (; model; model = model->B4SOInextModel) { + prev = &(model->B4SOIinstances); + for (here = *prev; here; here = *prev) { + if (here->B4SOIname == name || (fast && here == *fast)) { + *prev = here->B4SOInextInstance; + FREE(here); + return OK; + } + prev = &(here->B4SOInextInstance); + } } - return(E_NODEV); + + return E_NODEV; } - - diff --git a/src/spicelib/devices/cap/capdel.c b/src/spicelib/devices/cap/capdel.c index 20d910518..5a3737fb4 100644 --- a/src/spicelib/devices/cap/capdel.c +++ b/src/spicelib/devices/cap/capdel.c @@ -1,10 +1,8 @@ /********** Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles -Modified: September 2003 Paolo Nenzi +Modified: September 2003 Paolo Nenzi **********/ -/* - */ #include "ngspice/ngspice.h" #include "capdefs.h" @@ -15,22 +13,22 @@ Modified: September 2003 Paolo Nenzi int CAPdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - - CAPinstance **fast = (CAPinstance**)inst; - CAPmodel *model = (CAPmodel*)inModel; + CAPinstance **fast = (CAPinstance **) inst; + CAPmodel *model = (CAPmodel *) inModel; CAPinstance **prev = NULL; CAPinstance *here; - for( ; model ; model = model->CAPnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->CAPname == name || (fast && here == *fast)) { + *prev = here->CAPnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->CAPnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/cccs/cccsdel.c b/src/spicelib/devices/cccs/cccsdel.c index f75173047..836fa0069 100644 --- a/src/spicelib/devices/cccs/cccsdel.c +++ b/src/spicelib/devices/cccs/cccsdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "cccsdefs.h" @@ -14,22 +12,22 @@ Author: 1985 Thomas L. Quarles int CCCSdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - - CCCSmodel *model = (CCCSmodel*)inModel; - CCCSinstance **fast = (CCCSinstance**)inst; + CCCSmodel *model = (CCCSmodel *) inModel; + CCCSinstance **fast = (CCCSinstance **) inst; CCCSinstance **prev = NULL; CCCSinstance *here; - for( ; model ; model = model->CCCSnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->CCCSname == name || (fast && here == *fast)) { + *prev = here->CCCSnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->CCCSnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/ccvs/ccvsdel.c b/src/spicelib/devices/ccvs/ccvsdel.c index f71794690..d5c318be0 100644 --- a/src/spicelib/devices/ccvs/ccvsdel.c +++ b/src/spicelib/devices/ccvs/ccvsdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "ccvsdefs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int CCVSdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { - CCVSmodel *model = (CCVSmodel*)inModel; - CCVSinstance **fast = (CCVSinstance**)kill; + CCVSmodel *model = (CCVSmodel *) inModel; + CCVSinstance **fast = (CCVSinstance **) kill; CCVSinstance **prev = NULL; CCVSinstance *here; - for( ; model ; model = model->CCVSnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->CCVSname == name || (fast && here == *fast)) { + *prev = here->CCVSnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->CCVSnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/cpl/cpldel.c b/src/spicelib/devices/cpl/cpldel.c index dd046cf7c..44685cf34 100644 --- a/src/spicelib/devices/cpl/cpldel.c +++ b/src/spicelib/devices/cpl/cpldel.c @@ -4,7 +4,6 @@ reserved. Author: 1992 Charles Hough **********/ - #include "ngspice/ngspice.h" #include "cpldefs.h" #include "ngspice/sperror.h" @@ -14,21 +13,22 @@ Author: 1992 Charles Hough int CPLdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - CPLmodel *model = (CPLmodel *)inModel; - CPLinstance **fast = (CPLinstance **)inst; + CPLmodel *model = (CPLmodel *) inModel; + CPLinstance **fast = (CPLinstance **) inst; CPLinstance **prev = NULL; CPLinstance *here; - for( ; model ; model = model->CPLnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->CPLname == name || (fast && here == *fast)) { + *prev = here->CPLnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->CPLnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/csw/cswdel.c b/src/spicelib/devices/csw/cswdel.c index 9041d0650..cbcb99651 100644 --- a/src/spicelib/devices/csw/cswdel.c +++ b/src/spicelib/devices/csw/cswdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "cswdefs.h" @@ -13,23 +11,23 @@ Author: 1985 Gordon Jacobs int CSWdelete(GENmodel *inModel, IFuid name, GENinstance **inst) - { - CSWmodel *model = (CSWmodel*)inModel; - CSWinstance **fast = (CSWinstance**)inst; + CSWmodel *model = (CSWmodel *) inModel; + CSWinstance **fast = (CSWinstance **) inst; CSWinstance **prev = NULL; CSWinstance *here; - for( ; model ; model = model->CSWnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->CSWname == name || (fast && here == *fast)) { + *prev = here->CSWnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->CSWnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/dio/diodel.c b/src/spicelib/devices/dio/diodel.c index 1d834dd81..9d2c30b7f 100644 --- a/src/spicelib/devices/dio/diodel.c +++ b/src/spicelib/devices/dio/diodel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "diodefs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int DIOdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { - DIOmodel *model = (DIOmodel*)inModel; - DIOinstance **fast = (DIOinstance**)kill; + DIOmodel *model = (DIOmodel *) inModel; + DIOinstance **fast = (DIOinstance **) kill; DIOinstance **prev = NULL; DIOinstance *here; - for( ; model ; model = model->DIOnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->DIOname == name || (fast && here == *fast)) { + *prev = here->DIOnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->DIOnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/hfet1/hfetdel.c b/src/spicelib/devices/hfet1/hfetdel.c index d7308ed9c..783599fd4 100644 --- a/src/spicelib/devices/hfet1/hfetdel.c +++ b/src/spicelib/devices/hfet1/hfetdel.c @@ -2,9 +2,10 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 S. Hwang **********/ + /* -Imported into hfeta model: Paolo Nenzi 2001 -*/ + Imported into hfeta model: Paolo Nenzi 2001 +*/ #include "ngspice/ngspice.h" #include "hfetdefs.h" @@ -15,21 +16,22 @@ Imported into hfeta model: Paolo Nenzi 2001 int HFETAdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - HFETAmodel *model = (HFETAmodel*)inModel; - HFETAinstance **fast = (HFETAinstance**)inst; + HFETAmodel *model = (HFETAmodel *) inModel; + HFETAinstance **fast = (HFETAinstance **) inst; HFETAinstance **prev = NULL; HFETAinstance *here; - for( ; model ; model = model->HFETAnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->HFETAname == name || (fast && here == *fast)) { + *prev = here->HFETAnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->HFETAnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/hfet2/hfet2del.c b/src/spicelib/devices/hfet2/hfet2del.c index f233da75f..33be50267 100644 --- a/src/spicelib/devices/hfet2/hfet2del.c +++ b/src/spicelib/devices/hfet2/hfet2del.c @@ -2,9 +2,10 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 S. Hwang **********/ + /* -Imported into hfet2 model: Paolo Nenzi 2001 -*/ + Imported into hfet2 model: Paolo Nenzi 2001 +*/ #include "ngspice/ngspice.h" #include "hfet2defs.h" @@ -15,21 +16,22 @@ Imported into hfet2 model: Paolo Nenzi 2001 int HFET2delete(GENmodel *inModel, IFuid name, GENinstance **inst) { - HFET2model *model = (HFET2model*)inModel; - HFET2instance **fast = (HFET2instance**)inst; + HFET2model *model = (HFET2model *) inModel; + HFET2instance **fast = (HFET2instance **) inst; HFET2instance **prev = NULL; HFET2instance *here; - for( ; model ; model = model->HFET2nextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->HFET2name == name || (fast && here == *fast)) { + *prev = here->HFET2nextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->HFET2nextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/hisim2/hsm2del.c b/src/spicelib/devices/hisim2/hsm2del.c index 27678a0d4..38349b563 100644 --- a/src/spicelib/devices/hisim2/hsm2del.c +++ b/src/spicelib/devices/hisim2/hsm2del.c @@ -5,12 +5,12 @@ MODEL NAME : HiSIM ( VERSION : 2 SUBVERSION : 8 REVISION : 0 ) - + FILE : hsm2del.c Date : 2014.6.5 - released by + released by Hiroshima University & Semiconductor Technology Academic Research Center (STARC) ***********************************************************************/ @@ -31,8 +31,8 @@ support. Hiroshima University or STARC and its employees are not liable for the condition or performance of the software. Hiroshima University and STARC own the copyright and grant users a perpetual, -irrevocable, worldwide, non-exclusive, royalty-free license with respect -to the software as set forth below. +irrevocable, worldwide, non-exclusive, royalty-free license with respect +to the software as set forth below. Hiroshima University and STARC hereby disclaim all implied warranties. @@ -60,26 +60,28 @@ to others." #include "ngspice/gendefs.h" #include "ngspice/suffix.h" -int HSM2delete( - GENmodel *inModel, - IFuid name, - GENinstance **inInst) -{ - HSM2instance **fast = (HSM2instance**)inInst; - 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; - FREE(here); - return(OK); - } - prev = &(here->HSM2nextInstance); +int HSM2delete( + GENmodel *inModel, + IFuid name, + GENinstance **inInst) +{ + HSM2instance **fast = (HSM2instance **) inInst; + 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; + FREE(here); + return OK; + } + prev = &(here->HSM2nextInstance); + } } - } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/hisimhv1/hsmhvdel.c b/src/spicelib/devices/hisimhv1/hsmhvdel.c index 8e838fc58..84d19099f 100644 --- a/src/spicelib/devices/hisimhv1/hsmhvdel.c +++ b/src/spicelib/devices/hisimhv1/hsmhvdel.c @@ -3,14 +3,14 @@ HiSIM (Hiroshima University STARC IGFET Model) Copyright (C) 2012 Hiroshima University & STARC - MODEL NAME : HiSIM_HV + MODEL NAME : HiSIM_HV ( VERSION : 1 SUBVERSION : 2 REVISION : 4 ) Model Parameter VERSION : 1.23 FILE : hsmhvdel.c DATE : 2013.04.30 - released by + released by Hiroshima University & Semiconductor Technology Academic Research Center (STARC) ***********************************************************************/ @@ -21,26 +21,28 @@ #include "ngspice/gendefs.h" #include "ngspice/suffix.h" -int HSMHVdelete( - GENmodel *inModel, - IFuid name, - GENinstance **inInst) -{ - HSMHVinstance **fast = (HSMHVinstance**)inInst; - 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; - FREE(here); - return(OK); - } - prev = &(here->HSMHVnextInstance); +int HSMHVdelete( + GENmodel *inModel, + IFuid name, + GENinstance **inInst) +{ + HSMHVinstance **fast = (HSMHVinstance **) inInst; + 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; + FREE(here); + return OK; + } + prev = &(here->HSMHVnextInstance); + } } - } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/hisimhv2/hsmhv2del.c b/src/spicelib/devices/hisimhv2/hsmhv2del.c index 1f6486713..7283bc49f 100644 --- a/src/spicelib/devices/hisimhv2/hsmhv2del.c +++ b/src/spicelib/devices/hisimhv2/hsmhv2del.c @@ -3,14 +3,14 @@ HiSIM (Hiroshima University STARC IGFET Model) Copyright (C) 2014 Hiroshima University & STARC - MODEL NAME : HiSIM_HV - ( VERSION : 2 SUBVERSION : 2 REVISION : 0 ) + MODEL NAME : HiSIM_HV + ( VERSION : 2 SUBVERSION : 2 REVISION : 0 ) Model Parameter 'VERSION' : 2.20 FILE : hsmhvdel.c DATE : 2014.6.11 - released by + released by Hiroshima University & Semiconductor Technology Academic Research Center (STARC) ***********************************************************************/ @@ -31,8 +31,8 @@ support. Hiroshima University or STARC and its employees are not liable for the condition or performance of the software. Hiroshima University and STARC own the copyright and grant users a perpetual, -irrevocable, worldwide, non-exclusive, royalty-free license with respect -to the software as set forth below. +irrevocable, worldwide, non-exclusive, royalty-free license with respect +to the software as set forth below. Hiroshima University and STARC hereby disclaims all implied warranties. @@ -54,7 +54,7 @@ to others." Toshimasa Asahara, President, Hiroshima University Mitiko Miura-Mattausch, Professor, Hiroshima University Katsuhiro Shimohigashi, President&CEO, STARC -June 2008 (revised October 2011) +June 2008 (revised October 2011) *************************************************************************/ #include "ngspice/ngspice.h" @@ -63,26 +63,28 @@ June 2008 (revised October 2011) #include "ngspice/gendefs.h" #include "ngspice/suffix.h" -int HSMHV2delete( - GENmodel *inModel, - IFuid name, - GENinstance **inInst) -{ - HSMHV2instance **fast = (HSMHV2instance**)inInst; - 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; - FREE(here); - return(OK); - } - prev = &(here->HSMHV2nextInstance); +int HSMHV2delete( + GENmodel *inModel, + IFuid name, + GENinstance **inInst) +{ + HSMHV2instance **fast = (HSMHV2instance **) inInst; + 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; + FREE(here); + return OK; + } + prev = &(here->HSMHV2nextInstance); + } } - } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/ind/inddel.c b/src/spicelib/devices/ind/inddel.c index dd8454fc6..836968ae0 100644 --- a/src/spicelib/devices/ind/inddel.c +++ b/src/spicelib/devices/ind/inddel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "inddefs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int INDdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { - INDmodel *model = (INDmodel*)inModel; - INDinstance **fast = (INDinstance**)kill; + INDmodel *model = (INDmodel *) inModel; + INDinstance **fast = (INDinstance **) kill; INDinstance **prev = NULL; INDinstance *here; - for( ; model ; model = model->INDnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->INDname == name || (fast && here == *fast)) { + *prev = here->INDnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->INDnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/ind/mutdel.c b/src/spicelib/devices/ind/mutdel.c index 361287800..06d78ae38 100644 --- a/src/spicelib/devices/ind/mutdel.c +++ b/src/spicelib/devices/ind/mutdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "inddefs.h" @@ -15,22 +13,23 @@ Author: 1985 Thomas L. Quarles int MUTdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { - MUTmodel *model = (MUTmodel*)inModel; - MUTinstance **fast = (MUTinstance**)kill; + MUTmodel *model = (MUTmodel *) inModel; + MUTinstance **fast = (MUTinstance **) kill; MUTinstance **prev = NULL; MUTinstance *here; - for( ; model ; model = model->MUTnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->MUTname == name || (fast && here == *fast)) { + *prev = here->MUTnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->MUTnextInstance); } } - return(E_NODEV); + + return E_NODEV; } #endif /*MUTUAL*/ diff --git a/src/spicelib/devices/isrc/isrcdel.c b/src/spicelib/devices/isrc/isrcdel.c index ba535cec6..bdcb6ee97 100644 --- a/src/spicelib/devices/isrc/isrcdel.c +++ b/src/spicelib/devices/isrc/isrcdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "isrcdefs.h" @@ -19,16 +17,17 @@ ISRCdelete(GENmodel *inModel, IFuid name, GENinstance **inst) ISRCinstance **prev = NULL; ISRCinstance *here; - for( ; model ; model = model->ISRCnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->ISRCname == name || (fast && here == *fast)) { + *prev = here->ISRCnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->ISRCnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/jfet/jfetdel.c b/src/spicelib/devices/jfet/jfetdel.c index f583dc66e..9d4d6d9c0 100644 --- a/src/spicelib/devices/jfet/jfetdel.c +++ b/src/spicelib/devices/jfet/jfetdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "jfetdefs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int JFETdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - JFETmodel *model = (JFETmodel*)inModel; - JFETinstance **fast = (JFETinstance**)inst; + JFETmodel *model = (JFETmodel *) inModel; + JFETinstance **fast = (JFETinstance **) inst; JFETinstance **prev = NULL; JFETinstance *here; - for( ; model ; model = model->JFETnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->JFETname == name || (fast && here == *fast)) { + *prev = here->JFETnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->JFETnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/jfet2/jfet2del.c b/src/spicelib/devices/jfet2/jfet2del.c index a4520e5f0..b2a8da4a5 100644 --- a/src/spicelib/devices/jfet2/jfet2del.c +++ b/src/spicelib/devices/jfet2/jfet2del.c @@ -16,21 +16,22 @@ Modified to jfet2 for PS model definition ( Anthony E. Parker ) int JFET2delete(GENmodel *inModel, IFuid name, GENinstance **inst) { - JFET2model *model = (JFET2model*)inModel; - JFET2instance **fast = (JFET2instance**)inst; + JFET2model *model = (JFET2model *) inModel; + JFET2instance **fast = (JFET2instance **) inst; JFET2instance **prev = NULL; JFET2instance *here; - for( ; model ; model = model->JFET2nextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->JFET2name == name || (fast && here == *fast)) { + *prev = here->JFET2nextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->JFET2nextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/ltra/ltradel.c b/src/spicelib/devices/ltra/ltradel.c index 80d79648e..f5ea489bf 100644 --- a/src/spicelib/devices/ltra/ltradel.c +++ b/src/spicelib/devices/ltra/ltradel.c @@ -8,24 +8,26 @@ Author: 1990 Jaijeet S. Roychowdhury #include "ngspice/sperror.h" #include "ngspice/suffix.h" + int LTRAdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { - LTRAinstance **fast = (LTRAinstance **) kill; - LTRAmodel *model = (LTRAmodel *) inModel; - LTRAinstance **prev = NULL; - LTRAinstance *here; + 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; - FREE(here); - return (OK); - } - prev = &(here->LTRAnextInstance); + for (; model; model = model->LTRAnextModel) { + prev = &(model->LTRAinstances); + for (here = *prev; here; here = *prev) { + if (here->LTRAname == name || (fast && here == *fast)) { + *prev = here->LTRAnextInstance; + FREE(here); + return OK; + } + prev = &(here->LTRAnextInstance); + } } - } - return (E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/mes/mesdel.c b/src/spicelib/devices/mes/mesdel.c index cc46a89f0..ad4c0a031 100644 --- a/src/spicelib/devices/mes/mesdel.c +++ b/src/spicelib/devices/mes/mesdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 S. Hwang **********/ -/* - */ #include "ngspice/ngspice.h" #include "mesdefs.h" @@ -14,21 +12,22 @@ Author: 1985 S. Hwang int MESdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - MESmodel *model = (MESmodel*)inModel; - MESinstance **fast = (MESinstance**)inst; + MESmodel *model = (MESmodel *) inModel; + MESinstance **fast = (MESinstance **) inst; MESinstance **prev = NULL; MESinstance *here; - for( ; model ; model = model->MESnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->MESname == name || (fast && here == *fast)) { + *prev = here->MESnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->MESnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/mesa/mesadel.c b/src/spicelib/devices/mesa/mesadel.c index b6f9dae51..9347f0c44 100644 --- a/src/spicelib/devices/mesa/mesadel.c +++ b/src/spicelib/devices/mesa/mesadel.c @@ -2,9 +2,10 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 S. Hwang **********/ + /* -Imported into mesa model: 2001 Paolo Nenzi - */ + Imported into mesa model: 2001 Paolo Nenzi +*/ #include "ngspice/ngspice.h" #include "mesadefs.h" @@ -15,21 +16,22 @@ Imported into mesa model: 2001 Paolo Nenzi int MESAdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - MESAmodel *model = (MESAmodel*)inModel; - MESAinstance **fast = (MESAinstance**)inst; + MESAmodel *model = (MESAmodel *) inModel; + MESAinstance **fast = (MESAinstance **) inst; MESAinstance **prev = NULL; MESAinstance *here; - for( ; model ; model = model->MESAnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->MESAname == name || (fast && here == *fast)) { + *prev = here->MESAnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->MESAnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/mos1/mos1del.c b/src/spicelib/devices/mos1/mos1del.c index fb100d92c..5fb32a7a9 100644 --- a/src/spicelib/devices/mos1/mos1del.c +++ b/src/spicelib/devices/mos1/mos1del.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "mos1defs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int MOS1delete(GENmodel *inModel, IFuid name, GENinstance **inst) { - MOS1model *model = (MOS1model *)inModel; - MOS1instance **fast = (MOS1instance **)inst; + MOS1model *model = (MOS1model *) inModel; + MOS1instance **fast = (MOS1instance **) inst; MOS1instance **prev = NULL; MOS1instance *here; - for( ; model ; model = model->MOS1nextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->MOS1name == name || (fast && here == *fast)) { + *prev = here->MOS1nextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->MOS1nextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/mos2/mos2del.c b/src/spicelib/devices/mos2/mos2del.c index 627297129..2cc2d446c 100644 --- a/src/spicelib/devices/mos2/mos2del.c +++ b/src/spicelib/devices/mos2/mos2del.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "mos2defs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int MOS2delete(GENmodel *inModel, IFuid name, GENinstance **inst) { - MOS2model *model = (MOS2model *)inModel; - MOS2instance **fast = (MOS2instance **)inst; + MOS2model *model = (MOS2model *) inModel; + MOS2instance **fast = (MOS2instance **) inst; MOS2instance **prev = NULL; MOS2instance *here; - for( ; model ; model = model->MOS2nextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->MOS2name == name || (fast && here == *fast)) { + *prev = here->MOS2nextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->MOS2nextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/mos3/mos3del.c b/src/spicelib/devices/mos3/mos3del.c index 5a3857175..dc2573b1b 100644 --- a/src/spicelib/devices/mos3/mos3del.c +++ b/src/spicelib/devices/mos3/mos3del.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "mos3defs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int MOS3delete(GENmodel *inModel, IFuid name, GENinstance **inst) { - MOS3model *model = (MOS3model *)inModel; - MOS3instance **fast = (MOS3instance **)inst; + MOS3model *model = (MOS3model *) inModel; + MOS3instance **fast = (MOS3instance **) inst; MOS3instance **prev = NULL; MOS3instance *here; - for( ; model ; model = model->MOS3nextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->MOS3name == name || (fast && here == *fast)) { + *prev = here->MOS3nextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->MOS3nextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/mos9/mos9del.c b/src/spicelib/devices/mos9/mos9del.c index a0b27790e..f8ab7798b 100644 --- a/src/spicelib/devices/mos9/mos9del.c +++ b/src/spicelib/devices/mos9/mos9del.c @@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles Modified: Alan Gillespie **********/ -/* - */ #include "ngspice/ngspice.h" #include "mos9defs.h" @@ -15,21 +13,22 @@ Modified: Alan Gillespie int MOS9delete(GENmodel *inModel, IFuid name, GENinstance **inst) { - MOS9model *model = (MOS9model *)inModel; - MOS9instance **fast = (MOS9instance **)inst; + MOS9model *model = (MOS9model *) inModel; + MOS9instance **fast = (MOS9instance **) inst; MOS9instance **prev = NULL; MOS9instance *here; - for( ; model ; model = model->MOS9nextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->MOS9name == name || (fast && here == *fast)) { + *prev = here->MOS9nextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->MOS9nextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/nbjt/nbjtdel.c b/src/spicelib/devices/nbjt/nbjtdel.c index cde3b11e3..c81e39744 100644 --- a/src/spicelib/devices/nbjt/nbjtdel.c +++ b/src/spicelib/devices/nbjt/nbjtdel.c @@ -1,6 +1,6 @@ /********** Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group +Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group **********/ /* @@ -13,24 +13,26 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group #include "ngspice/sperror.h" #include "ngspice/suffix.h" + int NBJTdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { - NBJTmodel *model = (NBJTmodel *) inModel; - NBJTinstance **fast = (NBJTinstance **) kill; - NBJTinstance **prev = NULL; - NBJTinstance *inst; + NBJTmodel *model = (NBJTmodel *) inModel; + NBJTinstance **fast = (NBJTinstance **) kill; + NBJTinstance **prev = NULL; + NBJTinstance *inst; - for (; model; model = model->NBJTnextModel) { - prev = &(model->NBJTinstances); - for (inst = *prev; inst; inst = *prev) { - if (inst->NBJTname == name || (fast && inst == *fast)) { - *prev = inst->NBJTnextInstance; - FREE(inst); - return (OK); - } - prev = &(inst->NBJTnextInstance); + for (; model; model = model->NBJTnextModel) { + prev = &(model->NBJTinstances); + for (inst = *prev; inst; inst = *prev) { + if (inst->NBJTname == name || (fast && inst == *fast)) { + *prev = inst->NBJTnextInstance; + FREE(inst); + return OK; + } + prev = &(inst->NBJTnextInstance); + } } - } - return (E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/nbjt2/nbt2del.c b/src/spicelib/devices/nbjt2/nbt2del.c index 6728dd5b6..7e36d3072 100644 --- a/src/spicelib/devices/nbjt2/nbt2del.c +++ b/src/spicelib/devices/nbjt2/nbt2del.c @@ -1,6 +1,6 @@ /********** Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group +Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group **********/ /* @@ -13,25 +13,26 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group #include "ngspice/sperror.h" #include "ngspice/suffix.h" + int NBJT2delete(GENmodel *inModel, IFuid name, GENinstance **kill) { + NBJT2model *model = (NBJT2model *) inModel; + NBJT2instance **fast = (NBJT2instance **) kill; + NBJT2instance **prev = NULL; + NBJT2instance *inst; - NBJT2model *model = (NBJT2model *) inModel; - NBJT2instance **fast = (NBJT2instance **) kill; - NBJT2instance **prev = NULL; - NBJT2instance *inst; - - for (; model; model = model->NBJT2nextModel) { - prev = &(model->NBJT2instances); - for (inst = *prev; inst; inst = *prev) { - if (inst->NBJT2name == name || (fast && inst == *fast)) { - *prev = inst->NBJT2nextInstance; - FREE(inst); - return (OK); - } - prev = &(inst->NBJT2nextInstance); + for (; model; model = model->NBJT2nextModel) { + prev = &(model->NBJT2instances); + for (inst = *prev; inst; inst = *prev) { + if (inst->NBJT2name == name || (fast && inst == *fast)) { + *prev = inst->NBJT2nextInstance; + FREE(inst); + return OK; + } + prev = &(inst->NBJT2nextInstance); + } } - } - return (E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/ndev/ndevdel.c b/src/spicelib/devices/ndev/ndevdel.c index cd0e6dd4e..c1d4c25c1 100644 --- a/src/spicelib/devices/ndev/ndevdel.c +++ b/src/spicelib/devices/ndev/ndevdel.c @@ -1,7 +1,7 @@ /********** Permit to use it as your wish. -Author: 2007 Gong Ding, gdiso@ustc.edu -University of Science and Technology of China +Author: 2007 Gong Ding, gdiso@ustc.edu +University of Science and Technology of China **********/ #include "ngspice/ngspice.h" @@ -9,29 +9,30 @@ University of Science and Technology of China #include "ngspice/sperror.h" #include "ngspice/suffix.h" + int NDEVdelete( - GENmodel *inModel, - IFuid name, - GENinstance **kill ) + GENmodel *inModel, + IFuid name, + GENinstance **kill) { - NDEVmodel *model = (NDEVmodel *)inModel; - NDEVinstance **fast = (NDEVinstance **)kill; + NDEVmodel *model = (NDEVmodel *) inModel; + NDEVinstance **fast = (NDEVinstance **) kill; NDEVinstance **prev = NULL; NDEVinstance *here; - for( ; model ; model = model->NDEVnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->NDEVname == name || (fast && here == *fast)) { + *prev = here->NDEVnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->NDEVnextInstance); } } - - return (E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/numd/numddel.c b/src/spicelib/devices/numd/numddel.c index 8a045a67c..37d0ae78d 100644 --- a/src/spicelib/devices/numd/numddel.c +++ b/src/spicelib/devices/numd/numddel.c @@ -1,6 +1,6 @@ /********** Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group +Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group **********/ #include "ngspice/ngspice.h" @@ -8,25 +8,26 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group #include "ngspice/sperror.h" #include "ngspice/suffix.h" + int NUMDdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { + NUMDmodel *model = (NUMDmodel *) inModel; + NUMDinstance **fast = (NUMDinstance **) kill; + NUMDinstance **prev = NULL; + NUMDinstance *inst; - NUMDmodel *model = (NUMDmodel *) inModel; - NUMDinstance **fast = (NUMDinstance **) kill; - NUMDinstance **prev = NULL; - NUMDinstance *inst; - - for (; model; model = model->NUMDnextModel) { - prev = &(model->NUMDinstances); - for (inst = *prev; inst; inst = *prev) { - if (inst->NUMDname == name || (fast && inst == *fast)) { - *prev = inst->NUMDnextInstance; - FREE(inst); - return (OK); - } - prev = &(inst->NUMDnextInstance); + for (; model; model = model->NUMDnextModel) { + prev = &(model->NUMDinstances); + for (inst = *prev; inst; inst = *prev) { + if (inst->NUMDname == name || (fast && inst == *fast)) { + *prev = inst->NUMDnextInstance; + FREE(inst); + return OK; + } + prev = &(inst->NUMDnextInstance); + } } - } - return (E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/numd2/nud2del.c b/src/spicelib/devices/numd2/nud2del.c index e1fa42fec..379015dc5 100644 --- a/src/spicelib/devices/numd2/nud2del.c +++ b/src/spicelib/devices/numd2/nud2del.c @@ -1,6 +1,6 @@ /********** Copyright 1992 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group +Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group **********/ #include "ngspice/ngspice.h" @@ -8,24 +8,26 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group #include "ngspice/sperror.h" #include "ngspice/suffix.h" + int NUMD2delete(GENmodel *inModel, IFuid name, GENinstance **kill) { - NUMD2model *model = (NUMD2model *) inModel; - NUMD2instance **fast = (NUMD2instance **) kill; - NUMD2instance **prev = NULL; - NUMD2instance *inst; + NUMD2model *model = (NUMD2model *) inModel; + NUMD2instance **fast = (NUMD2instance **) kill; + NUMD2instance **prev = NULL; + NUMD2instance *inst; - for (; model; model = model->NUMD2nextModel) { - prev = &(model->NUMD2instances); - for (inst = *prev; inst; inst = *prev) { - if (inst->NUMD2name == name || (fast && inst == *fast)) { - *prev = inst->NUMD2nextInstance; - FREE(inst); - return (OK); - } - prev = &(inst->NUMD2nextInstance); + for (; model; model = model->NUMD2nextModel) { + prev = &(model->NUMD2instances); + for (inst = *prev; inst; inst = *prev) { + if (inst->NUMD2name == name || (fast && inst == *fast)) { + *prev = inst->NUMD2nextInstance; + FREE(inst); + return OK; + } + prev = &(inst->NUMD2nextInstance); + } } - } - return (E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/numos/nummdel.c b/src/spicelib/devices/numos/nummdel.c index 738b6d2a2..b67892eab 100644 --- a/src/spicelib/devices/numos/nummdel.c +++ b/src/spicelib/devices/numos/nummdel.c @@ -1,6 +1,6 @@ /********** Copyright 1991 Regents of the University of California. All rights reserved. -Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group +Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group **********/ /* @@ -13,25 +13,26 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group #include "ngspice/sperror.h" #include "ngspice/suffix.h" + int NUMOSdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { + NUMOSmodel *model = (NUMOSmodel *) inModel; + NUMOSinstance **fast = (NUMOSinstance **) kill; + NUMOSinstance **prev = NULL; + NUMOSinstance *inst; - NUMOSmodel *model = (NUMOSmodel *) inModel; - NUMOSinstance **fast = (NUMOSinstance **) kill; - NUMOSinstance **prev = NULL; - NUMOSinstance *inst; - - for (; model; model = model->NUMOSnextModel) { - prev = &(model->NUMOSinstances); - for (inst = *prev; inst; inst = *prev) { - if (inst->NUMOSname == name || (fast && inst == *fast)) { - *prev = inst->NUMOSnextInstance; - FREE(inst); - return (OK); - } - prev = &(inst->NUMOSnextInstance); + for (; model; model = model->NUMOSnextModel) { + prev = &(model->NUMOSinstances); + for (inst = *prev; inst; inst = *prev) { + if (inst->NUMOSname == name || (fast && inst == *fast)) { + *prev = inst->NUMOSnextInstance; + FREE(inst); + return OK; + } + prev = &(inst->NUMOSnextInstance); + } } - } - return (E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/res/resdel.c b/src/spicelib/devices/res/resdel.c index 311723396..65cfc5ef5 100644 --- a/src/spicelib/devices/res/resdel.c +++ b/src/spicelib/devices/res/resdel.c @@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles Modified: Apr 2000 - Paolo Nenzi **********/ -/* - */ #include "ngspice/ngspice.h" #include "resdefs.h" @@ -14,21 +12,22 @@ Modified: Apr 2000 - Paolo Nenzi int RESdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - RESmodel *model = (RESmodel *)inModel; - RESinstance **fast = (RESinstance **)inst; + RESmodel *model = (RESmodel *) inModel; + RESinstance **fast = (RESinstance **) inst; RESinstance **prev = NULL; RESinstance *here; - for( ; model ; model = model->RESnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->RESname == name || (fast && here == *fast)) { + *prev = here->RESnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->RESnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/soi3/soi3del.c b/src/spicelib/devices/soi3/soi3del.c index b36ae48f4..ec9bcedf0 100644 --- a/src/spicelib/devices/soi3/soi3del.c +++ b/src/spicelib/devices/soi3/soi3del.c @@ -15,9 +15,9 @@ With help from : Bernard Tenbroek, Bill Redman-White, Mike Uren, Chris Edwards Acknowledgements : Rupert Howes and Pete Mole. **********/ -/********** -Modified by Paolo Nenzi 2002 -ngspice integration +/********** + Modified by Paolo Nenzi 2002 + ngspice integration **********/ #include "ngspice/ngspice.h" @@ -29,21 +29,22 @@ ngspice integration int SOI3delete(GENmodel *inModel, IFuid name, GENinstance **inst) { - SOI3model *model = (SOI3model *)inModel; - SOI3instance **fast = (SOI3instance **)inst; + SOI3model *model = (SOI3model *) inModel; + SOI3instance **fast = (SOI3instance **) inst; SOI3instance **prev = NULL; SOI3instance *here; - for( ; model ; model = model->SOI3nextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->SOI3name == name || (fast && here == *fast)) { + *prev = here->SOI3nextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->SOI3nextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/sw/swdelete.c b/src/spicelib/devices/sw/swdelete.c index 9a1707a96..7dd1dde63 100644 --- a/src/spicelib/devices/sw/swdelete.c +++ b/src/spicelib/devices/sw/swdelete.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Gordon Jacobs **********/ -/* - */ #include "ngspice/ngspice.h" #include "swdefs.h" @@ -14,21 +12,22 @@ Author: 1985 Gordon Jacobs int SWdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - SWmodel *model = (SWmodel *)inModel; - SWinstance **fast = (SWinstance **)inst; + SWmodel *model = (SWmodel *) inModel; + SWinstance **fast = (SWinstance **) inst; SWinstance **prev = NULL; SWinstance *here; - for( ; model ; model = model->SWnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->SWname == name || (fast && here == *fast)) { + *prev = here->SWnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->SWnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/tra/tradel.c b/src/spicelib/devices/tra/tradel.c index 33d725995..c6bde6e35 100644 --- a/src/spicelib/devices/tra/tradel.c +++ b/src/spicelib/devices/tra/tradel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "tradefs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int TRAdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { - TRAinstance **fast = (TRAinstance **)kill; - TRAmodel *model = (TRAmodel *)inModel; + TRAinstance **fast = (TRAinstance **) kill; + TRAmodel *model = (TRAmodel *) inModel; TRAinstance **prev = NULL; TRAinstance *here; - for( ; model ; model = model->TRAnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->TRAname == name || (fast && here == *fast)) { + *prev = here->TRAnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->TRAnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/txl/txldel.c b/src/spicelib/devices/txl/txldel.c index 3a5b63d24..f4e420d45 100644 --- a/src/spicelib/devices/txl/txldel.c +++ b/src/spicelib/devices/txl/txldel.c @@ -4,7 +4,6 @@ reserved. Author: 1992 Charles Hough **********/ - #include "ngspice/ngspice.h" #include "txldefs.h" #include "ngspice/sperror.h" @@ -14,21 +13,22 @@ Author: 1992 Charles Hough int TXLdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - TXLmodel *model = (TXLmodel *)inModel; - TXLinstance **fast = (TXLinstance **)inst; + TXLmodel *model = (TXLmodel *) inModel; + TXLinstance **fast = (TXLinstance **) inst; TXLinstance **prev = NULL; TXLinstance *here; - for( ; model ; model = model->TXLnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->TXLname == name || (fast && here == *fast)) { + *prev = here->TXLnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->TXLnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/urc/urcdel.c b/src/spicelib/devices/urc/urcdel.c index 1111f4056..f220ddc79 100644 --- a/src/spicelib/devices/urc/urcdel.c +++ b/src/spicelib/devices/urc/urcdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1987 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "urcdefs.h" @@ -14,21 +12,22 @@ Author: 1987 Thomas L. Quarles int URCdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - URCmodel *model = (URCmodel *)inModel; - URCinstance **fast = (URCinstance**)inst; + URCmodel *model = (URCmodel *) inModel; + URCinstance **fast = (URCinstance **) inst; URCinstance **prev = NULL; URCinstance *here; - for( ; model ; model = model->URCnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->URCname == name || (fast && here == *fast)) { + *prev = here->URCnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->URCnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/vbic/vbicdel.c b/src/spicelib/devices/vbic/vbicdel.c index 9d2108d97..aa2ec2485 100644 --- a/src/spicelib/devices/vbic/vbicdel.c +++ b/src/spicelib/devices/vbic/vbicdel.c @@ -19,22 +19,22 @@ Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH int VBICdelete(GENmodel *inModel, IFuid name, GENinstance **kill) { - VBICmodel *model = (VBICmodel*)inModel; - VBICinstance **fast = (VBICinstance**)kill; - + VBICmodel *model = (VBICmodel *) inModel; + VBICinstance **fast = (VBICinstance **) kill; VBICinstance **prev = NULL; VBICinstance *here; - for( ; model ; model = model->VBICnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->VBICname == name || (fast && here == *fast)) { + *prev = here->VBICnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->VBICnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/vccs/vccsdel.c b/src/spicelib/devices/vccs/vccsdel.c index 819ca4e19..864474f44 100644 --- a/src/spicelib/devices/vccs/vccsdel.c +++ b/src/spicelib/devices/vccs/vccsdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "vccsdefs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int VCCSdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - VCCSmodel *model = (VCCSmodel *)inModel; - VCCSinstance **fast = (VCCSinstance**)inst; + VCCSmodel *model = (VCCSmodel *) inModel; + VCCSinstance **fast = (VCCSinstance **) inst; VCCSinstance **prev = NULL; VCCSinstance *here; - for( ; model ; model = model->VCCSnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->VCCSname == name || (fast && here == *fast)) { + *prev = here->VCCSnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->VCCSnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/vcvs/vcvsdel.c b/src/spicelib/devices/vcvs/vcvsdel.c index 1cb5d28b4..84a885788 100644 --- a/src/spicelib/devices/vcvs/vcvsdel.c +++ b/src/spicelib/devices/vcvs/vcvsdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "vcvsdefs.h" @@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles int VCVSdelete(GENmodel *inModel, IFuid name, GENinstance **inst) { - VCVSmodel *model = (VCVSmodel *)inModel; - VCVSinstance **fast = (VCVSinstance**)inst; + VCVSmodel *model = (VCVSmodel *) inModel; + VCVSinstance **fast = (VCVSinstance **) inst; VCVSinstance **prev = NULL; VCVSinstance *here; - for( ; model ; model = model->VCVSnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->VCVSname == name || (fast && here == *fast)) { + *prev = here->VCVSnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->VCVSnextInstance); } } - return(E_NODEV); + + return E_NODEV; } diff --git a/src/spicelib/devices/vsrc/vsrcdel.c b/src/spicelib/devices/vsrc/vsrcdel.c index 5c5691f47..cc081b205 100644 --- a/src/spicelib/devices/vsrc/vsrcdel.c +++ b/src/spicelib/devices/vsrc/vsrcdel.c @@ -2,8 +2,6 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* - */ #include "ngspice/ngspice.h" #include "vsrcdefs.h" @@ -19,16 +17,17 @@ VSRCdelete(GENmodel *inModel, IFuid name, GENinstance **inst) VSRCinstance **prev = NULL; VSRCinstance *here; - for( ; model ; model = model->VSRCnextModel) { + 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 (here = *prev; here; here = *prev) { + if (here->VSRCname == name || (fast && here == *fast)) { + *prev = here->VSRCnextInstance; FREE(here); - return(OK); + return OK; } prev = &(here->VSRCnextInstance); } } - return(E_NODEV); + + return E_NODEV; }