> > personally, the use of "char", "int" etc in Palm programming should
> > be forbidden :) use the standard data types - they are more specific
> > than "int". for example, Int32 = 32 bit integer.
> >
> > you'll have more readability this way.
>
> I disagree with this. Sure, when you use Palm supplied/supported functions,
> by all means use their types. But in order for your code to be as efficient
> as you want, use literal ints. There's a reason the relevant standards
> *dont* specify the exact size of an int: by not doing so, the compiler
> vendor is free to use whatever sized int is 'natural' and/or most efficient
> for the target CPU.
as a developer, especially on embedded systems like the Palm OS, it is
very important to know what the min/max values are for your integer
values.. what if you have a for loop of 500 iterations, and by
specifying an "int", the compiler says.. "z80" cpu.. int == 8 bit.
your for loop just got killed by the compiler..
this is an extreme case scenario - are 8bit CPU's still being made? ;P
keep in mind, that UInt16 is just a type-def, however, it guarentee's
the size of the integer, regardless of the destination platform
(in theory). Palm obviously thought forward, as the default sizes
for 'int' and others on ARM CPU's may not be the same as on m68k
know your data type sizes :) dont assume anything.. some interesting
bugs come out of saying "ahh, i trust the compiler". :))
// az
[EMAIL PROTECTED]
http://www.ardiri.com/ <--- free games!
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/