CKTfndDev(), drop unused argument `modname' which is always NULL

This commit is contained in:
rlar 2013-06-30 20:24:21 +02:00
parent 0cc59b1dc8
commit 113d4ede7a
11 changed files with 17 additions and 21 deletions

View File

@ -616,7 +616,7 @@ finddev_special(
int err;
int type = -1;
err = ft_sim->findInstance (ckt, &type, devptr, name, NULL, NULL);
err = ft_sim->findInstance (ckt, &type, devptr, name, NULL);
if (err == OK) {
*device_or_model = 0;
return (type);
@ -1217,7 +1217,7 @@ finddev(CKTcircuit *ckt, char *name, GENinstance **devptr, GENmodel **modptr)
int err;
int type = -1;
err = ft_sim->findInstance (ckt, &type, devptr, name, NULL, NULL);
err = ft_sim->findInstance (ckt, &type, devptr, name, NULL);
if (err == OK)
return (type);

View File

@ -316,7 +316,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 int CKTfndDev(CKTcircuit *, int *, GENinstance **, IFuid , GENmodel *, IFuid);
extern int CKTfndDev(CKTcircuit *, int *, GENinstance **, IFuid , GENmodel *);
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 */
int (*findInstance) (CKTcircuit *, int *, GENinstance **, IFuid, GENmodel *, IFuid);
int (*findInstance) (CKTcircuit *, int *, GENinstance **, IFuid, GENmodel *);
/* find a specific instance */
int (*deleteInstance) (CKTcircuit *, void *);
/* delete an instance from the circuit */

View File

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

View File

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

View File

@ -31,7 +31,7 @@ CKTcrtElt(CKTcircuit *ckt, GENmodel *modPtr, GENinstance **inInstPtr, IFuid name
type = modPtr->GENmodType;
error = CKTfndDev(ckt, &type, &instPtr, name, modPtr, NULL);
error = CKTfndDev(ckt, &type, &instPtr, name, modPtr);
if (error == OK) {
if (inInstPtr)

View File

@ -22,7 +22,7 @@ find_instance(GENinstance *here, IFuid name)
int
CKTfndDev(CKTcircuit *ckt, int *type, GENinstance **fast, IFuid name, GENmodel *modfast, IFuid modname)
CKTfndDev(CKTcircuit *ckt, int *type, GENinstance **fast, IFuid name, GENmodel *modfast)
{
GENinstance *here;
GENmodel *mods;
@ -54,16 +54,14 @@ CKTfndDev(CKTcircuit *ckt, int *type, GENinstance **fast, IFuid name, GENmodel *
/* look through all models */
for (mods = ckt->CKThead[*type]; mods ; mods = mods->GENnextModel) {
/* and all instances */
if (!modname || mods->GENmodName == modname) {
here = find_instance(mods->GENinstances, name);
if (here) {
if (fast)
*fast = here;
return OK;
}
if (mods->GENmodName == modname)
if (mods->GENmodName == NULL)
return E_NODEV;
}
}
return E_NOMOD;
}
@ -74,16 +72,14 @@ CKTfndDev(CKTcircuit *ckt, int *type, GENinstance **fast, IFuid name, GENmodel *
/* look through all models */
for (mods = ckt->CKThead[*type]; mods; mods = mods->GENnextModel) {
/* and all instances */
if (!modname || mods->GENmodName == modname) {
here = find_instance(mods->GENinstances, name);
if (here) {
if (fast)
*fast = here;
return OK;
}
if (mods->GENmodName == modname)
if (mods->GENmodName == NULL)
return E_NODEV;
}
}
}
*type = -1;

View File

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

View File

@ -40,7 +40,7 @@ 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
*/
error = sim->findInstance (ckt, dev, fast, devnam, NULL, NULL);
error = sim->findInstance (ckt, dev, fast, devnam, NULL);
if (error)
return (error);

View File

@ -1394,7 +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);
err = ft_sim->findInstance (ft_curckt->ci_ckt, &typecode, &devptr, name, NULL, NULL);
err = ft_sim->findInstance (ft_curckt->ci_ckt, &typecode, &devptr, name, NULL);
if (err != OK) {
typecode = -1;
devptr = NULL;

View File

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