devices/**/XXXdel.c, cleanup whitespace

This commit is contained in:
rlar 2018-01-04 17:02:47 +01:00
parent 4171996094
commit 16ee02ba35
55 changed files with 721 additions and 735 deletions

View File

@ -12,23 +12,22 @@ Author: 1987 Kanwar Jit Singh
int int
ASRCdelete(GENmodel *model, IFuid name, GENinstance **fast) ASRCdelete(GENmodel *model, IFuid name, GENinstance **fast)
{ {
ASRCinstance **instPtr = (ASRCinstance**) fast; ASRCinstance **instPtr = (ASRCinstance **) fast;
ASRCmodel *modPtr = (ASRCmodel*) model; ASRCmodel *modPtr = (ASRCmodel *) model;
ASRCinstance **prev = NULL; ASRCinstance **prev = NULL;
ASRCinstance *here; ASRCinstance *here;
for (; modPtr ; modPtr = modPtr->ASRCnextModel) { for (; modPtr; modPtr = modPtr->ASRCnextModel) {
prev = &(modPtr->ASRCinstances); prev = &(modPtr->ASRCinstances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->ASRCname == name || (instPtr && here == *instPtr)) { if (here->ASRCname == name || (instPtr && here == *instPtr)) {
*prev = here->ASRCnextInstance; *prev = here->ASRCnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->ASRCnextInstance); prev = &(here->ASRCnextInstance);
} }
} }
return(E_NODEV); return E_NODEV;
} }

View File

