From f8d341b05a540964d693773ddc84ee5154b7d41e Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 24 Nov 2025 14:02:42 +0100 Subject: [PATCH] Re-formatting --- src/spicelib/parser/inppas2.c | 330 +++++++++++++++++----------------- 1 file changed, 165 insertions(+), 165 deletions(-) diff --git a/src/spicelib/parser/inppas2.c b/src/spicelib/parser/inppas2.c index cd446f3c2..f569fe056 100644 --- a/src/spicelib/parser/inppas2.c +++ b/src/spicelib/parser/inppas2.c @@ -34,7 +34,7 @@ void INPpas2(CKTcircuit *ckt, struct card *data, INPtables * tab, TSKtask *task) char *groundname = "0"; char *gname; CKTnode *gnode; - int error; /* used by the macros defined above */ + int error; /* used by the macros defined above */ #ifdef HAS_PROGREP int linecount = 0, actcount = 0; #endif @@ -45,28 +45,28 @@ void INPpas2(CKTcircuit *ckt, struct card *data, INPtables * tab, TSKtask *task) #endif error = INPgetTok(&groundname, &gname, 1); - if (error) - data->error = - INPerrCat(data->error, - INPmkTemp - ("can't read internal ground node name!\n")); - + if (error) { + data->error = + INPerrCat(data->error, + INPmkTemp + ("can't read internal ground node name!\n")); + } error = INPgndInsert(ckt, &gname, tab, &gnode); - if (error && error != E_EXISTS) - data->error = - INPerrCat(data->error, - INPmkTemp - ("can't insert internal ground node in symbol table!\n")); - -#ifdef TRACE + if (error && error != E_EXISTS) { + data->error = + INPerrCat(data->error, + INPmkTemp + ("can't insert internal ground node in symbol table!\n")); + } + +#ifdef TRACE printf("Examining this deck:\n"); for (current = data; current != NULL; current = current->nextcard) { - printf("%s\n", current->line); + printf("%s\n", current->line); } printf("\n"); #endif - #ifdef HAS_PROGREP for (current = data; current != NULL; current = current->nextcard) linecount++; @@ -75,195 +75,195 @@ void INPpas2(CKTcircuit *ckt, struct card *data, INPtables * tab, TSKtask *task) for (current = data; current != NULL; current = current->nextcard) { #ifdef TRACE - /* SDB debug statement */ - printf("In INPpas2, examining card %s . . .\n", current->line); + /* SDB debug statement */ + printf("In INPpas2, examining card %s . . .\n", current->line); #endif #ifdef HAS_PROGREP - if (linecount > 0) { - SetAnalyse( "Parse", (int) (1000.*actcount/linecount)); - actcount++; - } + if (linecount > 0) { + SetAnalyse( "Parse", (int) (1000.*actcount/linecount)); + actcount++; + } #endif - Current_parse_line = current->linenum_orig; - Sourcefile = current->linesource; + Current_parse_line = current->linenum_orig; + Sourcefile = current->linesource; - c = *(current->line); - if(islower_c(c)) - c = toupper_c(c); + c = *(current->line); + if(islower_c(c)) + c = toupper_c(c); - switch (c) { + switch (c) { - case ' ': - /* blank line (space leading) */ - case '\t': - /* blank line (tab leading) */ - break; + case ' ': + /* blank line (space leading) */ + case '\t': + /* blank line (tab leading) */ + break; #ifdef XSPICE - /* gtri - add - wbk - 10/23/90 - add case for 'A' devices */ + /* gtri - add - wbk - 10/23/90 - add case for 'A' devices */ - case 'A': /* Aname */ - MIF_INP2A(ckt, tab, current); - ckt->CKTadevFlag = 1; /* an 'A' device is requested */ - break; + case 'A': /* Aname */ + MIF_INP2A(ckt, tab, current); + ckt->CKTadevFlag = 1; /* an 'A' device is requested */ + break; - /* gtri - end - wbk - 10/23/90 */ + /* gtri - end - wbk - 10/23/90 */ #endif - case 'R': - /* Rname [][][w=][l=] */ - INP2R(ckt, tab, current); - break; + case 'R': + /* Rname [][][w=][l=] */ + INP2R(ckt, tab, current); + break; - case 'C': - /* Cname [IC=] */ - INP2C(ckt, tab, current); - break; + case 'C': + /* Cname [IC=] */ + INP2C(ckt, tab, current); + break; - case 'L': - /* Lname [IC=] */ - INP2L(ckt, tab, current); - break; + case 'L': + /* Lname [IC=] */ + INP2L(ckt, tab, current); + break; - case 'G': - /* Gname */ - INP2G(ckt, tab, current); - break; + case 'G': + /* Gname */ + INP2G(ckt, tab, current); + break; - case 'E': - /* Ename */ - INP2E(ckt, tab, current); - break; + case 'E': + /* Ename */ + INP2E(ckt, tab, current); + break; - case 'F': - /* Fname */ - INP2F(ckt, tab, current); - break; + case 'F': + /* Fname */ + INP2F(ckt, tab, current); + break; - case 'H': - /* Hname */ - INP2H(ckt, tab, current); - break; + case 'H': + /* Hname */ + INP2H(ckt, tab, current); + break; - case 'D': - /* Dname [] [OFF] [IC=] */ - INP2D(ckt, tab, current); - break; + case 'D': + /* Dname [] [OFF] [IC=] */ + INP2D(ckt, tab, current); + break; - case 'J': - /* Jname [] [OFF] + case 'J': + /* Jname [] [OFF] + [IC=,] */ + INP2J(ckt, tab, current); + break; + + case 'Z': + /* Zname [] [OFF] [IC=,] */ - INP2J(ckt, tab, current); - break; + INP2Z(ckt, tab, current); + break; - case 'Z': - /* Zname [] [OFF] - [IC=,] */ - INP2Z(ckt, tab, current); - break; - - case 'M': - /* Mname [L=] - [W=] [AD=] [AS=] [PD=] - [PS=] [NRD=] [NRS=] [OFF] - [IC=,,] */ - INP2M(ckt, tab, current); - break; + case 'M': + /* Mname [L=] + [W=] [AD=] [AS=] [PD=] + [PS=] [NRD=] [NRS=] [OFF] + [IC=,,] */ + INP2M(ckt, tab, current); + break; #ifdef OSDI - case 'N': - /* Nname [...] [] */ - INP2N(ckt, tab, current); - break; + case 'N': + /* Nname [...] [] */ + INP2N(ckt, tab, current); + break; #endif - case 'O': - /* Oname - [IC=,,,] */ - INP2O(ckt, tab, current); - break; + case 'O': + /* Oname + [IC=,,,] */ + INP2O(ckt, tab, current); + break; - case 'V': - /* Vname [ [DC] ] [AC [ [ ] ] ] - [] */ - INP2V(ckt, tab, current); - break; + case 'V': + /* Vname [ [DC] ] [AC [ [ ] ] ] + [] */ + INP2V(ckt, tab, current); + break; - case 'I': - /* Iname [ [DC] ] [AC [ [ ] ] ] - [] */ - INP2I(ckt, tab, current); - break; + case 'I': + /* Iname [ [DC] ] [AC [ [ ] ] ] + [] */ + INP2I(ckt, tab, current); + break; - case 'Q': - /* Qname [] [] [OFF] - [IC=,] */ - INP2Q(ckt, tab, current, gnode); - break; + case 'Q': + /* Qname [] [] [OFF] + [IC=,] */ + INP2Q(ckt, tab, current, gnode); + break; - case 'T': - /* Tname [TD=] - [F= [NL=]][IC=,,,] */ - INP2T(ckt, tab, current); - break; + case 'T': + /* Tname [TD=] + [F= [NL=]][IC=,,,] */ + INP2T(ckt, tab, current); + break; - case 'S': - /* Sname [] [IC] */ - INP2S(ckt, tab, current); - break; + case 'S': + /* Sname [] [IC] */ + INP2S(ckt, tab, current); + break; - case 'W': - /* Wname [] [IC] */ - /* CURRENT CONTROLLED SWITCH */ - INP2W(ckt, tab, current); - break; + case 'W': + /* Wname [] [IC] */ + /* CURRENT CONTROLLED SWITCH */ + INP2W(ckt, tab, current); + break; - case 'U': - /* Uname [l=] [n=] */ - INP2U(ckt, tab, current); - break; + case 'U': + /* Uname [l=] [n=] */ + INP2U(ckt, tab, current); + break; - /* Kspice addition - saj */ - case 'P': - /* Pname ... ... [] */ - /* R= L= G= C= len= */ - INP2P(ckt, tab, current); - break; - case 'Y': - /* Yname R= L= G= C= len= */ - INP2Y(ckt, tab, current); - break; - /* end Kspice */ + /* Kspice addition - saj */ + case 'P': + /* Pname ... ... [] */ + /* R= L= G= C= len= */ + INP2P(ckt, tab, current); + break; + case 'Y': + /* Yname R= L= G= C= len= */ + INP2Y(ckt, tab, current); + break; + /* end Kspice */ - case 'K': - /* Kname Lname Lname */ - INP2K(ckt, tab, current); - break; + case 'K': + /* Kname Lname Lname */ + INP2K(ckt, tab, current); + break; - case '*': case '$': - /* * - a comment - ignore */ - break; + case '*': case '$': + /* * - a comment - ignore */ + break; - case 'B': - /* Bname [V=expr] [I=expr] */ - /* Arbitrary source. */ - INP2B(ckt, tab, current); - break; + case 'B': + /* Bname [V=expr] [I=expr] */ + /* Arbitrary source. */ + INP2B(ckt, tab, current); + break; - case '.': /* . Many possibilities */ - if (INP2dot(ckt,tab,current,task,gnode)) - return; - break; + case '.': /* . Many possibilities */ + if (INP2dot(ckt,tab,current,task,gnode)) + return; + break; - case '\0': - break; + case '\0': + break; - default: - /* the un-implemented device */ - LITERR(" unknown device type - error \n"); - break; - } - } + default: + /* the un-implemented device */ + LITERR(" unknown device type - error \n"); + break; + } + } return; }