diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index dfa6c08e6..597b9b4ff 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -614,8 +614,7 @@ finddev_special( int err; int type = -1; - // assert(third && *third == NULL); for all invocations - *devptr = ft_sim->findInstance (ckt, NULL, NULL, name); + *devptr = ft_sim->findInstance (ckt, name); if (*devptr) { *device_or_model = 0; return (*devptr)->GENmodPtr->GENmodType; @@ -1216,8 +1215,7 @@ finddev(CKTcircuit *ckt, char *name, GENinstance **devptr, GENmodel **modptr) int err; int type = -1; - // assert(third && *third == NULL); for all invocations - *devptr = ft_sim->findInstance (ckt, NULL, NULL, name); + *devptr = ft_sim->findInstance (ckt, name); if (*devptr) return (*devptr)->GENmodPtr->GENmodType; diff --git a/src/include/ngspice/cktdefs.h b/src/include/ngspice/cktdefs.h index dbf70f556..4c3d85717 100644 --- a/src/include/ngspice/cktdefs.h +++ b/src/include/ngspice/cktdefs.h @@ -319,7 +319,7 @@ extern void NDEVacct(CKTcircuit *ckt, FILE *file); extern void CKTncDump(CKTcircuit *); extern int CKTfndAnal(CKTcircuit *, int *, JOB **, IFuid , TSKtask *, IFuid); extern int CKTfndBranch(CKTcircuit *, IFuid); -extern GENinstance *CKTfndDev(CKTcircuit *, int *, GENinstance **, IFuid); +extern GENinstance *CKTfndDev(CKTcircuit *, IFuid); extern int CKTfndMod(CKTcircuit *, int *, GENmodel **, IFuid); extern int CKTfndNode(CKTcircuit *, CKTnode **, IFuid); extern int CKTfndTask(CKTcircuit *, TSKtask **, IFuid ); diff --git a/src/include/ngspice/ifsim.h b/src/include/ngspice/ifsim.h index 2f58a7ca4..b2cc74703 100644 --- a/src/include/ngspice/ifsim.h +++ b/src/include/ngspice/ifsim.h @@ -370,7 +370,7 @@ struct IFsimulator { /* set a parameter on an instance */ int (*askInstanceQuest) (CKTcircuit *, GENinstance *, int, IFvalue *, IFvalue *); /* ask a question about an instance */ - GENinstance *(*findInstance) (CKTcircuit *, int *, GENinstance **, IFuid); + GENinstance *(*findInstance) (CKTcircuit *, IFuid); /* find a specific instance */ int (*deleteInstance) (CKTcircuit *, void *); /* delete an instance from the circuit */ diff --git a/src/spicelib/analysis/noisean.c b/src/spicelib/analysis/noisean.c index 098bce2ed..e387184ca 100644 --- a/src/spicelib/analysis/noisean.c +++ b/src/spicelib/analysis/noisean.c @@ -48,8 +48,7 @@ NOISEan (CKTcircuit *ckt, int restart) inst = NULL; code = CKTtypelook("Vsource"); if (code != -1) { - // assert(third && *third == NULL); - inst = CKTfndDev(ckt, NULL, NULL, job->input); + inst = CKTfndDev(ckt, job->input); if (inst && !((VSRCinstance *)inst)->VSRCacGiven) { errMsg = TMALLOC(char, strlen(noacinput) + 1); strcpy(errMsg,noacinput); @@ -59,8 +58,7 @@ NOISEan (CKTcircuit *ckt, int restart) code = CKTtypelook("Isource"); if (code != -1 && inst==NULL) { - // assert(third && *third == NULL); - inst = CKTfndDev(ckt, NULL, NULL, job->input); + inst = CKTfndDev(ckt, job->input); if (!inst) { /* XXX ??? */ SPfrontEnd->IFerror (ERR_WARNING, diff --git a/src/spicelib/analysis/tfanal.c b/src/spicelib/analysis/tfanal.c index 05336f5be..c22d47f77 100644 --- a/src/spicelib/analysis/tfanal.c +++ b/src/spicelib/analysis/tfanal.c @@ -51,8 +51,7 @@ TFanal(CKTcircuit *ckt, int restart) Itype = CKTtypelook("Isource"); Vtype = CKTtypelook("Vsource"); if(Itype != -1) { - // assert(third && *third == NULL); - ptr = CKTfndDev(ckt, NULL, NULL, job->TFinSrc); + ptr = CKTfndDev(ckt, job->TFinSrc); if (ptr) { job->TFinIsI = 1; job->TFinIsV = 0; @@ -62,8 +61,7 @@ TFanal(CKTcircuit *ckt, int restart) } if( (Vtype != -1) && (ptr==NULL) ) { - // assert(third && *third == NULL); - ptr = CKTfndDev(ckt, NULL, NULL, job->TFinSrc); + ptr = CKTfndDev(ckt, job->TFinSrc); job->TFinIsV = 1; job->TFinIsI = 0; if (!ptr) { diff --git a/src/spicelib/devices/cktcrte.c b/src/spicelib/devices/cktcrte.c index 73cf24fb7..ef733ab8c 100644 --- a/src/spicelib/devices/cktcrte.c +++ b/src/spicelib/devices/cktcrte.c @@ -28,8 +28,7 @@ CKTcrtElt(CKTcircuit *ckt, GENmodel *modPtr, GENinstance **inInstPtr, IFuid name if(!modPtr) return E_NOMOD; - // assert(third && *third == NULL); - instPtr = CKTfndDev(ckt, NULL, NULL, name); + instPtr = CKTfndDev(ckt, name); if (instPtr) { if (inInstPtr) diff --git a/src/spicelib/devices/cktfinddev.c b/src/spicelib/devices/cktfinddev.c index 2e44130a9..a1dcd169b 100644 --- a/src/spicelib/devices/cktfinddev.c +++ b/src/spicelib/devices/cktfinddev.c @@ -11,27 +11,13 @@ Author: 1985 Thomas L. Quarles GENinstance * -CKTfndDev(CKTcircuit *ckt, int *type, GENinstance **fast, IFuid name) +CKTfndDev(CKTcircuit *ckt, IFuid name) { GENinstance *here; - /* we know the device instance `fast' */ - if (fast && *fast) { - if (type) - *type = (*fast)->GENmodPtr->GENmodType; - return *fast; - } - here = nghash_find(ckt->DEVnameHash, name); if (here) { - - if (fast) - *fast = here; - - if (type) - *type = here->GENmodPtr->GENmodType; - return here; } diff --git a/src/spicelib/devices/ind/mutsetup.c b/src/spicelib/devices/ind/mutsetup.c index 9960b0c7c..3ddad1ce4 100644 --- a/src/spicelib/devices/ind/mutsetup.c +++ b/src/spicelib/devices/ind/mutsetup.c @@ -42,9 +42,8 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) return(E_INTERN); } - // assert(third); if (!here->MUTind1) - here->MUTind1 = (INDinstance *) CKTfndDev(ckt, NULL, NULL, here->MUTindName1); + here->MUTind1 = (INDinstance *) CKTfndDev(ckt, here->MUTindName1); if (!here->MUTind1) { IFuid namarray[2]; namarray[0]=here->MUTname; @@ -53,9 +52,8 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) "%s: coupling to non-existant inductor %s.", namarray); } - // assert(third); if (!here->MUTind2) - here->MUTind2 = (INDinstance *) CKTfndDev(ckt, NULL, NULL, here->MUTindName2); + here->MUTind2 = (INDinstance *) CKTfndDev(ckt, here->MUTindName2); if (!here->MUTind2) { IFuid namarray[2]; namarray[0]=here->MUTname; diff --git a/src/spicelib/parser/inpaname.c b/src/spicelib/parser/inpaname.c index 08dfa47a9..c9d294b46 100644 --- a/src/spicelib/parser/inpaname.c +++ b/src/spicelib/parser/inpaname.c @@ -40,9 +40,8 @@ INPaName(char *parm, IFvalue * val, CKTcircuit *ckt, int *dev, char *devnam, * (name, type, direct pointer) - the type and direct pointer * WILL be set on return unless error is not OK */ - // assert(third) for all invocations if (*fast == NULL) - *fast = sim->findInstance (ckt, NULL, NULL, devnam); + *fast = sim->findInstance (ckt, devnam); if (*fast == NULL) return (E_NODEV); diff --git a/src/tclspice.c b/src/tclspice.c index 475563461..057ce299f 100644 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -1394,8 +1394,7 @@ get_mod_param TCL_CMDPROCARGS(clientData, interp, argc, argv) /* get the unique IFuid for name (device/model) */ INPretrieve(&name, ft_curckt->ci_symtab); - // assert(third && *third == NULL); - devptr = ft_sim->findInstance (ft_curckt->ci_ckt, NULL, NULL, name); + devptr = ft_sim->findInstance (ft_curckt->ci_ckt, name); if (!devptr) { typecode = -1; devptr = NULL; diff --git a/src/unsupported/snstart.c b/src/unsupported/snstart.c index c67bdc450..43dc561ae 100644 --- a/src/unsupported/snstart.c +++ b/src/unsupported/snstart.c @@ -42,8 +42,7 @@ SENstartup(CKTcircuit *ckt, int restart) type = -1; fast = NULL; - // assert(third && *third == NULL); - fast = CKTfndDev(ckt, NULL, NULL, ckt->CKTsenInfo->SENdevices[i]); + fast = CKTfndDev(ckt, ckt->CKTsenInfo->SENdevices[i]); if (!fast) return E_NODEV;