> From: Gee Ng [mailto:[EMAIL PROTECTED]]
> BTW, is it legal to use statements such as:
>    DateType    date;
>    date.day = 3;
> Even if DateType is actually just a bunch of bitfields?? (I 
> actually have some struct that I defined in my program that
> uses the same technique as DateType, i.e., using bitfields,
> however, I'm currently using bitwise-shifts
> as I've no idea if assignment statements such as those above 
> are valid.)

Yes, that's perfectly legal.  In fact if you examine the generated code (the
Disassemble command in CW) you'll see the compiler uses shifting and masking
to implement bitfields, basically the same thing you are explicitly coding.
So it's usually best to just let the compiler do all the bit twiddling for
you.

(Note that it's only the CodeWarrior _debugger_ that can't _display_
bitfields properly; the compiler actually _implements_ bitfields just fine.)

-slj-


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to