diff --git a/src/include/ngspice/inpmacs.h b/src/include/ngspice/inpmacs.h index c0dac6618..e94dd8107 100644 --- a/src/include/ngspice/inpmacs.h +++ b/src/include/ngspice/inpmacs.h @@ -31,10 +31,14 @@ Copyright 1990 Regents of the University of California. All rights reserved. } while(0) -/* and one for putting our own error messages onto the current +/* and one for putting our own error messages onto the current * line's error string */ -#define LITERR(text) current->error=INPerrCat(current->error,INPmkTemp(text)); + +#define LITERR(text) \ + do { \ + current->error = INPerrCat(current->error, INPmkTemp(text)); \ + } while(0) /* and now a special one for calling INPdevParse which returns an diff --git a/src/spicelib/parser/inp2d.c b/src/spicelib/parser/inp2d.c index 2a6489f2c..f85d1ad33 100644 --- a/src/spicelib/parser/inp2d.c +++ b/src/spicelib/parser/inp2d.c @@ -81,7 +81,7 @@ void INP2D(CKTcircuit *ckt, INPtables * tab, card * current) #ifdef CIDER if( type == INPtypelook("NUMD2") ) { - LITERR(" error: no unlabelled parameter permitted on NUMD2\n") + LITERR(" error: no unlabelled parameter permitted on NUMD2\n"); } else { #endif ptemp.rValue = leadval; diff --git a/src/spicelib/parser/inp2m.c b/src/spicelib/parser/inp2m.c index f0fdb314b..f9492e346 100644 --- a/src/spicelib/parser/inp2m.c +++ b/src/spicelib/parser/inp2m.c @@ -124,7 +124,8 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current) ) { /* if model is not variable node B3SOIPD/FD/DD model, error! */ - LITERR ("only level 55-58: B3SOI(PD|FD|DD) and B4SOI can have 7 nodes") return; + LITERR ("only level 55-58: B3SOI(PD|FD|DD) and B4SOI can have 7 nodes"); + return; } else { /* if looking at B3SOIPD/FD/DD or B4SOI model, allocate the 7th node */ @@ -155,7 +156,8 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current) ) { /* if model is not variable node B3SOIPD/FD/DD or STAG model, error! */ - LITERR ("only level 55-58,61,62: B3SOI(PD|FD|DD), B4SOI, STAG (SOI3) and HiSIMHV can have 6 nodes") return; + LITERR ("only level 55-58,61,62: B3SOI(PD|FD|DD), B4SOI, STAG (SOI3) and HiSIMHV can have 6 nodes"); + return; } else { /* if looking at B3SOIPD/FD/DD, B4SOI, STAG (SOI3) or HiSIMHV model, allocate the 6th node */ @@ -176,7 +178,8 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current) ) { /* if model is not variable node B3SOIPD/FD/DD model, error! */ - LITERR ("only level 55-58,61,62: B3SOI(PD|FD|DD), B4SOI, STAG (SOI3) and HiSIMHV can have 5 nodes") return; + LITERR ("only level 55-58,61,62: B3SOI(PD|FD|DD), B4SOI, STAG (SOI3) and HiSIMHV can have 5 nodes"); + return; } else { /* if looking at B3SOIPD/FD/DD, B4SOI, STAG (SOI3) or HiSIMHV model, allocate the 5th node */ diff --git a/src/spicelib/parser/inp2p.c b/src/spicelib/parser/inp2p.c index 3fac63d39..da5cc4928 100644 --- a/src/spicelib/parser/inp2p.c +++ b/src/spicelib/parser/inp2p.c @@ -43,7 +43,7 @@ int num, i; mytype = INPtypelook("CplLines"); if(mytype < 0 ) { - LITERR("Device type CplLines not supported by this binary\n") + LITERR("Device type CplLines not supported by this binary\n"); return; } line = current->line; @@ -87,7 +87,7 @@ int num, i; current->error = INPgetMod(ckt,model,&thismodel,tab); if(thismodel != NULL) { if(mytype != thismodel->INPmodType) { - LITERR("incorrect model type") + LITERR("incorrect model type"); return; } mdfast = thismodel->INPmodfast; @@ -108,7 +108,7 @@ int num, i; lenvalgiven = 1; } } else { - LITERR("model name is not found") + LITERR("model name is not found"); return; } diff --git a/src/spicelib/parser/inp2q.c b/src/spicelib/parser/inp2q.c index d3f859bec..d114b8e60 100644 --- a/src/spicelib/parser/inp2q.c +++ b/src/spicelib/parser/inp2q.c @@ -129,7 +129,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) #endif && (thismodel->INPmodType != INPtypelook("VBIC"))) { - LITERR("incorrect model type") + LITERR("incorrect model type"); return; } #ifdef ADMS @@ -137,7 +137,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) && (nodeflag && (thismodel->INPmodType != INPtypelook("hicum2"))) && (nodeflag && (thismodel->INPmodType != INPtypelook("bjt504t")))) { - LITERR("Too much nodes for this model type") + LITERR("Too much nodes for this model type"); return; } #endif @@ -182,7 +182,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode) if (waslead) { #ifdef CIDER if( type == INPtypelook("NBJT2") ) { - LITERR(" error: no unlabeled parameter permitted on NBJT2\n") + LITERR(" error: no unlabeled parameter permitted on NBJT2\n"); } else { #endif ptemp.rValue = leadval; diff --git a/src/spicelib/parser/inp2y.c b/src/spicelib/parser/inp2y.c index 8ce9a87b6..ea7b01a44 100644 --- a/src/spicelib/parser/inp2y.c +++ b/src/spicelib/parser/inp2y.c @@ -54,7 +54,7 @@ int lenvalgiven = 0; mytype2 = INPtypelook("CplLines"); if(mytype < 0 ) { - LITERR("Device type TransLine not supported by this binary\n") + LITERR("Device type TransLine not supported by this binary\n"); return; } line = current->line; @@ -85,7 +85,7 @@ int lenvalgiven = 0; return; } else if (mytype != thismodel->INPmodType) { - LITERR("incorrect model type") + LITERR("incorrect model type"); return; } line = thismodel->INPmodLine->line; @@ -240,7 +240,7 @@ int lenvalgiven = 0; } IFC(newInstance,(ckt,mdfast,&fast,name)); } else { - LITERR("model name is not found") + LITERR("model name is not found"); return; } diff --git a/src/spicelib/parser/inp2z.c b/src/spicelib/parser/inp2z.c index fc50ab3b8..c259e2491 100644 --- a/src/spicelib/parser/inp2z.c +++ b/src/spicelib/parser/inp2z.c @@ -62,7 +62,7 @@ void INP2Z(CKTcircuit *ckt, INPtables * tab, card * current) && thismodel->INPmodType != INPtypelook("HFET1") && thismodel->INPmodType != INPtypelook("HFET2")) { - LITERR("incorrect model type") + LITERR("incorrect model type"); return; } diff --git a/src/spicelib/parser/inppas3.c b/src/spicelib/parser/inppas3.c index 84b35b190..10eb40c28 100644 --- a/src/spicelib/parser/inppas3.c +++ b/src/spicelib/parser/inppas3.c @@ -61,7 +61,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task, } if(which == -1) { - LITERR("nodeset unknown to simulator. \n") + LITERR("nodeset unknown to simulator. \n"); goto quit; } @@ -91,7 +91,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task, IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL)); continue; } - LITERR(" Error: .nodeset syntax error.\n") + LITERR(" Error: .nodeset syntax error.\n"); break; } } else if ((strcmp(token,".ic") == 0)) { @@ -105,7 +105,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task, } if(which==-1) { - LITERR("ic unknown to simulator. \n") + LITERR("ic unknown to simulator. \n"); goto quit; } @@ -127,7 +127,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task, IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL)); continue; } - LITERR(" Error: .ic syntax error.\n") + LITERR(" Error: .ic syntax error.\n"); break; } }