From 8a154a7a9a35d86d37637c83698d62606907d868 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 3 Feb 2013 15:52:49 +0100 Subject: [PATCH] use SP_VOLTAGE instead of literal value `3' (grep "git --no-pager grep -nH -e '->[ \t]*type.*[0-9]'") --- src/maths/ni/niconv.c | 2 +- src/spicelib/analysis/cktncdump.c | 2 +- src/spicelib/analysis/ckttrunc.c | 6 +++--- src/spicelib/analysis/dcop.c | 2 +- src/spicelib/analysis/dcpss.c | 2 +- src/spicelib/analysis/dctran.c | 2 +- src/spicelib/parser/inppas3.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/maths/ni/niconv.c b/src/maths/ni/niconv.c index 1ca12c82a..988fd30f2 100644 --- a/src/maths/ni/niconv.c +++ b/src/maths/ni/niconv.c @@ -38,7 +38,7 @@ NIconvTest(CKTcircuit *ckt) node = node->next; new = ckt->CKTrhs [i] ; old = ckt->CKTrhsOld [i] ; - if(node->type == 3) { + if(node->type == SP_VOLTAGE) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + ckt->CKTvoltTol; if (fabs(new-old) >tol ) { diff --git a/src/spicelib/analysis/cktncdump.c b/src/spicelib/analysis/cktncdump.c index ced915842..79355555b 100644 --- a/src/spicelib/analysis/cktncdump.c +++ b/src/spicelib/analysis/cktncdump.c @@ -25,7 +25,7 @@ CKTncDump( new = ckt->CKTrhsOld [i] ; old = ckt->CKTrhs [i] ; fprintf(stdout,"%-30s %20g %20g", node->name, new, old); - if(node->type == 3) { + if(node->type == SP_VOLTAGE) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + ckt->CKTvoltTol; } else { diff --git a/src/spicelib/analysis/ckttrunc.c b/src/spicelib/analysis/ckttrunc.c index c163a340a..cbf57dcc5 100644 --- a/src/spicelib/analysis/ckttrunc.c +++ b/src/spicelib/analysis/ckttrunc.c @@ -81,7 +81,7 @@ CKTtrunc(CKTcircuit *ckt, double *timeStep) tol = MAX( fabs(ckt->CKTrhs[i]),fabs(ckt->CKTpred[i]))* ckt->CKTlteReltol+ckt->CKTlteAbstol; node = node->next; - if(node->type!= 3) continue; + if(node->type!= SP_VOLTAGE) continue; diff = ckt->CKTrhs[i]-ckt->CKTpred[i]; #ifdef STEPDEBUG printf("%s: cor=%g, pred=%g ",node->name, @@ -106,7 +106,7 @@ CKTtrunc(CKTcircuit *ckt, double *timeStep) tol = MAX( fabs(ckt->CKTrhs[i]),fabs(ckt->CKTpred[i]))* ckt->CKTlteReltol+ckt->CKTlteAbstol; node = node->next; - if(node->type!= 3) continue; + if(node->type!= SP_VOLTAGE) continue; diff = ckt->CKTrhs[i]-ckt->CKTpred[i]; #ifdef STEPDEBUG printf("%s: cor=%g, pred=%g ",node->name,ckt->CKTrhs[i], @@ -141,7 +141,7 @@ CKTtrunc(CKTcircuit *ckt, double *timeStep) } for(i=1;inext; - if(node->type!= 3) continue; + if(node->type!= SP_VOLTAGE) continue; tol = MAX( fabs(ckt->CKTrhs[i]),fabs(ckt->CKTpred[i]))* ckt->CKTlteReltol+ckt->CKTlteAbstol; diff = (ckt->CKTrhs[i]-ckt->CKTpred[i]); diff --git a/src/spicelib/analysis/dcop.c b/src/spicelib/analysis/dcop.c index 82bf758be..64d5d85d2 100644 --- a/src/spicelib/analysis/dcop.c +++ b/src/spicelib/analysis/dcop.c @@ -95,7 +95,7 @@ DCop(CKTcircuit *ckt, int notused) new = ckt->CKTrhsOld [i] ; old = ckt->CKTrhs [i] ; fprintf(stdout,"%-30s %20g %20g", node->name, new, old); - if(node->type == 3) { + if(node->type == SP_VOLTAGE) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + ckt->CKTvoltTol; } else { diff --git a/src/spicelib/analysis/dcpss.c b/src/spicelib/analysis/dcpss.c index 71602e663..df6138222 100644 --- a/src/spicelib/analysis/dcpss.c +++ b/src/spicelib/analysis/dcpss.c @@ -308,7 +308,7 @@ DCpss(CKTcircuit *ckt, new = ckt->CKTrhsOld [i] ; old = ckt->CKTrhs [i] ; fprintf(stdout,"%-30s %20g %20g", node->name, new, old); - if(node->type == 3) { + if(node->type == SP_VOLTAGE) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + ckt->CKTvoltTol; } else { diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index 43bf9e616..2c94cac59 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -237,7 +237,7 @@ DCtran(CKTcircuit *ckt, new = ckt->CKTrhsOld [i] ; old = ckt->CKTrhs [i] ; fprintf(stdout,"%-30s %20g %20g", node->name, new, old); - if(node->type == 3) { + if(node->type == SP_VOLTAGE) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + ckt->CKTvoltTol; } else { diff --git a/src/spicelib/parser/inppas3.c b/src/spicelib/parser/inppas3.c index a451dfca3..35bcaf4a5 100644 --- a/src/spicelib/parser/inppas3.c +++ b/src/spicelib/parser/inppas3.c @@ -75,7 +75,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task, if ( cieq(name, "all")) { ptemp.rValue = INPevaluate(&line,&error,1); for (node1 = ckt->CKTnodes; node1 != NULL; node1 = node1->next) { - if ((node1->type == 3) && (node1->number > 0)) + if ((node1->type == SP_VOLTAGE) && (node1->number > 0)) IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL)); } break;