This is interesting.  I wondered why I didn't got kicked by writting stuff like
this in the early days. I went back and checked. The reason was on Sun Sparc
machines I used, the int is by default the same as long int.

I am not sure if there is special platform reason on the choice of int size,
but that's truely a good choice!  This is probably not good for Palm. One
simple reason can be waste of memory.

Max
> This seems to surprise people more when the example is
> 
>       UInt32 c = 1000 * 1000;
> 
> but the reasoning is exactly the same, and the multiplication is done in
> 16 bits.  (Because "int" on m68k Palm OS is 16 bits.)
> 
> Jonathan's case, which I believe he's been struggling with for almost
> two weeks now, is similar:
> 
>       UInt32 c = 2 << 18;
> 
> "2" is an int, as is "18".  The fact that the result of the 16 bit shift
> operation is being assigned to an unsigned long is irrelevant.
> 
> "2" is an int, but "2L" is something else, as is "2UL".


=====
-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-
Got Palm?
Get ExBox at http://www.weirdwww.com/ExBox to beam anything!

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

-- 
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