swallow type conversion warnings (assignment of an int to unsigned:1 flags)

This commit is contained in:
rlar 2010-11-23 19:20:30 +00:00
parent 7ef6155ea5
commit bda8dfa2c6
16 changed files with 46 additions and 24 deletions

View File

@ -1,3 +1,25 @@
2010-11-23 Robert Larice
* src/spicelib/analysis/cktsopt.c ,
* src/spicelib/analysis/dctrcurv.c ,
* src/spicelib/devices/bjt/bjtparam.c ,
* src/spicelib/devices/bjt2/bjt2param.c ,
* src/spicelib/devices/bsim2/b2mpar.c ,
* src/spicelib/devices/dio/dioparam.c ,
* src/spicelib/devices/jfet/jfetpar.c ,
* src/spicelib/devices/jfet2/jfet2par.c ,
* src/spicelib/devices/mos1/mos1par.c ,
* src/spicelib/devices/mos2/mos2par.c ,
* src/spicelib/devices/mos3/mos3par.c ,
* src/spicelib/devices/mos6/mos6par.c ,
* src/spicelib/devices/mos9/mos9par.c ,
* src/spicelib/devices/soi3/soi3par.c ,
* src/spicelib/devices/vbic/vbicparam.c :
swallow type conversion warnings (assignment of int to unsigned:1 flags)
actually this fix changes the semantic from
true if and only if given number is odd
to
true if and only if given number != 0
2010-11-22 Robert Larice
* src/frontend/parse-bison.c ,
* src/spicelib/parser/inpptree-parser.c :
@ -19,7 +41,7 @@
This phenomenon is well known, see for example
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
This `bug workaround' fixes the problem
by declaring the `test_double' to be a `void' double,
by declaring the `test_double' to be a `volatile' double,
which enforces truncation of the 80bit value,
when it is used in the comparison.
This fix will cause the test-case to pass.

View File

@ -37,7 +37,7 @@ CKTsetOpt(CKTcircuit *ckt, JOB *anal, int opt, IFvalue *val)
switch(opt) {
case OPT_NOOPITER:
task->TSKnoOpIter = val->iValue;
task->TSKnoOpIter = (val->iValue != 0);
break;
case OPT_GMIN:
task->TSKgmin = val->rValue;
@ -125,7 +125,7 @@ CKTsetOpt(CKTcircuit *ckt, JOB *anal, int opt, IFvalue *val)
}
break;
case OPT_OLDLIMIT:
task->TSKfixLimit = val->iValue;
task->TSKfixLimit = (val->iValue != 0);
break;
case OPT_MINBREAK:
task->TSKminBreak = val->rValue;
@ -138,19 +138,19 @@ CKTsetOpt(CKTcircuit *ckt, JOB *anal, int opt, IFvalue *val)
else return(E_METHOD);
break;
case OPT_TRYTOCOMPACT:
task->TSKtryToCompact = val->iValue;
task->TSKtryToCompact = (val->iValue != 0);
break;
case OPT_BADMOS3:
task->TSKbadMos3 = val->iValue;
task->TSKbadMos3 = (val->iValue != 0);
break;
case OPT_KEEPOPINFO:
task->TSKkeepOpInfo = val->iValue;
task->TSKkeepOpInfo = (val->iValue != 0);
break;
case OPT_COPYNODESETS:
task->TSKcopyNodesets = val->iValue;
task->TSKcopyNodesets = (val->iValue != 0);
break;
case OPT_NODEDAMPING:
task->TSKnodeDamping = val->iValue;
task->TSKnodeDamping = (val->iValue != 0);
break;
case OPT_ABSDV:
task->TSKabsDv = val->rValue;

View File

