diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index e59c547f7..e3aa65f60 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -611,19 +611,15 @@ finddev_special( GENmodel **modptr, int *device_or_model) { - int type = -1; - *devptr = ft_sim->findInstance (ckt, name); if (*devptr) { *device_or_model = 0; return (*devptr)->GENmodPtr->GENmodType; } - type = -1; - // assert(second && *second == -1) // assert(third && *third == NULL) - *modptr = ft_sim->findModel (ckt, type, modptr, name); + *modptr = ft_sim->findModel (ckt, -1, NULL, name); if (*modptr) { *device_or_model = 1; return (*modptr)->GENmodType; @@ -1211,17 +1207,13 @@ doset(CKTcircuit *ckt, int typecode, GENinstance *dev, GENmodel *mod, IFparm *op static int finddev(CKTcircuit *ckt, char *name, GENinstance **devptr, GENmodel **modptr) { - int type = -1; - *devptr = ft_sim->findInstance (ckt, name); if (*devptr) return (*devptr)->GENmodPtr->GENmodType; - type = -1; - // assert(second && *second == -1) // assert(third && *third == NULL) - *modptr = ft_sim->findModel (ckt, type, modptr, name); + *modptr = ft_sim->findModel (ckt, -1, modptr, name); if (*modptr) return (*modptr)->GENmodType; diff --git a/src/spicelib/analysis/cktmcrt.c b/src/spicelib/analysis/cktmcrt.c index 8a79a063c..e60daa8ad 100644 --- a/src/spicelib/analysis/cktmcrt.c +++ b/src/spicelib/analysis/cktmcrt.c @@ -24,7 +24,7 @@ CKTmodCrt(CKTcircuit *ckt, int type, GENmodel **modfast, IFuid name) // assert(second) // assert(third && *third == NULL) - mymodfast = CKTfndMod(ckt, type, &mymodfast, name); + mymodfast = CKTfndMod(ckt, type, NULL, name); if(!mymodfast) { mymodfast = (GENmodel *) tmalloc((size_t) *(DEVices[type]->DEVmodSize)); if(mymodfast == NULL) return(E_NOMEM); diff --git a/src/spicelib/devices/urc/urcsetup.c b/src/spicelib/devices/urc/urcsetup.c index a27463cc9..ba1f6c3b3 100644 --- a/src/spicelib/devices/urc/urcsetup.c +++ b/src/spicelib/devices/urc/urcsetup.c @@ -280,7 +280,6 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt) URCmodel *model = (URCmodel *) inModel; GENinstance *in; GENmodel *modfast; - int type; /* Delete models, devices, and intermediate nodes; */ @@ -306,11 +305,9 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt) if (error && error != E_EXISTS) return error; - modfast = NULL; - type = -1; // assert(second && *second == -1) // assert(third && *third == NULL) - modfast = CKTfndMod(ckt, type, &modfast, varUid); + modfast = CKTfndMod(ckt, -1, NULL, varUid); if (!modfast) return E_NOMOD; @@ -325,11 +322,9 @@ URCunsetup(GENmodel *inModel, CKTcircuit *ckt) if (error && error != E_EXISTS) return error; - modfast = NULL; - type = -1; // assert(second && *second == -1) // assert(third && *third == NULL) - modfast = CKTfndMod(ckt, type, &modfast, varUid); + modfast = CKTfndMod(ckt, -1, NULL, varUid); if (!modfast) return E_NOMOD; CKTdltMod(ckt, modfast); diff --git a/src/tclspice.c b/src/tclspice.c index a3b711c0e..d572a96df 100644 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -1399,10 +1399,12 @@ get_mod_param TCL_CMDPROCARGS(clientData, interp, argc, argv) typecode = -1; // assert(second && *second == -1) // assert(third && *third == NULL) - modptr = ft_sim->findModel (ft_curckt->ci_ckt, typecode, &modptr, name); + modptr = ft_sim->findModel (ft_curckt->ci_ckt, -1, NULL, name); err = modptr ? OK : E_NOMOD; if (modptr) typecode = modptr->GENmodType; + else + typecode = -1; } else { typecode = devptr->GENmodPtr->GENmodType; err = OK;