This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: setting BI operands


   : A port I've worked on had frequently did this:
   :    (set cbit (if QI newc 1 0))
   : It should be possible to just use:
   :    (set cbit newc)
   : and for newc to be coerced to BI, based on the convention you've mentioned.

   Right, but does this not already work this way?  Does the negativeness
   of newc have anything to do with the truthness of cbit?

No, it doesn't work as expected.  If I set a BI to the value of newc, I get
the 8-bit value of newc, not a 0 or a 1.  This leads to unpredictable
results when later interrogating cbit.

Ben


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]