@ -16,24 +16,23 @@ Author: 1985 Thomas L. Quarles
int int
BJTdelete(GENmodel *inModel, IFuid name, GENinstance **kill) BJTdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
BJTmodel *model = (BJTmodel*)inModel; BJTmodel *model = (BJTmodel *) inModel;
BJTinstance **fast = (BJTinstance**)kill; BJTinstance **fast = (BJTinstance **) kill;
BJTinstance **prev = NULL; BJTinstance **prev = NULL;
BJTinstance *here; BJTinstance *here;
for( ; model ; model = model->BJTnextModel) { for (; model; model = model->BJTnextModel) {
prev = &(model->BJTinstances); prev = &(model->BJTinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->BJTname == name || (fast && here==*fast) ) { if (here->BJTname == name || (fast && here == *fast)) {
*prev= here->BJTnextInstance; *prev = here->BJTnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->BJTnextInstance); prev = &(here->BJTnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Hong J. Park, Thomas L. Quarles Author: 1985 Hong J. Park, Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "bsim1def.h" #include "bsim1def.h"
@ -14,24 +12,23 @@ Author: 1985 Hong J. Park, Thomas L. Quarles
int int
B1delete(GENmodel *inModel, IFuid name, GENinstance **inInst) B1delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
{ {
B1instance **fast = (B1instance **) inInst;
B1instance **fast = (B1instance**)inInst; B1model *model = (B1model *) inModel;
B1model *model = (B1model*)inModel;
B1instance **prev = NULL; B1instance **prev = NULL;
B1instance *here; B1instance *here;
for( ; model ; model = model->B1nextModel) { for (; model; model = model->B1nextModel) {
prev = &(model->B1instances); prev = &(model->B1instances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->B1name == name || (fast && here==*fast) ) { if (here->B1name == name || (fast && here == *fast)) {
*prev= here->B1nextInstance; *prev = here->B1nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->B1nextInstance); prev = &(here->B1nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Hong J. Park, Thomas L. Quarles Author: 1985 Hong J. Park, Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "bsim2def.h" #include "bsim2def.h"
@ -15,22 +13,22 @@ Author: 1985 Hong J. Park, Thomas L. Quarles
int int
B2delete(GENmodel *inModel, IFuid name, GENinstance **inInst) B2delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
{ {
B2instance **fast = (B2instance **) inInst;
B2instance **fast = (B2instance**)inInst; B2model *model = (B2model *) inModel;
B2model *model = (B2model*)inModel;
B2instance **prev = NULL; B2instance **prev = NULL;
B2instance *here; B2instance *here;
for( ; model ; model = model->B2nextModel) { for (; model; model = model->B2nextModel) {
prev = &(model->B2instances); prev = &(model->B2instances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->B2name == name || (fast && here==*fast) ) { if (here->B2name == name || (fast && here == *fast)) {
*prev= here->B2nextInstance; *prev = here->B2nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->B2nextInstance); prev = &(here->B2nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -18,27 +18,26 @@
int int
BSIM3delete( BSIM3delete(
GENmodel *inModel, GENmodel *inModel,
IFuid name, IFuid name,
GENinstance **inInst) GENinstance **inInst)
{ {
BSIM3instance **fast = (BSIM3instance**)inInst; BSIM3instance **fast = (BSIM3instance **) inInst;
BSIM3model *model = (BSIM3model*)inModel; BSIM3model *model = (BSIM3model *) inModel;
BSIM3instance **prev = NULL; BSIM3instance **prev = NULL;
BSIM3instance *here; BSIM3instance *here;
for (; model ; model = model->BSIM3nextModel) { for (; model; model = model->BSIM3nextModel) {
prev = &(model->BSIM3instances); prev = &(model->BSIM3instances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->BSIM3name == name || (fast && here==*fast)) { if (here->BSIM3name == name || (fast && here == *fast)) {
*prev= here->BSIM3nextInstance; *prev = here->BSIM3nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->BSIM3nextInstance); prev = &(here->BSIM3nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -20,23 +20,22 @@ Modified by Paolo Nenzi 2002
int int
B3SOIDDdelete(GENmodel *inModel, IFuid name, GENinstance **inInst) B3SOIDDdelete(GENmodel *inModel, IFuid name, GENinstance **inInst)
{ {
B3SOIDDinstance **fast = (B3SOIDDinstance**)inInst; B3SOIDDinstance **fast = (B3SOIDDinstance **) inInst;
B3SOIDDmodel *model = (B3SOIDDmodel*)inModel; B3SOIDDmodel *model = (B3SOIDDmodel *) inModel;
B3SOIDDinstance **prev = NULL; B3SOIDDinstance **prev = NULL;
B3SOIDDinstance *here; B3SOIDDinstance *here;
for (; model ; model = model->B3SOIDDnextModel) { for (; model; model = model->B3SOIDDnextModel) {
prev = &(model->B3SOIDDinstances); prev = &(model->B3SOIDDinstances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->B3SOIDDname == name || (fast && here==*fast)) { if (here->B3SOIDDname == name || (fast && here == *fast)) {
*prev= here->B3SOIDDnextInstance; *prev = here->B3SOIDDnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->B3SOIDDnextInstance); prev = &(here->B3SOIDDnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -20,23 +20,22 @@ File: b3soifddel.c 98/5/01
int int
B3SOIFDdelete(GENmodel *inModel, IFuid name, GENinstance **inInst) B3SOIFDdelete(GENmodel *inModel, IFuid name, GENinstance **inInst)
{ {
B3SOIFDinstance **fast = (B3SOIFDinstance**)inInst; B3SOIFDinstance **fast = (B3SOIFDinstance **) inInst;
B3SOIFDmodel *model = (B3SOIFDmodel*)inModel; B3SOIFDmodel *model = (B3SOIFDmodel *) inModel;
B3SOIFDinstance **prev = NULL; B3SOIFDinstance **prev = NULL;
B3SOIFDinstance *here; B3SOIFDinstance *here;
for (; model ; model = model->B3SOIFDnextModel) { for (; model; model = model->B3SOIFDnextModel) {
prev = &(model->B3SOIFDinstances); prev = &(model->B3SOIFDinstances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->B3SOIFDname == name || (fast && here==*fast)) { if (here->B3SOIFDname == name || (fast && here == *fast)) {
*prev= here->B3SOIFDnextInstance; *prev = here->B3SOIFDnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->B3SOIFDnextInstance); prev = &(here->B3SOIFDnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -20,23 +20,22 @@ Modified by Paolo Nenzi 2002
int int
B3SOIPDdelete(GENmodel *inModel, IFuid name, GENinstance **inInst) B3SOIPDdelete(GENmodel *inModel, IFuid name, GENinstance **inInst)
{ {
B3SOIPDinstance **fast = (B3SOIPDinstance**)inInst; B3SOIPDinstance **fast = (B3SOIPDinstance **) inInst;
B3SOIPDmodel *model = (B3SOIPDmodel*)inModel; B3SOIPDmodel *model = (B3SOIPDmodel *) inModel;
B3SOIPDinstance **prev = NULL; B3SOIPDinstance **prev = NULL;
B3SOIPDinstance *here; B3SOIPDinstance *here;
for (; model ; model = model->B3SOIPDnextModel) { for (; model; model = model->B3SOIPDnextModel) {
prev = &(model->B3SOIPDinstances); prev = &(model->B3SOIPDinstances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->B3SOIPDname == name || (fast && here==*fast)) { if (here->B3SOIPDname == name || (fast && here == *fast)) {
*prev= here->B3SOIPDnextInstance; *prev = here->B3SOIPDnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->B3SOIPDnextInstance); prev = &(here->B3SOIPDnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1995 Min-Chie Jeng and Mansun Chan. Author: 1995 Min-Chie Jeng and Mansun Chan.
File: b3v0del.c File: b3v0del.c
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "bsim3v0def.h" #include "bsim3v0def.h"
@ -16,23 +14,22 @@ File: b3v0del.c
int int
BSIM3v0delete(GENmodel *inModel, IFuid name, GENinstance **inInst) BSIM3v0delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
{ {
BSIM3v0instance **fast = (BSIM3v0instance**)inInst; BSIM3v0instance **fast = (BSIM3v0instance **) inInst;
BSIM3v0model *model = (BSIM3v0model*)inModel; BSIM3v0model *model = (BSIM3v0model *) inModel;
BSIM3v0instance **prev = NULL; BSIM3v0instance **prev = NULL;
BSIM3v0instance *here; BSIM3v0instance *here;
for (; model ; model = model->BSIM3v0nextModel) { for (; model; model = model->BSIM3v0nextModel) {
prev = &(model->BSIM3v0instances); prev = &(model->BSIM3v0instances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->BSIM3v0name == name || (fast && here==*fast)) { if (here->BSIM3v0name == name || (fast && here == *fast)) {
*prev= here->BSIM3v0nextInstance; *prev = here->BSIM3v0nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->BSIM3v0nextInstance); prev = &(here->BSIM3v0nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -10,7 +10,6 @@
* BSIM3v3.1, Released by yuhua 96/12/08 * BSIM3v3.1, Released by yuhua 96/12/08
*/ */
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "bsim3v1def.h" #include "bsim3v1def.h"
#include "ngspice/sperror.h" #include "ngspice/sperror.h"
@ -21,23 +20,22 @@
int int
BSIM3v1delete(GENmodel *inModel, IFuid name, GENinstance **inInst) BSIM3v1delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
{ {
BSIM3v1instance **fast = (BSIM3v1instance**)inInst; BSIM3v1instance **fast = (BSIM3v1instance **) inInst;
BSIM3v1model *model = (BSIM3v1model*)inModel; BSIM3v1model *model = (BSIM3v1model *) inModel;
BSIM3v1instance **prev = NULL; BSIM3v1instance **prev = NULL;
BSIM3v1instance *here; BSIM3v1instance *here;
for (; model ; model = model->BSIM3v1nextModel) { for (; model; model = model->BSIM3v1nextModel) {
prev = &(model->BSIM3v1instances); prev = &(model->BSIM3v1instances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->BSIM3v1name == name || (fast && here==*fast)) { if (here->BSIM3v1name == name || (fast && here == *fast)) {
*prev= here->BSIM3v1nextInstance; *prev = here->BSIM3v1nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->BSIM3v1nextInstance); prev = &(here->BSIM3v1nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -18,23 +18,24 @@
int int
BSIM3v32delete (GENmodel *inModel, IFuid name, GENinstance **inInst) BSIM3v32delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
{ {
BSIM3v32instance **fast = (BSIM3v32instance**)inInst; BSIM3v32instance **fast = (BSIM3v32instance **) inInst;
BSIM3v32model *model = (BSIM3v32model*)inModel; BSIM3v32model *model = (BSIM3v32model *) inModel;
BSIM3v32instance **prev = NULL; BSIM3v32instance **prev = NULL;
BSIM3v32instance *here; BSIM3v32instance *here;
for (; model ; model = model->BSIM3v32nextModel) { for (; model; model = model->BSIM3v32nextModel) {
prev = &(model->BSIM3v32instances); prev = &(model->BSIM3v32instances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->BSIM3v32name == name || (fast && here==*fast)) { if (here->BSIM3v32name == name || (fast && here == *fast)) {
*prev= here->BSIM3v32nextInstance; *prev = here->BSIM3v32nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->BSIM3v32nextInstance); prev = &(here->BSIM3v32nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -67,25 +67,26 @@
int int
BSIM4delete( BSIM4delete(
GENmodel *inModel, GENmodel *inModel,
IFuid name, IFuid name,
GENinstance **inInst) GENinstance **inInst)
{ {
BSIM4instance **fast = (BSIM4instance**)inInst; BSIM4instance **fast = (BSIM4instance **) inInst;
BSIM4model *model = (BSIM4model*)inModel; BSIM4model *model = (BSIM4model *) inModel;
BSIM4instance **prev = NULL; BSIM4instance **prev = NULL;
BSIM4instance *here; BSIM4instance *here;
for (; model ; model = model->BSIM4nextModel) { for (; model; model = model->BSIM4nextModel) {
prev = &(model->BSIM4instances); prev = &(model->BSIM4instances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->BSIM4name == name || (fast && here==*fast)) { if (here->BSIM4name == name || (fast && here == *fast)) {
*prev= here->BSIM4nextInstance; *prev = here->BSIM4nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->BSIM4nextInstance); prev = &(here->BSIM4nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -17,25 +17,26 @@
int int
BSIM4v5delete( BSIM4v5delete(
GENmodel *inModel, GENmodel *inModel,
IFuid name, IFuid name,
GENinstance **inInst) GENinstance **inInst)
{ {
BSIM4v5instance **fast = (BSIM4v5instance**)inInst; BSIM4v5instance **fast = (BSIM4v5instance **) inInst;
BSIM4v5model *model = (BSIM4v5model*)inModel; BSIM4v5model *model = (BSIM4v5model *) inModel;
BSIM4v5instance **prev = NULL; BSIM4v5instance **prev = NULL;
BSIM4v5instance *here; BSIM4v5instance *here;
for (; model ; model = model->BSIM4v5nextModel) { for (; model; model = model->BSIM4v5nextModel) {
prev = &(model->BSIM4v5instances); prev = &(model->BSIM4v5instances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->BSIM4v5name == name || (fast && here==*fast)) { if (here->BSIM4v5name == name || (fast && here == *fast)) {
*prev= here->BSIM4v5nextInstance; *prev = here->BSIM4v5nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->BSIM4v5nextInstance); prev = &(here->BSIM4v5nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -19,25 +19,26 @@
int int
BSIM4v6delete( BSIM4v6delete(
GENmodel *inModel, GENmodel *inModel,
IFuid name, IFuid name,
GENinstance **inInst) GENinstance **inInst)
{ {
BSIM4v6instance **fast = (BSIM4v6instance**)inInst; BSIM4v6instance **fast = (BSIM4v6instance **) inInst;
BSIM4v6model *model = (BSIM4v6model*)inModel; BSIM4v6model *model = (BSIM4v6model *) inModel;
BSIM4v6instance **prev = NULL; BSIM4v6instance **prev = NULL;
BSIM4v6instance *here; BSIM4v6instance *here;
for (; model ; model = model->BSIM4v6nextModel) { for (; model; model = model->BSIM4v6nextModel) {
prev = &(model->BSIM4v6instances); prev = &(model->BSIM4v6instances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->BSIM4v6name == name || (fast && here==*fast)) { if (here->BSIM4v6name == name || (fast && here == *fast)) {
*prev= here->BSIM4v6nextInstance; *prev = here->BSIM4v6nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->BSIM4v6nextInstance); prev = &(here->BSIM4v6nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -19,25 +19,26 @@
int int
BSIM4v7delete( BSIM4v7delete(
GENmodel *inModel, GENmodel *inModel,
IFuid name, IFuid name,
GENinstance **inInst) GENinstance **inInst)
{ {
BSIM4v7instance **fast = (BSIM4v7instance**)inInst; BSIM4v7instance **fast = (BSIM4v7instance **) inInst;
BSIM4v7model *model = (BSIM4v7model*)inModel; BSIM4v7model *model = (BSIM4v7model *) inModel;
BSIM4v7instance **prev = NULL; BSIM4v7instance **prev = NULL;
BSIM4v7instance *here; BSIM4v7instance *here;
for (; model ; model = model->BSIM4v7nextModel) { for (; model; model = model->BSIM4v7nextModel) {
prev = &(model->BSIM4v7instances); prev = &(model->BSIM4v7instances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->BSIM4v7name == name || (fast && here==*fast)) { if (here->BSIM4v7name == name || (fast && here == *fast)) {
*prev= here->BSIM4v7nextInstance; *prev = here->BSIM4v7nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->BSIM4v7nextInstance); prev = &(here->BSIM4v7nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -1,6 +1,5 @@
/*** B4SOI 12/16/2010 Released by Tanvir Morshed ***/ /*** B4SOI 12/16/2010 Released by Tanvir Morshed ***/
/********** /**********
* Copyright 2010 Regents of the University of California. All rights reserved. * Copyright 2010 Regents of the University of California. All rights reserved.
* Authors: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang * Authors: 1998 Samuel Fung, Dennis Sinitsky and Stephen Tang
@ -15,7 +14,6 @@
**********/ **********/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "b4soidef.h" #include "b4soidef.h"
#include "ngspice/sperror.h" #include "ngspice/sperror.h"
#include "ngspice/gendefs.h" #include "ngspice/gendefs.h"
@ -24,27 +22,26 @@
int int
B4SOIdelete( B4SOIdelete(
GENmodel *inModel, GENmodel *inModel,
IFuid name, IFuid name,
GENinstance **inInst) GENinstance **inInst)
{ {
B4SOIinstance **fast = (B4SOIinstance**)inInst; B4SOIinstance **fast = (B4SOIinstance **) inInst;
B4SOImodel *model = (B4SOImodel*)inModel; B4SOImodel *model = (B4SOImodel *) inModel;
B4SOIinstance **prev = NULL; B4SOIinstance **prev = NULL;
B4SOIinstance *here; B4SOIinstance *here;
for (; model ; model = model->B4SOInextModel) { for (; model; model = model->B4SOInextModel) {
prev = &(model->B4SOIinstances); prev = &(model->B4SOIinstances);
for (here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->B4SOIname == name || (fast && here==*fast)) { if (here->B4SOIname == name || (fast && here == *fast)) {
*prev= here->B4SOInextInstance; *prev = here->B4SOInextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->B4SOInextInstance); prev = &(here->B4SOInextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
Modified: September 2003 Paolo Nenzi Modified: September 2003 Paolo Nenzi
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "capdefs.h" #include "capdefs.h"
@ -15,22 +13,22 @@ Modified: September 2003 Paolo Nenzi
int int
CAPdelete(GENmodel *inModel, IFuid name, GENinstance **inst) CAPdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
CAPinstance **fast = (CAPinstance **) inst;
CAPinstance **fast = (CAPinstance**)inst; CAPmodel *model = (CAPmodel *) inModel;
CAPmodel *model = (CAPmodel*)inModel;
CAPinstance **prev = NULL; CAPinstance **prev = NULL;
CAPinstance *here; CAPinstance *here;
for( ; model ; model = model->CAPnextModel) { for (; model; model = model->CAPnextModel) {
prev = &(model->CAPinstances); prev = &(model->CAPinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->CAPname == name || (fast && here==*fast) ) { if (here->CAPname == name || (fast && here == *fast)) {
*prev= here->CAPnextInstance; *prev = here->CAPnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->CAPnextInstance); prev = &(here->CAPnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "cccsdefs.h" #include "cccsdefs.h"
@ -14,22 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
CCCSdelete(GENmodel *inModel, IFuid name, GENinstance **inst) CCCSdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
CCCSmodel *model = (CCCSmodel *) inModel;
CCCSmodel *model = (CCCSmodel*)inModel; CCCSinstance **fast = (CCCSinstance **) inst;
CCCSinstance **fast = (CCCSinstance**)inst;
CCCSinstance **prev = NULL; CCCSinstance **prev = NULL;
CCCSinstance *here; CCCSinstance *here;
for( ; model ; model = model->CCCSnextModel) { for (; model; model = model->CCCSnextModel) {
prev = &(model->CCCSinstances); prev = &(model->CCCSinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->CCCSname == name || (fast && here==*fast) ) { if (here->CCCSname == name || (fast && here == *fast)) {
*prev= here->CCCSnextInstance; *prev = here->CCCSnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->CCCSnextInstance); prev = &(here->CCCSnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "ccvsdefs.h" #include "ccvsdefs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
CCVSdelete(GENmodel *inModel, IFuid name, GENinstance **kill) CCVSdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
CCVSmodel *model = (CCVSmodel*)inModel; CCVSmodel *model = (CCVSmodel *) inModel;
CCVSinstance **fast = (CCVSinstance**)kill; CCVSinstance **fast = (CCVSinstance **) kill;
CCVSinstance **prev = NULL; CCVSinstance **prev = NULL;
CCVSinstance *here; CCVSinstance *here;
for( ; model ; model = model->CCVSnextModel) { for (; model; model = model->CCVSnextModel) {
prev = &(model->CCVSinstances); prev = &(model->CCVSinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->CCVSname == name || (fast && here==*fast) ) { if (here->CCVSname == name || (fast && here == *fast)) {
*prev= here->CCVSnextInstance; *prev = here->CCVSnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->CCVSnextInstance); prev = &(here->CCVSnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -4,7 +4,6 @@ reserved.
Author: 1992 Charles Hough Author: 1992 Charles Hough
**********/ **********/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "cpldefs.h" #include "cpldefs.h"
#include "ngspice/sperror.h" #include "ngspice/sperror.h"
@ -14,21 +13,22 @@ Author: 1992 Charles Hough
int int
CPLdelete(GENmodel *inModel, IFuid name, GENinstance **inst) CPLdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
CPLmodel *model = (CPLmodel *)inModel; CPLmodel *model = (CPLmodel *) inModel;
CPLinstance **fast = (CPLinstance **)inst; CPLinstance **fast = (CPLinstance **) inst;
CPLinstance **prev = NULL; CPLinstance **prev = NULL;
CPLinstance *here; CPLinstance *here;
for( ; model ; model = model->CPLnextModel) { for (; model; model = model->CPLnextModel) {
prev = &(model->CPLinstances); prev = &(model->CPLinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->CPLname == name || (fast && here==*fast) ) { if (here->CPLname == name || (fast && here == *fast)) {
*prev= here->CPLnextInstance; *prev = here->CPLnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->CPLnextInstance); prev = &(here->CPLnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Gordon Jacobs Author: 1985 Gordon Jacobs
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "cswdefs.h" #include "cswdefs.h"
@ -13,23 +11,23 @@ Author: 1985 Gordon Jacobs
int int
CSWdelete(GENmodel *inModel, IFuid name, GENinstance **inst) CSWdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
CSWmodel *model = (CSWmodel*)inModel; CSWmodel *model = (CSWmodel *) inModel;
CSWinstance **fast = (CSWinstance**)inst; CSWinstance **fast = (CSWinstance **) inst;
CSWinstance **prev = NULL; CSWinstance **prev = NULL;
CSWinstance *here; CSWinstance *here;
for( ; model ; model = model->CSWnextModel) { for (; model; model = model->CSWnextModel) {
prev = &(model->CSWinstances); prev = &(model->CSWinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->CSWname == name || (fast && here==*fast) ) { if (here->CSWname == name || (fast && here == *fast)) {
*prev= here->CSWnextInstance; *prev = here->CSWnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->CSWnextInstance); prev = &(here->CSWnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "diodefs.h" #include "diodefs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
DIOdelete(GENmodel *inModel, IFuid name, GENinstance **kill) DIOdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
DIOmodel *model = (DIOmodel*)inModel; DIOmodel *model = (DIOmodel *) inModel;
DIOinstance **fast = (DIOinstance**)kill; DIOinstance **fast = (DIOinstance **) kill;
DIOinstance **prev = NULL; DIOinstance **prev = NULL;
DIOinstance *here; DIOinstance *here;
for( ; model ; model = model->DIOnextModel) { for (; model; model = model->DIOnextModel) {
prev = &(model->DIOinstances); prev = &(model->DIOinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->DIOname == name || (fast && here==*fast) ) { if (here->DIOname == name || (fast && here == *fast)) {
*prev= here->DIOnextInstance; *prev = here->DIOnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->DIOnextInstance); prev = &(here->DIOnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,9 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 S. Hwang Author: 1985 S. Hwang
**********/ **********/
/* /*
Imported into hfeta model: Paolo Nenzi 2001 Imported into hfeta model: Paolo Nenzi 2001
*/ */
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
@ -15,21 +16,22 @@ Imported into hfeta model: Paolo Nenzi 2001
int int
HFETAdelete(GENmodel *inModel, IFuid name, GENinstance **inst) HFETAdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
HFETAmodel *model = (HFETAmodel*)inModel; HFETAmodel *model = (HFETAmodel *) inModel;
HFETAinstance **fast = (HFETAinstance**)inst; HFETAinstance **fast = (HFETAinstance **) inst;
HFETAinstance **prev = NULL; HFETAinstance **prev = NULL;
HFETAinstance *here; HFETAinstance *here;
for( ; model ; model = model->HFETAnextModel) { for (; model; model = model->HFETAnextModel) {
prev = &(model->HFETAinstances); prev = &(model->HFETAinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->HFETAname == name || (fast && here==*fast) ) { if (here->HFETAname == name || (fast && here == *fast)) {
*prev= here->HFETAnextInstance; *prev = here->HFETAnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->HFETAnextInstance); prev = &(here->HFETAnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,9 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 S. Hwang Author: 1985 S. Hwang
**********/ **********/
/* /*
Imported into hfet2 model: Paolo Nenzi 2001 Imported into hfet2 model: Paolo Nenzi 2001
*/ */
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
@ -15,21 +16,22 @@ Imported into hfet2 model: Paolo Nenzi 2001
int int
HFET2delete(GENmodel *inModel, IFuid name, GENinstance **inst) HFET2delete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
HFET2model *model = (HFET2model*)inModel; HFET2model *model = (HFET2model *) inModel;
HFET2instance **fast = (HFET2instance**)inst; HFET2instance **fast = (HFET2instance **) inst;
HFET2instance **prev = NULL; HFET2instance **prev = NULL;
HFET2instance *here; HFET2instance *here;
for( ; model ; model = model->HFET2nextModel) { for (; model; model = model->HFET2nextModel) {
prev = &(model->HFET2instances); prev = &(model->HFET2instances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->HFET2name == name || (fast && here==*fast) ) { if (here->HFET2name == name || (fast && here == *fast)) {
*prev= here->HFET2nextInstance; *prev = here->HFET2nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->HFET2nextInstance); prev = &(here->HFET2nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -60,26 +60,28 @@ to others."
#include "ngspice/gendefs.h" #include "ngspice/gendefs.h"
#include "ngspice/suffix.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 ) { int HSM2delete(
prev = &(model->HSM2instances); GENmodel *inModel,
for ( here = *prev ;here ;here = *prev ) { IFuid name,
if ( here->HSM2name == name || (fast && here==*fast) ) { GENinstance **inInst)
*prev= here->HSM2nextInstance; {
FREE(here); HSM2instance **fast = (HSM2instance **) inInst;
return(OK); HSM2model *model = (HSM2model *) inModel;
} HSM2instance **prev = NULL;
prev = &(here->HSM2nextInstance); 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;
} }

View File

@ -21,26 +21,28 @@
#include "ngspice/gendefs.h" #include "ngspice/gendefs.h"
#include "ngspice/suffix.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 ) { int HSMHVdelete(
prev = &(model->HSMHVinstances); GENmodel *inModel,
for ( here = *prev ;here ;here = *prev ) { IFuid name,
if ( here->HSMHVname == name || (fast && here==*fast) ) { GENinstance **inInst)
*prev= here->HSMHVnextInstance; {
FREE(here); HSMHVinstance **fast = (HSMHVinstance **) inInst;
return(OK); HSMHVmodel *model = (HSMHVmodel *) inModel;
} HSMHVinstance **prev = NULL;
prev = &(here->HSMHVnextInstance); 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;
} }

View File

@ -63,26 +63,28 @@ June 2008 (revised October 2011)
#include "ngspice/gendefs.h" #include "ngspice/gendefs.h"
#include "ngspice/suffix.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 ) { int HSMHV2delete(
prev = &(model->HSMHV2instances); GENmodel *inModel,
for ( here = *prev ;here ;here = *prev ) { IFuid name,
if ( here->HSMHV2name == name || (fast && here==*fast) ) { GENinstance **inInst)
*prev= here->HSMHV2nextInstance; {
FREE(here); HSMHV2instance **fast = (HSMHV2instance **) inInst;
return(OK); HSMHV2model *model = (HSMHV2model *) inModel;
} HSMHV2instance **prev = NULL;
prev = &(here->HSMHV2nextInstance); 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;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "inddefs.h" #include "inddefs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
INDdelete(GENmodel *inModel, IFuid name, GENinstance **kill) INDdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
INDmodel *model = (INDmodel*)inModel; INDmodel *model = (INDmodel *) inModel;
INDinstance **fast = (INDinstance**)kill; INDinstance **fast = (INDinstance **) kill;
INDinstance **prev = NULL; INDinstance **prev = NULL;
INDinstance *here; INDinstance *here;
for( ; model ; model = model->INDnextModel) { for (; model; model = model->INDnextModel) {
prev = &(model->INDinstances); prev = &(model->INDinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->INDname == name || (fast && here==*fast) ) { if (here->INDname == name || (fast && here == *fast)) {
*prev= here->INDnextInstance; *prev = here->INDnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->INDnextInstance); prev = &(here->INDnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "inddefs.h" #include "inddefs.h"
@ -15,22 +13,23 @@ Author: 1985 Thomas L. Quarles
int int
MUTdelete(GENmodel *inModel, IFuid name, GENinstance **kill) MUTdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
MUTmodel *model = (MUTmodel*)inModel; MUTmodel *model = (MUTmodel *) inModel;
MUTinstance **fast = (MUTinstance**)kill; MUTinstance **fast = (MUTinstance **) kill;
MUTinstance **prev = NULL; MUTinstance **prev = NULL;
MUTinstance *here; MUTinstance *here;
for( ; model ; model = model->MUTnextModel) { for (; model; model = model->MUTnextModel) {
prev = &(model->MUTinstances); prev = &(model->MUTinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->MUTname == name || (fast && here==*fast) ) { if (here->MUTname == name || (fast && here == *fast)) {
*prev= here->MUTnextInstance; *prev = here->MUTnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->MUTnextInstance); prev = &(here->MUTnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }
#endif /*MUTUAL*/ #endif /*MUTUAL*/

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "isrcdefs.h" #include "isrcdefs.h"
@ -19,16 +17,17 @@ ISRCdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
ISRCinstance **prev = NULL; ISRCinstance **prev = NULL;
ISRCinstance *here; ISRCinstance *here;
for( ; model ; model = model->ISRCnextModel) { for (; model; model = model->ISRCnextModel) {
prev = &(model->ISRCinstances); prev = &(model->ISRCinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->ISRCname == name || (fast && here==*fast) ) { if (here->ISRCname == name || (fast && here == *fast)) {
*prev= here->ISRCnextInstance; *prev = here->ISRCnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->ISRCnextInstance); prev = &(here->ISRCnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "jfetdefs.h" #include "jfetdefs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
JFETdelete(GENmodel *inModel, IFuid name, GENinstance **inst) JFETdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
JFETmodel *model = (JFETmodel*)inModel; JFETmodel *model = (JFETmodel *) inModel;
JFETinstance **fast = (JFETinstance**)inst; JFETinstance **fast = (JFETinstance **) inst;
JFETinstance **prev = NULL; JFETinstance **prev = NULL;
JFETinstance *here; JFETinstance *here;
for( ; model ; model = model->JFETnextModel) { for (; model; model = model->JFETnextModel) {
prev = &(model->JFETinstances); prev = &(model->JFETinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->JFETname == name || (fast && here==*fast) ) { if (here->JFETname == name || (fast && here == *fast)) {
*prev= here->JFETnextInstance; *prev = here->JFETnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->JFETnextInstance); prev = &(here->JFETnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -16,21 +16,22 @@ Modified to jfet2 for PS model definition ( Anthony E. Parker )
int int
JFET2delete(GENmodel *inModel, IFuid name, GENinstance **inst) JFET2delete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
JFET2model *model = (JFET2model*)inModel; JFET2model *model = (JFET2model *) inModel;
JFET2instance **fast = (JFET2instance**)inst; JFET2instance **fast = (JFET2instance **) inst;
JFET2instance **prev = NULL; JFET2instance **prev = NULL;
JFET2instance *here; JFET2instance *here;
for( ; model ; model = model->JFET2nextModel) { for (; model; model = model->JFET2nextModel) {
prev = &(model->JFET2instances); prev = &(model->JFET2instances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->JFET2name == name || (fast && here==*fast) ) { if (here->JFET2name == name || (fast && here == *fast)) {
*prev= here->JFET2nextInstance; *prev = here->JFET2nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->JFET2nextInstance); prev = &(here->JFET2nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -8,24 +8,26 @@ Author: 1990 Jaijeet S. Roychowdhury
#include "ngspice/sperror.h" #include "ngspice/sperror.h"
#include "ngspice/suffix.h" #include "ngspice/suffix.h"
int int
LTRAdelete(GENmodel *inModel, IFuid name, GENinstance **kill) LTRAdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
LTRAinstance **fast = (LTRAinstance **) kill; LTRAinstance **fast = (LTRAinstance **) kill;
LTRAmodel *model = (LTRAmodel *) inModel; LTRAmodel *model = (LTRAmodel *) inModel;
LTRAinstance **prev = NULL; LTRAinstance **prev = NULL;
LTRAinstance *here; LTRAinstance *here;
for (; model; model = model->LTRAnextModel) { for (; model; model = model->LTRAnextModel) {
prev = &(model->LTRAinstances); prev = &(model->LTRAinstances);
for (here = *prev; here; here = *prev) { for (here = *prev; here; here = *prev) {
if (here->LTRAname == name || (fast && here == *fast)) { if (here->LTRAname == name || (fast && here == *fast)) {
*prev = here->LTRAnextInstance; *prev = here->LTRAnextInstance;
FREE(here); FREE(here);
return (OK); return OK;
} }
prev = &(here->LTRAnextInstance); prev = &(here->LTRAnextInstance);
}
} }
}
return (E_NODEV); return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 S. Hwang Author: 1985 S. Hwang
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "mesdefs.h" #include "mesdefs.h"
@ -14,21 +12,22 @@ Author: 1985 S. Hwang
int int
MESdelete(GENmodel *inModel, IFuid name, GENinstance **inst) MESdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
MESmodel *model = (MESmodel*)inModel; MESmodel *model = (MESmodel *) inModel;
MESinstance **fast = (MESinstance**)inst; MESinstance **fast = (MESinstance **) inst;
MESinstance **prev = NULL; MESinstance **prev = NULL;
MESinstance *here; MESinstance *here;
for( ; model ; model = model->MESnextModel) { for (; model; model = model->MESnextModel) {
prev = &(model->MESinstances); prev = &(model->MESinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->MESname == name || (fast && here==*fast) ) { if (here->MESname == name || (fast && here == *fast)) {
*prev= here->MESnextInstance; *prev = here->MESnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->MESnextInstance); prev = &(here->MESnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,9 +2,10 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 S. Hwang Author: 1985 S. Hwang
**********/ **********/
/* /*
Imported into mesa model: 2001 Paolo Nenzi Imported into mesa model: 2001 Paolo Nenzi
*/ */
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "mesadefs.h" #include "mesadefs.h"
@ -15,21 +16,22 @@ Imported into mesa model: 2001 Paolo Nenzi
int int
MESAdelete(GENmodel *inModel, IFuid name, GENinstance **inst) MESAdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
MESAmodel *model = (MESAmodel*)inModel; MESAmodel *model = (MESAmodel *) inModel;
MESAinstance **fast = (MESAinstance**)inst; MESAinstance **fast = (MESAinstance **) inst;
MESAinstance **prev = NULL; MESAinstance **prev = NULL;
MESAinstance *here; MESAinstance *here;
for( ; model ; model = model->MESAnextModel) { for (; model; model = model->MESAnextModel) {
prev = &(model->MESAinstances); prev = &(model->MESAinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->MESAname == name || (fast && here==*fast) ) { if (here->MESAname == name || (fast && here == *fast)) {
*prev= here->MESAnextInstance; *prev = here->MESAnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->MESAnextInstance); prev = &(here->MESAnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "mos1defs.h" #include "mos1defs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
MOS1delete(GENmodel *inModel, IFuid name, GENinstance **inst) MOS1delete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
MOS1model *model = (MOS1model *)inModel; MOS1model *model = (MOS1model *) inModel;
MOS1instance **fast = (MOS1instance **)inst; MOS1instance **fast = (MOS1instance **) inst;
MOS1instance **prev = NULL; MOS1instance **prev = NULL;
MOS1instance *here; MOS1instance *here;
for( ; model ; model = model->MOS1nextModel) { for (; model; model = model->MOS1nextModel) {
prev = &(model->MOS1instances); prev = &(model->MOS1instances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->MOS1name == name || (fast && here==*fast) ) { if (here->MOS1name == name || (fast && here == *fast)) {
*prev= here->MOS1nextInstance; *prev = here->MOS1nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->MOS1nextInstance); prev = &(here->MOS1nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "mos2defs.h" #include "mos2defs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
MOS2delete(GENmodel *inModel, IFuid name, GENinstance **inst) MOS2delete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
MOS2model *model = (MOS2model *)inModel; MOS2model *model = (MOS2model *) inModel;
MOS2instance **fast = (MOS2instance **)inst; MOS2instance **fast = (MOS2instance **) inst;
MOS2instance **prev = NULL; MOS2instance **prev = NULL;
MOS2instance *here; MOS2instance *here;
for( ; model ; model = model->MOS2nextModel) { for (; model; model = model->MOS2nextModel) {
prev = &(model->MOS2instances); prev = &(model->MOS2instances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->MOS2name == name || (fast && here==*fast) ) { if (here->MOS2name == name || (fast && here == *fast)) {
*prev= here->MOS2nextInstance; *prev = here->MOS2nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->MOS2nextInstance); prev = &(here->MOS2nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "mos3defs.h" #include "mos3defs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
MOS3delete(GENmodel *inModel, IFuid name, GENinstance **inst) MOS3delete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
MOS3model *model = (MOS3model *)inModel; MOS3model *model = (MOS3model *) inModel;
MOS3instance **fast = (MOS3instance **)inst; MOS3instance **fast = (MOS3instance **) inst;
MOS3instance **prev = NULL; MOS3instance **prev = NULL;
MOS3instance *here; MOS3instance *here;
for( ; model ; model = model->MOS3nextModel) { for (; model; model = model->MOS3nextModel) {
prev = &(model->MOS3instances); prev = &(model->MOS3instances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->MOS3name == name || (fast && here==*fast) ) { if (here->MOS3name == name || (fast && here == *fast)) {
*prev= here->MOS3nextInstance; *prev = here->MOS3nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->MOS3nextInstance); prev = &(here->MOS3nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
Modified: Alan Gillespie Modified: Alan Gillespie
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "mos9defs.h" #include "mos9defs.h"
@ -15,21 +13,22 @@ Modified: Alan Gillespie
int int
MOS9delete(GENmodel *inModel, IFuid name, GENinstance **inst) MOS9delete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
MOS9model *model = (MOS9model *)inModel; MOS9model *model = (MOS9model *) inModel;
MOS9instance **fast = (MOS9instance **)inst; MOS9instance **fast = (MOS9instance **) inst;
MOS9instance **prev = NULL; MOS9instance **prev = NULL;
MOS9instance *here; MOS9instance *here;
for( ; model ; model = model->MOS9nextModel) { for (; model; model = model->MOS9nextModel) {
prev = &(model->MOS9instances); prev = &(model->MOS9instances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->MOS9name == name || (fast && here==*fast) ) { if (here->MOS9name == name || (fast && here == *fast)) {
*prev= here->MOS9nextInstance; *prev = here->MOS9nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->MOS9nextInstance); prev = &(here->MOS9nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -1,6 +1,6 @@
/********** /**********
Copyright 1992 Regents of the University of California. All rights reserved. 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/sperror.h"
#include "ngspice/suffix.h" #include "ngspice/suffix.h"
int int
NBJTdelete(GENmodel *inModel, IFuid name, GENinstance **kill) NBJTdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
NBJTmodel *model = (NBJTmodel *) inModel; NBJTmodel *model = (NBJTmodel *) inModel;
NBJTinstance **fast = (NBJTinstance **) kill; NBJTinstance **fast = (NBJTinstance **) kill;
NBJTinstance **prev = NULL; NBJTinstance **prev = NULL;
NBJTinstance *inst; NBJTinstance *inst;
for (; model; model = model->NBJTnextModel) { for (; model; model = model->NBJTnextModel) {
prev = &(model->NBJTinstances); prev = &(model->NBJTinstances);
for (inst = *prev; inst; inst = *prev) { for (inst = *prev; inst; inst = *prev) {
if (inst->NBJTname == name || (fast && inst == *fast)) { if (inst->NBJTname == name || (fast && inst == *fast)) {
*prev = inst->NBJTnextInstance; *prev = inst->NBJTnextInstance;
FREE(inst); FREE(inst);
return (OK); return OK;
} }
prev = &(inst->NBJTnextInstance); prev = &(inst->NBJTnextInstance);
}
} }
}
return (E_NODEV); return E_NODEV;
} }

View File

@ -1,6 +1,6 @@
/********** /**********
Copyright 1992 Regents of the University of California. All rights reserved. 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/sperror.h"
#include "ngspice/suffix.h" #include "ngspice/suffix.h"
int int
NBJT2delete(GENmodel *inModel, IFuid name, GENinstance **kill) NBJT2delete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
NBJT2model *model = (NBJT2model *) inModel;
NBJT2instance **fast = (NBJT2instance **) kill;
NBJT2instance **prev = NULL;
NBJT2instance *inst;
NBJT2model *model = (NBJT2model *) inModel; for (; model; model = model->NBJT2nextModel) {
NBJT2instance **fast = (NBJT2instance **) kill; prev = &(model->NBJT2instances);
NBJT2instance **prev = NULL; for (inst = *prev; inst; inst = *prev) {
NBJT2instance *inst; if (inst->NBJT2name == name || (fast && inst == *fast)) {
*prev = inst->NBJT2nextInstance;
for (; model; model = model->NBJT2nextModel) { FREE(inst);
prev = &(model->NBJT2instances); return OK;
for (inst = *prev; inst; inst = *prev) { }
if (inst->NBJT2name == name || (fast && inst == *fast)) { prev = &(inst->NBJT2nextInstance);
*prev = inst->NBJT2nextInstance; }
FREE(inst);
return (OK);
}
prev = &(inst->NBJT2nextInstance);
} }
}
return (E_NODEV); return E_NODEV;
} }

View File

@ -1,6 +1,6 @@
/********** /**********
Permit to use it as your wish. Permit to use it as your wish.
Author: 2007 Gong Ding, gdiso@ustc.edu Author: 2007 Gong Ding, gdiso@ustc.edu
University of Science and Technology of China University of Science and Technology of China
**********/ **********/
@ -9,29 +9,30 @@ University of Science and Technology of China
#include "ngspice/sperror.h" #include "ngspice/sperror.h"
#include "ngspice/suffix.h" #include "ngspice/suffix.h"
int int
NDEVdelete( NDEVdelete(
GENmodel *inModel, GENmodel *inModel,
IFuid name, IFuid name,
GENinstance **kill ) GENinstance **kill)
{ {
NDEVmodel *model = (NDEVmodel *)inModel; NDEVmodel *model = (NDEVmodel *) inModel;
NDEVinstance **fast = (NDEVinstance **)kill; NDEVinstance **fast = (NDEVinstance **) kill;
NDEVinstance **prev = NULL; NDEVinstance **prev = NULL;
NDEVinstance *here; NDEVinstance *here;
for( ; model ; model = model->NDEVnextModel) { for (; model; model = model->NDEVnextModel) {
prev = &(model->NDEVinstances); prev = &(model->NDEVinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->NDEVname == name || (fast && here==*fast) ) { if (here->NDEVname == name || (fast && here == *fast)) {
*prev= here->NDEVnextInstance; *prev = here->NDEVnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->NDEVnextInstance); prev = &(here->NDEVnextInstance);
} }
} }
return (E_NODEV); return E_NODEV;
} }

View File

@ -1,6 +1,6 @@
/********** /**********
Copyright 1992 Regents of the University of California. All rights reserved. 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" #include "ngspice/ngspice.h"
@ -8,25 +8,26 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group
#include "ngspice/sperror.h" #include "ngspice/sperror.h"
#include "ngspice/suffix.h" #include "ngspice/suffix.h"
int int
NUMDdelete(GENmodel *inModel, IFuid name, GENinstance **kill) NUMDdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
NUMDmodel *model = (NUMDmodel *) inModel;
NUMDinstance **fast = (NUMDinstance **) kill;
NUMDinstance **prev = NULL;
NUMDinstance *inst;
NUMDmodel *model = (NUMDmodel *) inModel; for (; model; model = model->NUMDnextModel) {
NUMDinstance **fast = (NUMDinstance **) kill; prev = &(model->NUMDinstances);
NUMDinstance **prev = NULL; for (inst = *prev; inst; inst = *prev) {
NUMDinstance *inst; if (inst->NUMDname == name || (fast && inst == *fast)) {
*prev = inst->NUMDnextInstance;
for (; model; model = model->NUMDnextModel) { FREE(inst);
prev = &(model->NUMDinstances); return OK;
for (inst = *prev; inst; inst = *prev) { }
if (inst->NUMDname == name || (fast && inst == *fast)) { prev = &(inst->NUMDnextInstance);
*prev = inst->NUMDnextInstance; }
FREE(inst);
return (OK);
}
prev = &(inst->NUMDnextInstance);
} }
}
return (E_NODEV); return E_NODEV;
} }

View File

@ -1,6 +1,6 @@
/********** /**********
Copyright 1992 Regents of the University of California. All rights reserved. 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" #include "ngspice/ngspice.h"
@ -8,24 +8,26 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group
#include "ngspice/sperror.h" #include "ngspice/sperror.h"
#include "ngspice/suffix.h" #include "ngspice/suffix.h"
int int
NUMD2delete(GENmodel *inModel, IFuid name, GENinstance **kill) NUMD2delete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
NUMD2model *model = (NUMD2model *) inModel; NUMD2model *model = (NUMD2model *) inModel;
NUMD2instance **fast = (NUMD2instance **) kill; NUMD2instance **fast = (NUMD2instance **) kill;
NUMD2instance **prev = NULL; NUMD2instance **prev = NULL;
NUMD2instance *inst; NUMD2instance *inst;
for (; model; model = model->NUMD2nextModel) { for (; model; model = model->NUMD2nextModel) {
prev = &(model->NUMD2instances); prev = &(model->NUMD2instances);
for (inst = *prev; inst; inst = *prev) { for (inst = *prev; inst; inst = *prev) {
if (inst->NUMD2name == name || (fast && inst == *fast)) { if (inst->NUMD2name == name || (fast && inst == *fast)) {
*prev = inst->NUMD2nextInstance; *prev = inst->NUMD2nextInstance;
FREE(inst); FREE(inst);
return (OK); return OK;
} }
prev = &(inst->NUMD2nextInstance); prev = &(inst->NUMD2nextInstance);
}
} }
}
return (E_NODEV); return E_NODEV;
} }

View File

@ -1,6 +1,6 @@
/********** /**********
Copyright 1991 Regents of the University of California. All rights reserved. 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/sperror.h"
#include "ngspice/suffix.h" #include "ngspice/suffix.h"
int int
NUMOSdelete(GENmodel *inModel, IFuid name, GENinstance **kill) NUMOSdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
NUMOSmodel *model = (NUMOSmodel *) inModel;
NUMOSinstance **fast = (NUMOSinstance **) kill;
NUMOSinstance **prev = NULL;
NUMOSinstance *inst;
NUMOSmodel *model = (NUMOSmodel *) inModel; for (; model; model = model->NUMOSnextModel) {
NUMOSinstance **fast = (NUMOSinstance **) kill; prev = &(model->NUMOSinstances);
NUMOSinstance **prev = NULL; for (inst = *prev; inst; inst = *prev) {
NUMOSinstance *inst; if (inst->NUMOSname == name || (fast && inst == *fast)) {
*prev = inst->NUMOSnextInstance;
for (; model; model = model->NUMOSnextModel) { FREE(inst);
prev = &(model->NUMOSinstances); return OK;
for (inst = *prev; inst; inst = *prev) { }
if (inst->NUMOSname == name || (fast && inst == *fast)) { prev = &(inst->NUMOSnextInstance);
*prev = inst->NUMOSnextInstance; }
FREE(inst);
return (OK);
}
prev = &(inst->NUMOSnextInstance);
} }
}
return (E_NODEV); return E_NODEV;
} }

View File

@ -3,8 +3,6 @@ Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
Modified: Apr 2000 - Paolo Nenzi Modified: Apr 2000 - Paolo Nenzi
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "resdefs.h" #include "resdefs.h"
@ -14,21 +12,22 @@ Modified: Apr 2000 - Paolo Nenzi
int int
RESdelete(GENmodel *inModel, IFuid name, GENinstance **inst) RESdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
RESmodel *model = (RESmodel *)inModel; RESmodel *model = (RESmodel *) inModel;
RESinstance **fast = (RESinstance **)inst; RESinstance **fast = (RESinstance **) inst;
RESinstance **prev = NULL; RESinstance **prev = NULL;
RESinstance *here; RESinstance *here;
for( ; model ; model = model->RESnextModel) { for (; model; model = model->RESnextModel) {
prev = &(model->RESinstances); prev = &(model->RESinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->RESname == name || (fast && here==*fast) ) { if (here->RESname == name || (fast && here == *fast)) {
*prev= here->RESnextInstance; *prev = here->RESnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->RESnextInstance); prev = &(here->RESnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -16,8 +16,8 @@ Acknowledgements : Rupert Howes and Pete Mole.
**********/ **********/
/********** /**********
Modified by Paolo Nenzi 2002 Modified by Paolo Nenzi 2002
ngspice integration ngspice integration
**********/ **********/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
@ -29,21 +29,22 @@ ngspice integration
int int
SOI3delete(GENmodel *inModel, IFuid name, GENinstance **inst) SOI3delete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
SOI3model *model = (SOI3model *)inModel; SOI3model *model = (SOI3model *) inModel;
SOI3instance **fast = (SOI3instance **)inst; SOI3instance **fast = (SOI3instance **) inst;
SOI3instance **prev = NULL; SOI3instance **prev = NULL;
SOI3instance *here; SOI3instance *here;
for( ; model ; model = model->SOI3nextModel) { for (; model; model = model->SOI3nextModel) {
prev = &(model->SOI3instances); prev = &(model->SOI3instances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->SOI3name == name || (fast && here==*fast) ) { if (here->SOI3name == name || (fast && here == *fast)) {
*prev= here->SOI3nextInstance; *prev = here->SOI3nextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->SOI3nextInstance); prev = &(here->SOI3nextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Gordon Jacobs Author: 1985 Gordon Jacobs
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "swdefs.h" #include "swdefs.h"
@ -14,21 +12,22 @@ Author: 1985 Gordon Jacobs
int int
SWdelete(GENmodel *inModel, IFuid name, GENinstance **inst) SWdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
SWmodel *model = (SWmodel *)inModel; SWmodel *model = (SWmodel *) inModel;
SWinstance **fast = (SWinstance **)inst; SWinstance **fast = (SWinstance **) inst;
SWinstance **prev = NULL; SWinstance **prev = NULL;
SWinstance *here; SWinstance *here;
for( ; model ; model = model->SWnextModel) { for (; model; model = model->SWnextModel) {
prev = &(model->SWinstances); prev = &(model->SWinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->SWname == name || (fast && here==*fast) ) { if (here->SWname == name || (fast && here == *fast)) {
*prev= here->SWnextInstance; *prev = here->SWnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->SWnextInstance); prev = &(here->SWnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "tradefs.h" #include "tradefs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
TRAdelete(GENmodel *inModel, IFuid name, GENinstance **kill) TRAdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
TRAinstance **fast = (TRAinstance **)kill; TRAinstance **fast = (TRAinstance **) kill;
TRAmodel *model = (TRAmodel *)inModel; TRAmodel *model = (TRAmodel *) inModel;
TRAinstance **prev = NULL; TRAinstance **prev = NULL;
TRAinstance *here; TRAinstance *here;
for( ; model ; model = model->TRAnextModel) { for (; model; model = model->TRAnextModel) {
prev = &(model->TRAinstances); prev = &(model->TRAinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->TRAname == name || (fast && here==*fast) ) { if (here->TRAname == name || (fast && here == *fast)) {
*prev= here->TRAnextInstance; *prev = here->TRAnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->TRAnextInstance); prev = &(here->TRAnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -4,7 +4,6 @@ reserved.
Author: 1992 Charles Hough Author: 1992 Charles Hough
**********/ **********/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "txldefs.h" #include "txldefs.h"
#include "ngspice/sperror.h" #include "ngspice/sperror.h"
@ -14,21 +13,22 @@ Author: 1992 Charles Hough
int int
TXLdelete(GENmodel *inModel, IFuid name, GENinstance **inst) TXLdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
TXLmodel *model = (TXLmodel *)inModel; TXLmodel *model = (TXLmodel *) inModel;
TXLinstance **fast = (TXLinstance **)inst; TXLinstance **fast = (TXLinstance **) inst;
TXLinstance **prev = NULL; TXLinstance **prev = NULL;
TXLinstance *here; TXLinstance *here;
for( ; model ; model = model->TXLnextModel) { for (; model; model = model->TXLnextModel) {
prev = &(model->TXLinstances); prev = &(model->TXLinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->TXLname == name || (fast && here==*fast) ) { if (here->TXLname == name || (fast && here == *fast)) {
*prev= here->TXLnextInstance; *prev = here->TXLnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->TXLnextInstance); prev = &(here->TXLnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1987 Thomas L. Quarles Author: 1987 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "urcdefs.h" #include "urcdefs.h"
@ -14,21 +12,22 @@ Author: 1987 Thomas L. Quarles
int int
URCdelete(GENmodel *inModel, IFuid name, GENinstance **inst) URCdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
URCmodel *model = (URCmodel *)inModel; URCmodel *model = (URCmodel *) inModel;
URCinstance **fast = (URCinstance**)inst; URCinstance **fast = (URCinstance **) inst;
URCinstance **prev = NULL; URCinstance **prev = NULL;
URCinstance *here; URCinstance *here;
for( ; model ; model = model->URCnextModel) { for (; model; model = model->URCnextModel) {
prev = &(model->URCinstances); prev = &(model->URCinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->URCname == name || (fast && here==*fast) ) { if (here->URCname == name || (fast && here == *fast)) {
*prev= here->URCnextInstance; *prev = here->URCnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->URCnextInstance); prev = &(here->URCnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -19,22 +19,22 @@ Spice3 Implementation: 2003 Dietmar Warning DAnalyse GmbH
int int
VBICdelete(GENmodel *inModel, IFuid name, GENinstance **kill) VBICdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
{ {
VBICmodel *model = (VBICmodel*)inModel; VBICmodel *model = (VBICmodel *) inModel;
VBICinstance **fast = (VBICinstance**)kill; VBICinstance **fast = (VBICinstance **) kill;
VBICinstance **prev = NULL; VBICinstance **prev = NULL;
VBICinstance *here; VBICinstance *here;
for( ; model ; model = model->VBICnextModel) { for (; model; model = model->VBICnextModel) {
prev = &(model->VBICinstances); prev = &(model->VBICinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->VBICname == name || (fast && here==*fast) ) { if (here->VBICname == name || (fast && here == *fast)) {
*prev= here->VBICnextInstance; *prev = here->VBICnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->VBICnextInstance); prev = &(here->VBICnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "vccsdefs.h" #include "vccsdefs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
VCCSdelete(GENmodel *inModel, IFuid name, GENinstance **inst) VCCSdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
VCCSmodel *model = (VCCSmodel *)inModel; VCCSmodel *model = (VCCSmodel *) inModel;
VCCSinstance **fast = (VCCSinstance**)inst; VCCSinstance **fast = (VCCSinstance **) inst;
VCCSinstance **prev = NULL; VCCSinstance **prev = NULL;
VCCSinstance *here; VCCSinstance *here;
for( ; model ; model = model->VCCSnextModel) { for (; model; model = model->VCCSnextModel) {
prev = &(model->VCCSinstances); prev = &(model->VCCSinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->VCCSname == name || (fast && here==*fast) ) { if (here->VCCSname == name || (fast && here == *fast)) {
*prev= here->VCCSnextInstance; *prev = here->VCCSnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->VCCSnextInstance); prev = &(here->VCCSnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "vcvsdefs.h" #include "vcvsdefs.h"
@ -14,21 +12,22 @@ Author: 1985 Thomas L. Quarles
int int
VCVSdelete(GENmodel *inModel, IFuid name, GENinstance **inst) VCVSdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
{ {
VCVSmodel *model = (VCVSmodel *)inModel; VCVSmodel *model = (VCVSmodel *) inModel;
VCVSinstance **fast = (VCVSinstance**)inst; VCVSinstance **fast = (VCVSinstance **) inst;
VCVSinstance **prev = NULL; VCVSinstance **prev = NULL;
VCVSinstance *here; VCVSinstance *here;
for( ; model ; model = model->VCVSnextModel) { for (; model; model = model->VCVSnextModel) {
prev = &(model->VCVSinstances); prev = &(model->VCVSinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->VCVSname == name || (fast && here==*fast) ) { if (here->VCVSname == name || (fast && here == *fast)) {
*prev= here->VCVSnextInstance; *prev = here->VCVSnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->VCVSnextInstance); prev = &(here->VCVSnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }

View File

@ -2,8 +2,6 @@
Copyright 1990 Regents of the University of California. All rights reserved. Copyright 1990 Regents of the University of California. All rights reserved.
Author: 1985 Thomas L. Quarles Author: 1985 Thomas L. Quarles
**********/ **********/
/*
*/
#include "ngspice/ngspice.h" #include "ngspice/ngspice.h"
#include "vsrcdefs.h" #include "vsrcdefs.h"
@ -19,16 +17,17 @@ VSRCdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
VSRCinstance **prev = NULL; VSRCinstance **prev = NULL;
VSRCinstance *here; VSRCinstance *here;
for( ; model ; model = model->VSRCnextModel) { for (; model; model = model->VSRCnextModel) {
prev = &(model->VSRCinstances); prev = &(model->VSRCinstances);
for(here = *prev; here ; here = *prev) { for (here = *prev; here; here = *prev) {
if(here->VSRCname == name || (fast && here==*fast) ) { if (here->VSRCname == name || (fast && here == *fast)) {
*prev= here->VSRCnextInstance; *prev = here->VSRCnextInstance;
FREE(here); FREE(here);
return(OK); return OK;
} }
prev = &(here->VSRCnextInstance); prev = &(here->VSRCnextInstance);
} }
} }
return(E_NODEV);
return E_NODEV;
} }