cleanup CKTfndDev(), findInstance() invocation

This commit is contained in:
rlar 2013-06-30 20:24:13 +02:00
parent fa1d115ec2
commit 0cc59b1dc8
5 changed files with 8 additions and 18 deletions

View File

@ -47,8 +47,7 @@ NOISEan (CKTcircuit *ckt, int restart)
inst = NULL; inst = NULL;
code = CKTtypelook("Vsource"); code = CKTtypelook("Vsource");
if (code != -1) { if (code != -1) {
error = CKTfndDev(ckt, &code, &inst, error = CKTfndDev(ckt, &code, &inst, job->input, NULL, NULL);
job->input, NULL, NULL);
if (!error && !((VSRCinstance *)inst)->VSRCacGiven) { if (!error && !((VSRCinstance *)inst)->VSRCacGiven) {
errMsg = TMALLOC(char, strlen(noacinput) + 1); errMsg = TMALLOC(char, strlen(noacinput) + 1);
strcpy(errMsg,noacinput); strcpy(errMsg,noacinput);
@ -58,8 +57,7 @@ NOISEan (CKTcircuit *ckt, int restart)
code = CKTtypelook("Isource"); code = CKTtypelook("Isource");
if (code != -1 && inst==NULL) { if (code != -1 && inst==NULL) {
error = CKTfndDev(ckt, &code, &inst, error = CKTfndDev(ckt, &code, &inst, job->input, NULL, NULL);
job->input, NULL, NULL);
if (error) { if (error) {
/* XXX ??? */ /* XXX ??? */
SPfrontEnd->IFerror (ERR_WARNING, SPfrontEnd->IFerror (ERR_WARNING,

View File

@ -51,8 +51,7 @@ TFanal(CKTcircuit *ckt, int restart)
Itype = CKTtypelook("Isource"); Itype = CKTtypelook("Isource");
Vtype = CKTtypelook("Vsource"); Vtype = CKTtypelook("Vsource");
if(Itype != -1) { if(Itype != -1) {
error = CKTfndDev(ckt,&Itype,&ptr, error = CKTfndDev(ckt, &Itype, &ptr, job->TFinSrc, NULL, NULL);
job->TFinSrc, NULL, NULL);
if(error ==0) { if(error ==0) {
job->TFinIsI = 1; job->TFinIsI = 1;
job->TFinIsV = 0; job->TFinIsV = 0;
@ -62,9 +61,7 @@ TFanal(CKTcircuit *ckt, int restart)
} }
if( (Vtype != -1) && (ptr==NULL) ) { if( (Vtype != -1) && (ptr==NULL) ) {
error = CKTfndDev(ckt,&Vtype,&ptr, error = CKTfndDev(ckt, &Vtype, &ptr, job->TFinSrc, NULL, NULL);
job->TFinSrc, NULL,
NULL);
job->TFinIsV = 1; job->TFinIsV = 1;
job->TFinIsI = 0; job->TFinIsI = 0;
if(error !=0) { if(error !=0) {

View File

@ -43,8 +43,7 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
return(E_INTERN); return(E_INTERN);
} }
error = CKTfndDev(ckt,&ktype,(GENinstance **)&(here->MUTind1), error = CKTfndDev(ckt, &ktype, (GENinstance **) &(here->MUTind1), here->MUTindName1, NULL, NULL);
here->MUTindName1, NULL, NULL);
if(error && error!= E_NODEV && error != E_NOMOD) return(error); if(error && error!= E_NODEV && error != E_NOMOD) return(error);
if(error) { if(error) {
IFuid namarray[2]; IFuid namarray[2];
@ -54,8 +53,7 @@ MUTsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
"%s: coupling to non-existant inductor %s.", "%s: coupling to non-existant inductor %s.",
namarray); namarray);
} }
error = CKTfndDev(ckt,&ktype,(GENinstance **)&(here->MUTind2), error = CKTfndDev(ckt, &ktype, (GENinstance **) &(here->MUTind2), here->MUTindName2, NULL, NULL);
here->MUTindName2, NULL, NULL);
if(error && error!= E_NODEV && error != E_NOMOD) return(error); if(error && error!= E_NODEV && error != E_NOMOD) return(error);
if(error) { if(error) {
IFuid namarray[2]; IFuid namarray[2];

View File

@ -40,8 +40,7 @@ INPaName(char *parm, IFvalue * val, CKTcircuit *ckt, int *dev, char *devnam,
* (name, type, direct pointer) - the type and direct pointer * (name, type, direct pointer) - the type and direct pointer
* WILL be set on return unless error is not OK * WILL be set on return unless error is not OK
*/ */
error = sim->findInstance (ckt, dev, fast, devnam, NULL, error = sim->findInstance (ckt, dev, fast, devnam, NULL, NULL);
NULL);
if (error) if (error)
return (error); return (error);

View File

@ -43,9 +43,7 @@ SENstartup(CKTcircuit *ckt, int restart)
type = -1; type = -1;
fast = NULL; fast = NULL;
err = CKTfndDev(ckt, &type, &fast, err = CKTfndDev(ckt, &type, &fast, ckt->CKTsenInfo->SENdevices[i], NULL, NULL);
ckt->CKTsenInfo->SENdevices[i],
NULL, NULL);
if (err != OK) if (err != OK)
return err; return err;