This code doesn't make sense, since "*pi" isn't a valid operation. 
However, sizeof(int) is 2 bytes on Palm OS and 4 bytes on the PC, and
since C requires that math be done in int unless a larger type is
used, I think that's affecting the result of your shift operation. 
Try shifting by "24L" to force it to work in long.

On 4/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I am creating some library on two platforms one in windows and other on Palm 
> OS. I am using codewarrior 9.00 for my development.
> I noticed that the value of "pi" is different on Palm and windows platform
>
> Int32 var[32];
> Int32 pi = var;
> unsigned char str = "aaaaaaaaaa";
> unsigned char pc = str;
>
> *pi = (unsigned char)*(pc++) << 24;
>
> The value of pi is different on different platform, why is it
> so
>
> Thanks
>
> John
>
> --
> For information on using the PalmSource Developer Forums, or to unsubscribe, 
> please see http://www.palmos.com/dev/support/forums/
>

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

Reply via email to