From 042916ae8882412f09ee4d0f836db0d2b57e3149 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 8 Mar 2017 17:59:24 +0100 Subject: [PATCH] inp2q.c, #3/23, renumber 'nodeflag' range over {4,5} instead of {0,1} --- src/spicelib/parser/inp2q.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/spicelib/parser/inp2q.c b/src/spicelib/parser/inp2q.c index b99ff1254..5b2898f58 100644 --- a/src/spicelib/parser/inp2q.c +++ b/src/spicelib/parser/inp2q.c @@ -49,7 +49,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) printf("INP2Q: Parsing '%s'\n", current->line); #endif - nodeflag = 0; /* initially specify a 4 terminal device */ + nodeflag = 4; /* initially specify a 4 terminal device */ line = current->line; INPgetTok(&line, &name, 1); INPinsert(&name, tab); @@ -95,14 +95,14 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) node5 = gnode; /* 4-terminal adms device - thermal node to ground */ nname5 = copy("0"); INPtermInsert(ckt, &nname5, tab, &node5); - nodeflag = 1; /* now specify a 5 node device */ + nodeflag = 5; /* now specify a 5 node device */ } } else { /* 5-terminal device */ #ifdef TRACE printf("INP2Q: checking for 5 node device\n"); #endif - nodeflag = 1; /* now specify a 5 node device */ + nodeflag = 5; /* now specify a 5 node device */ nname5 = model; INPtermInsert(ckt, &nname5, tab, &node5); INPgetTok(&line, &model, 1); @@ -133,9 +133,9 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) return; } #ifdef ADMS - if ((nodeflag && (thismodel->INPmodType != INPtypelook("hicum0"))) - && (nodeflag && (thismodel->INPmodType != INPtypelook("hicum2"))) - && (nodeflag && (thismodel->INPmodType != INPtypelook("bjt504t")))) + if ((nodeflag > 4 && (thismodel->INPmodType != INPtypelook("hicum0"))) + && (nodeflag > 4 && (thismodel->INPmodType != INPtypelook("hicum2"))) + && (nodeflag > 4 && (thismodel->INPmodType != INPtypelook("bjt504t")))) { LITERR("Too much nodes for this model type"); return; @@ -172,7 +172,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) IFC(bindNode, (ckt, fast, 4, node4)); #ifdef ADMS - if (nodeflag) { /* 5-node device */ + if (nodeflag > 4) { /* 5-node device */ IFC(bindNode, (ckt, fast, 5, node5)); } #endif