From bd5ac3e4fc5becc1348d33c82c0c1d27cb17d22a Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 11 Apr 2015 21:26:36 +0200 Subject: [PATCH] devices/asrc, cleanup #5/9, drop explicit NULL comparsion --- src/spicelib/devices/asrc/asrcacld.c | 4 ++-- src/spicelib/devices/asrc/asrcconv.c | 4 ++-- src/spicelib/devices/asrc/asrcfbr.c | 4 ++-- src/spicelib/devices/asrc/asrcload.c | 4 ++-- src/spicelib/devices/asrc/asrcpzld.c | 4 ++-- src/spicelib/devices/asrc/asrcset.c | 8 ++++---- src/spicelib/devices/asrc/asrctemp.c | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/spicelib/devices/asrc/asrcacld.c b/src/spicelib/devices/asrc/asrcacld.c index 458a91039..ce8fc9eb9 100644 --- a/src/spicelib/devices/asrc/asrcacld.c +++ b/src/spicelib/devices/asrc/asrcacld.c @@ -28,8 +28,8 @@ ASRCacLoad(GENmodel *inModel, CKTcircuit *ckt) NG_IGNORE(ckt); - for (; model != NULL; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here != NULL; + for (; model; model = model->ASRCnextModel) { + for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { difference = (here->ASRCtemp + here->ASRCdtemp) - 300.15; diff --git a/src/spicelib/devices/asrc/asrcconv.c b/src/spicelib/devices/asrc/asrcconv.c index 8354181af..fe967d0c2 100644 --- a/src/spicelib/devices/asrc/asrcconv.c +++ b/src/spicelib/devices/asrc/asrcconv.c @@ -21,8 +21,8 @@ ASRCconvTest(GENmodel *inModel, CKTcircuit *ckt) double tol; double rhs; - for (; model != NULL; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here != NULL; + for (; model; model = model->ASRCnextModel) { + for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { i = here->ASRCtree->numVars; diff --git a/src/spicelib/devices/asrc/asrcfbr.c b/src/spicelib/devices/asrc/asrcfbr.c index 1fd860499..a95f1f00e 100644 --- a/src/spicelib/devices/asrc/asrcfbr.c +++ b/src/spicelib/devices/asrc/asrcfbr.c @@ -19,8 +19,8 @@ ASRCfindBr(CKTcircuit *ckt, GENmodel *inputModel, IFuid name) int error; CKTnode *tmp; - for (; model != NULL; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here != NULL; + for (; model; model = model->ASRCnextModel) { + for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { if (here->ASRCname == name) { if (here->ASRCbranch == 0) { diff --git a/src/spicelib/devices/asrc/asrcload.c b/src/spicelib/devices/asrc/asrcload.c index 8df6dd2e5..54933a3f3 100644 --- a/src/spicelib/devices/asrc/asrcload.c +++ b/src/spicelib/devices/asrc/asrcload.c @@ -28,8 +28,8 @@ ASRCload(GENmodel *inModel, CKTcircuit *ckt) double difference; double factor; - for (; model != NULL; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here != NULL; + for (; model; model = model->ASRCnextModel) { + for (here = model->ASRCinstances; here; here=here->ASRCnextInstance) { diff --git a/src/spicelib/devices/asrc/asrcpzld.c b/src/spicelib/devices/asrc/asrcpzld.c index 1b15d7b3a..161ba4f29 100644 --- a/src/spicelib/devices/asrc/asrcpzld.c +++ b/src/spicelib/devices/asrc/asrcpzld.c @@ -27,8 +27,8 @@ ASRCpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) NG_IGNORE(s); - for (; model != NULL; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here != NULL; + for (; model; model = model->ASRCnextModel) { + for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { diff --git a/src/spicelib/devices/asrc/asrcset.c b/src/spicelib/devices/asrc/asrcset.c index 82c9478fe..1234a0f32 100644 --- a/src/spicelib/devices/asrc/asrcset.c +++ b/src/spicelib/devices/asrc/asrcset.c @@ -25,8 +25,8 @@ ASRCsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states) NG_IGNORE(states); - for (; model != NULL; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here != NULL; + for (; model; model = model->ASRCnextModel) { + for (here = model->ASRCinstances; here; here=here->ASRCnextInstance) { if (!here->ASRCtc1Given) here->ASRCtc1 = 0.0; @@ -143,10 +143,10 @@ ASRCunsetup( ASRCmodel *model = (ASRCmodel *) inModel; ASRCinstance *here; - for (; model != NULL; + for (; model; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here != NULL; + for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { if (here->ASRCbranch) { diff --git a/src/spicelib/devices/asrc/asrctemp.c b/src/spicelib/devices/asrc/asrctemp.c index d113b39ba..77364a4b4 100644 --- a/src/spicelib/devices/asrc/asrctemp.c +++ b/src/spicelib/devices/asrc/asrctemp.c @@ -15,8 +15,8 @@ ASRCtemp(GENmodel *inModel, CKTcircuit *ckt) ASRCmodel *model = (ASRCmodel *) inModel; ASRCinstance *here; - for (; model != NULL; model = model->ASRCnextModel) { - for (here = model->ASRCinstances; here != NULL; + for (; model; model = model->ASRCnextModel) { + for (here = model->ASRCinstances; here; here = here->ASRCnextInstance) { /* Default Value Processing for Source Instance */