From e79135c5560d93a3f308ea43f0f415140312c6db Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 17 Jul 2013 20:28:59 +0200 Subject: [PATCH] CKTfndDev(), cleanup --- src/frontend/spiceif.c | 2 -- src/spicelib/analysis/tfanal.c | 2 -- src/spicelib/devices/cktfinddev.c | 10 +--------- src/tclspice.c | 1 - src/unsupported/snstart.c | 2 -- 5 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/frontend/spiceif.c b/src/frontend/spiceif.c index 597b9b4ff..ae584b1f1 100644 --- a/src/frontend/spiceif.c +++ b/src/frontend/spiceif.c @@ -621,7 +621,6 @@ finddev_special( } type = -1; - *devptr = NULL; err = ft_sim->findModel (ckt, &type, modptr, name); if (err == OK) { @@ -1220,7 +1219,6 @@ finddev(CKTcircuit *ckt, char *name, GENinstance **devptr, GENmodel **modptr) return (*devptr)->GENmodPtr->GENmodType; type = -1; - *devptr = NULL; err = ft_sim->findModel (ckt, &type, modptr, name); if (err == OK) diff --git a/src/spicelib/analysis/tfanal.c b/src/spicelib/analysis/tfanal.c index c22d47f77..51028df8f 100644 --- a/src/spicelib/analysis/tfanal.c +++ b/src/spicelib/analysis/tfanal.c @@ -55,8 +55,6 @@ TFanal(CKTcircuit *ckt, int restart) if (ptr) { job->TFinIsI = 1; job->TFinIsV = 0; - } else { - ptr = NULL; } } diff --git a/src/spicelib/devices/cktfinddev.c b/src/spicelib/devices/cktfinddev.c index a1dcd169b..818b5607b 100644 --- a/src/spicelib/devices/cktfinddev.c +++ b/src/spicelib/devices/cktfinddev.c @@ -13,13 +13,5 @@ Author: 1985 Thomas L. Quarles GENinstance * CKTfndDev(CKTcircuit *ckt, IFuid name) { - GENinstance *here; - - here = nghash_find(ckt->DEVnameHash, name); - - if (here) { - return here; - } - - return NULL; + return nghash_find(ckt->DEVnameHash, name); } diff --git a/src/tclspice.c b/src/tclspice.c index 057ce299f..2f8f9c2af 100644 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -1397,7 +1397,6 @@ get_mod_param TCL_CMDPROCARGS(clientData, interp, argc, argv) devptr = ft_sim->findInstance (ft_curckt->ci_ckt, name); if (!devptr) { typecode = -1; - devptr = NULL; err = ft_sim->findModel (ft_curckt->ci_ckt, &typecode, &modptr, name); } else { typecode = devptr->GENmodPtr->GENmodType; diff --git a/src/unsupported/snstart.c b/src/unsupported/snstart.c index 43dc561ae..6147d6cd4 100644 --- a/src/unsupported/snstart.c +++ b/src/unsupported/snstart.c @@ -39,8 +39,6 @@ SENstartup(CKTcircuit *ckt, int restart) parmtemp.rValue = 1.0; for (i = 0; i < ckt->CKTsenInfo->SENnumVal; i++) { - type = -1; - fast = NULL; fast = CKTfndDev(ckt, ckt->CKTsenInfo->SENdevices[i]); if (!fast)