interfacing C bitfield structs

Walter Bright newshound at digitalmars.com
Sun Mar 19 21:22:24 PST 2006


"Wolfgang Draxinger" <wdraxinger at darkstargames.de> wrote in message 
news:dvi5gv$qtg$1 at digitaldaemon.com...
> These set functions won't work if b==0, since it's just an OR.
> What's needed is
>
> BITS = (BITS & ~(1<<n)) | b ? 1<<n : 0 ;

You're right. 





More information about the Digitalmars-d mailing list