> I'm noticing errors while performing simple mod and
> division on constants that I have defined with
> #define. Is there a more specific way to use #define
> so that I don't have to cast my constants to an int
> every time?

Is there a reason you can't place the cast within the #define?  Such as:

#define CONST1 ((UInt8)255)

There are also modifiers you can place on the numbers themselves.  I use the
following definitions in my project:

#define MAX_UINT32 4294967295U
#define MAX_UINT16 65535U
#define MAX_UINT4 15U

These constants are typed as unsigned (although the size info isn't
present).  Also, this stuff may be compiler dependent.  I know it works for
the prc-tool chain.

Rick Reynolds


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

Reply via email to