>It makes sense that on the Palm, ints are 16-bit, not 32-bit.
>
>But what I didn't catch is that in macros, such as:
>
>#define MY_FLAG (32768 << 256)
>
>UInt32 flags |= MY_FLAG;
>
>Everything will act like it's working OK -> in fact, all the normally
>"integer math" functions such as (a << b) still work in 32-bits.
>
>But the #defines don't. The #define above will only contain the low
>word of the value, and since you can't see the value of a define in the
>debugger, all you notice is that values and branches aren't working
>right.
>
>The best way I found around this was just to check the USE 4 BYTE INTS
>option.
Or, by either explicitly using the C++ compiler or changing your
source file suffix to .cpp, you could use:
static const UInt32 MY_FLAG = xxxx; // 32768 shifted left by 256 bits
is invalid
-- Ken
Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/