CKTfndDev(), drop `type' and `fast' argument

This commit is contained in:
rlar 2013-07-17 20:28:42 +02:00
parent 6a9a246526
commit ddc78067cc
11 changed files with 15 additions and 41 deletions

View File

@ -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;

View File

@ -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 );

View File

@ -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 */

View File

@ -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,

View File

@ -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) {

View File

@ -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)

View File

@ -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;
}

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;