From 113d4ede7a8dc7e9f50c887cdf8bf7eebcaa90a6 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 30 Jun 2013 20:24:21 +0200 Subject: [PATCH] CKTfndDev(), drop unused argument `modname' which is always NULL --- src/frontend/spiceif.c | 4 ++-- src/include/ngspice/cktdefs.h | 2 +- src/include/ngspice/ifsim.h | 2 +- src/spicelib/analysis/noisean.c | 4 ++-- src/spicelib/analysis/tfanal.c | 4 ++-- src/spicelib/devices/cktcrte.c | 2 +- src/spicelib/devices/cktfinddev.c | 10 +++------- src/spicelib/devices/ind/mutsetup.c | 4 ++-- src/spicelib/parser/inpaname.c | 2 +- src/tclspice.c | 2 +- src/unsupported/snstart.c | 2 +- 11 files changed, 17 insertions(+), 21 deletions(-) diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index b72060604..671f88da0 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -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); diff --git a/src/include/ngspice/cktdefs.h b/src/include/ngspice/cktdefs.h index 80ac6259e..2126aff36 100644 --- a/src/include/ngspice/cktdefs.h +++ b/src/include/ngspice/cktdefs.h @@ -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 ); diff --git a/src/include/ngspice/ifsim.h b/src/include/ngspice/ifsim.h index 47b328435..e24f4f111 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 */ - 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 */ diff --git a/src/spicelib/analysis/noisean.c b/src/spicelib/analysis/noisean.c index f42c6f33e..f154c08f3 100644 --- a/src/spicelib/analysis/noisean.c +++ b/src/spicelib/analysis/noisean.c @@ -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, diff --git a/src/spicelib/analysis/tfanal.c b/src/spicelib/analysis/tfanal.c index c29f32a5b..b1b2c7cda 100644 --- a/src/spicelib/analysis/tfanal.c +++ b/src/spicelib/analysis/tfanal.c @@ -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) { diff --git a/src/spicelib/devices/cktcrte.c b/src/spicelib/devices/cktcrte.c index 6a9bb0ddc..549287d9c 100644 --- a/src/spicelib/devices/cktcrte.c +++ b/src/spicelib/devices/cktcrte.c @@ -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) diff --git a/src/spicelib/devices/cktfinddev.c b/src/spicelib/devices/cktfinddev.c index 23087fafb..19359fe69 100644 --- a/src/spicelib/devices/cktfinddev.c +++ b/src/spicelib/devices/cktfinddev.c @@ -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; diff --git a/src/spicelib/devices/ind/mutsetup.c b/src/spicelib/devices/ind/mutsetup.c index 07f221ab1..ae7fc1cab 100644 --- a/src/spicelib/devices/ind/mutsetup.c +++ b/src/spicelib/devices/ind/mutsetup.c @@ -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]; diff --git a/src/spicelib/parser/inpaname.c b/src/spicelib/parser/inpaname.c index 2679835f9..ed8f65d45 100644 --- a/src/spicelib/parser/inpaname.c +++ b/src/spicelib/parser/inpaname.c @@ -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); diff --git a/src/tclspice.c b/src/tclspice.c index 4c3201c55..a5b323c2e 100644 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -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; diff --git a/src/unsupported/snstart.c b/src/unsupported/snstart.c index ce29683b1..c12af4560 100644 --- a/src/unsupported/snstart.c +++ b/src/unsupported/snstart.c @@ -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;