@ -527,11 +527,11 @@ nextstep:;
if(cv->TRCVvType[i] == vcode) { /* voltage source */
((VSRCinstance*)(cv->TRCVvElt[i]))->VSRCdcValue =
cv->TRCVvSave[i];
((VSRCinstance*)(cv->TRCVvElt[i]))->VSRCdcGiven = cv->TRCVgSave[i];
((VSRCinstance*)(cv->TRCVvElt[i]))->VSRCdcGiven = (cv->TRCVgSave[i] != 0);
} else if(cv->TRCVvType[i] == icode) /*current source */ {
((ISRCinstance*)(cv->TRCVvElt[i]))->ISRCdcValue =
cv->TRCVvSave[i];
((ISRCinstance*)(cv->TRCVvElt[i]))->ISRCdcGiven = cv->TRCVgSave[i];
((ISRCinstance*)(cv->TRCVvElt[i]))->ISRCdcGiven = (cv->TRCVgSave[i] != 0);
} else if(cv->TRCVvType[i] == rcode) /* Resistance */ {
((RESinstance*)(cv->TRCVvElt[i]))->RESresist =
cv->TRCVvSave[i];
@ -539,7 +539,7 @@ nextstep:;
((RESinstance*)(cv->TRCVvElt[i]))->RESconduct =
1/(((RESinstance*)(cv->TRCVvElt[i]))->RESresist);
((RESinstance*)(cv->TRCVvElt[i]))->RESresGiven = cv->TRCVgSave[i];
((RESinstance*)(cv->TRCVvElt[i]))->RESresGiven = (cv->TRCVgSave[i] != 0);
DEVices[rcode]->DEVload(cv->TRCVvElt[i]->GENmodPtr, ckt);
/*

View File

@ -52,7 +52,7 @@ BJTparam(int param, IFvalue *value, GENinstance *instPtr, IFvalue *select)
here->BJTdtempGiven = TRUE;
break;
case BJT_OFF:
here->BJToff = value->iValue;
here->BJToff = (value->iValue != 0);
break;
case BJT_IC_VBE:
here->BJTicVBE = value->rValue;

View File

@ -53,7 +53,7 @@ BJT2param(int param, IFvalue *value, GENinstance *instPtr, IFvalue *select)
here->BJT2dtempGiven = TRUE;
break;
case BJT2_OFF:
here->BJT2off = value->iValue;
here->BJT2off = (value->iValue != 0);
break;
case BJT2_IC_VBE:
here->BJT2icVBE = value->rValue;

View File

@ -506,7 +506,7 @@ B2mParam(int param, IFvalue *value, GENmodel *inMod)
mod->B2gateBulkOverlapCapGiven = TRUE;
break;
case BSIM2_MOD_XPART :
mod->B2channelChargePartitionFlag = value->iValue;
mod->B2channelChargePartitionFlag = (value->iValue != 0);
mod->B2channelChargePartitionFlagGiven = TRUE;
break;
case BSIM2_MOD_RSH :

View File

@ -45,7 +45,7 @@ DIOparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
here->DIOdtempGiven = TRUE;
break;
case DIO_OFF:
here->DIOoff = value->iValue;
here->DIOoff = (value->iValue != 0);
break;
case DIO_IC:
here->DIOinitCond = value->rValue;

View File

@ -47,7 +47,7 @@ JFETparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
here->JFETicVGSGiven = TRUE;
break;
case JFET_OFF:
here->JFEToff = value->iValue;
here->JFEToff = (value->iValue != 0);
break;
case JFET_IC:
switch(value->v.numValue) {

View File

@ -51,7 +51,7 @@ JFET2param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
here->JFET2icVGSGiven = TRUE;
break;
case JFET2_OFF:
here->JFET2off = value->iValue;
here->JFET2off = (value->iValue != 0);
break;
case JFET2_IC:
switch(value->v.numValue) {

View File

@ -68,7 +68,7 @@ MOS1param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
here->MOS1drainSquaresGiven = TRUE;
break;
case MOS1_OFF:
here->MOS1off = value->iValue;
here->MOS1off = (value->iValue != 0);
break;
case MOS1_IC_VBS:
here->MOS1icVBS = value->rValue;

View File

@ -69,7 +69,7 @@ MOS2param(int param, IFvalue *value, GENinstance *inst,
here->MOS2drainSquaresGiven = TRUE;
break;
case MOS2_OFF:
here->MOS2off = value->iValue;
here->MOS2off = (value->iValue != 0);
break;
case MOS2_IC_VBS:
here->MOS2icVBS = value->rValue;

View File

@ -61,7 +61,7 @@ MOS3param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
here->MOS3drainSquaresGiven = TRUE;
break;
case MOS3_OFF:
here->MOS3off = value->iValue;
here->MOS3off = (value->iValue != 0);
break;
case MOS3_IC_VBS:
here->MOS3icVBS = value->rValue;

View File

@ -67,7 +67,7 @@ MOS6param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
here->MOS6drainSquaresGiven = TRUE;
break;
case MOS6_OFF:
here->MOS6off = value->iValue;
here->MOS6off = (value->iValue != 0);
break;
case MOS6_IC_VBS:
here->MOS6icVBS = value->rValue;

View File

@ -62,7 +62,7 @@ MOS9param(int param, IFvalue *value, GENinstance *inst,
here->MOS9drainSquaresGiven = TRUE;
break;
case MOS9_OFF:
here->MOS9off = value->iValue;
here->MOS9off = (value->iValue != 0);
break;
case MOS9_IC_VBS:
here->MOS9icVBS = value->rValue;

View File

@ -70,7 +70,7 @@ SOI3param(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
here->SOI3sourceSquaresGiven = TRUE;
break;
case SOI3_OFF:
here->SOI3off = value->iValue;
here->SOI3off = (value->iValue != 0);
break;
case SOI3_IC_VDS:
here->SOI3icVDS = value->rValue;

View File

@ -32,7 +32,7 @@ VBICparam(int param, IFvalue *value, GENinstance *instPtr, IFvalue *select)
here->VBICareaGiven = TRUE;
break;
case VBIC_OFF:
here->VBICoff = value->iValue;
here->VBICoff = (value->iValue != 0);
break;
case VBIC_IC_VBE:
here->VBICicVBE = value->rValue;