polish `LITERR' macro

checked for object file invariance
This commit is contained in:
rlar 2013-07-14 15:06:12 +02:00
parent aef068ba10
commit 7189a87bbf
8 changed files with 27 additions and 20 deletions

View File

@ -34,7 +34,11 @@ Copyright 1990 Regents of the University of California. All rights reserved.
/* 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 * 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 /* and now a special one for calling INPdevParse which returns an

View File

@ -81,7 +81,7 @@ void INP2D(CKTcircuit *ckt, INPtables * tab, card * current)
#ifdef CIDER #ifdef CIDER
if( type == INPtypelook("NUMD2") ) { if( type == INPtypelook("NUMD2") ) {
LITERR(" error: no unlabelled parameter permitted on NUMD2\n") LITERR(" error: no unlabelled parameter permitted on NUMD2\n");
} else { } else {
#endif #endif
ptemp.rValue = leadval; ptemp.rValue = leadval;

View File

@ -124,7 +124,8 @@ INP2M (CKTcircuit *ckt, INPtables * tab, card * current)
) )
{ {
/* if model is not variable node B3SOIPD/FD/DD model, error! */ /* 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 else
{ /* if looking at B3SOIPD/FD/DD or B4SOI model, allocate the 7th node */ { /* 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! */ /* 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 else
{ /* if looking at B3SOIPD/FD/DD, B4SOI, STAG (SOI3) or HiSIMHV model, allocate the 6th node */ { /* 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! */ /* 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 else
{ /* if looking at B3SOIPD/FD/DD, B4SOI, STAG (SOI3) or HiSIMHV model, allocate the 5th node */ { /* if looking at B3SOIPD/FD/DD, B4SOI, STAG (SOI3) or HiSIMHV model, allocate the 5th node */

View File

@ -43,7 +43,7 @@ int num, i;
mytype = INPtypelook("CplLines"); mytype = INPtypelook("CplLines");
if(mytype < 0 ) { if(mytype < 0 ) {
LITERR("Device type CplLines not supported by this binary\n") LITERR("Device type CplLines not supported by this binary\n");
return; return;
} }
line = current->line; line = current->line;
@ -87,7 +87,7 @@ int num, i;
current->error = INPgetMod(ckt,model,&thismodel,tab); current->error = INPgetMod(ckt,model,&thismodel,tab);
if(thismodel != NULL) { if(thismodel != NULL) {
if(mytype != thismodel->INPmodType) { if(mytype != thismodel->INPmodType) {
LITERR("incorrect model type") LITERR("incorrect model type");
return; return;
} }
mdfast = thismodel->INPmodfast; mdfast = thismodel->INPmodfast;
@ -108,7 +108,7 @@ int num, i;
lenvalgiven = 1; lenvalgiven = 1;
} }
} else { } else {
LITERR("model name is not found") LITERR("model name is not found");
return; return;
} }

View File

@ -129,7 +129,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode)
#endif #endif
&& (thismodel->INPmodType != INPtypelook("VBIC"))) && (thismodel->INPmodType != INPtypelook("VBIC")))
{ {
LITERR("incorrect model type") LITERR("incorrect model type");
return; return;
} }
#ifdef ADMS #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("hicum2")))
&& (nodeflag && (thismodel->INPmodType != INPtypelook("bjt504t")))) && (nodeflag && (thismodel->INPmodType != INPtypelook("bjt504t"))))
{ {
LITERR("Too much nodes for this model type") LITERR("Too much nodes for this model type");
return; return;
} }
#endif #endif
@ -182,7 +182,7 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode)
if (waslead) { if (waslead) {
#ifdef CIDER #ifdef CIDER
if( type == INPtypelook("NBJT2") ) { if( type == INPtypelook("NBJT2") ) {
LITERR(" error: no unlabeled parameter permitted on NBJT2\n") LITERR(" error: no unlabeled parameter permitted on NBJT2\n");
} else { } else {
#endif #endif
ptemp.rValue = leadval; ptemp.rValue = leadval;

View File

@ -54,7 +54,7 @@ int lenvalgiven = 0;
mytype2 = INPtypelook("CplLines"); mytype2 = INPtypelook("CplLines");
if(mytype < 0 ) { if(mytype < 0 ) {
LITERR("Device type TransLine not supported by this binary\n") LITERR("Device type TransLine not supported by this binary\n");
return; return;
} }
line = current->line; line = current->line;
@ -85,7 +85,7 @@ int lenvalgiven = 0;
return; return;
} }
else if (mytype != thismodel->INPmodType) { else if (mytype != thismodel->INPmodType) {
LITERR("incorrect model type") LITERR("incorrect model type");
return; return;
} }
line = thismodel->INPmodLine->line; line = thismodel->INPmodLine->line;
@ -240,7 +240,7 @@ int lenvalgiven = 0;
} }
IFC(newInstance,(ckt,mdfast,&fast,name)); IFC(newInstance,(ckt,mdfast,&fast,name));
} else { } else {
LITERR("model name is not found") LITERR("model name is not found");
return; return;
} }

View File

@ -62,7 +62,7 @@ void INP2Z(CKTcircuit *ckt, INPtables * tab, card * current)
&& thismodel->INPmodType != INPtypelook("HFET1") && thismodel->INPmodType != INPtypelook("HFET1")
&& thismodel->INPmodType != INPtypelook("HFET2")) && thismodel->INPmodType != INPtypelook("HFET2"))
{ {
LITERR("incorrect model type") LITERR("incorrect model type");
return; return;
} }

View File

@ -61,7 +61,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
} }
if(which == -1) { if(which == -1) {
LITERR("nodeset unknown to simulator. \n") LITERR("nodeset unknown to simulator. \n");
goto quit; goto quit;
} }
@ -91,7 +91,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL)); IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL));
continue; continue;
} }
LITERR(" Error: .nodeset syntax error.\n") LITERR(" Error: .nodeset syntax error.\n");
break; break;
} }
} else if ((strcmp(token,".ic") == 0)) { } else if ((strcmp(token,".ic") == 0)) {
@ -105,7 +105,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
} }
if(which==-1) { if(which==-1) {
LITERR("ic unknown to simulator. \n") LITERR("ic unknown to simulator. \n");
goto quit; goto quit;
} }
@ -127,7 +127,7 @@ INPpas3(CKTcircuit *ckt, card *data, INPtables *tab, TSKtask *task,
IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL)); IFC(setNodeParm, (ckt, node1, which, &ptemp, NULL));
continue; continue;
} }
LITERR(" Error: .ic syntax error.\n") LITERR(" Error: .ic syntax error.\n");
break; break;
} }
} }