Browse Source

polish `LITERR' macro

checked for object file invariance
pre-master-46
rlar 13 years ago
parent
commit
31ff2ee073
  1. 8
      src/include/ngspice/inpmacs.h
  2. 2
      src/spicelib/parser/inp2d.c
  3. 9
      src/spicelib/parser/inp2m.c
  4. 6
      src/spicelib/parser/inp2p.c
  5. 6
      src/spicelib/parser/inp2q.c
  6. 6
      src/spicelib/parser/inp2y.c
  7. 2
      src/spicelib/parser/inp2z.c
  8. 8
      src/spicelib/parser/inppas3.c

8
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

2
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;

9
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 */

6
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;
}

6
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;

6
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;
}

2
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;
}

8
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;
}
}

Loading…
Cancel
Save