In the %d vs. %ld the MSL runtime is working fine. StrPrintF is
prototyped to take a variable number of paramters. This is because the
arguments passed depend upon the first argument - the format string.
You used a format string to tell PalmOS to take a 16 bit value off the
stack. You told MSL to place a 32 bit value on the stack.
If the function being called is prototyped using PalmOS types, and
common.h is properly setup to match compiler options, the compiler will
either cast, or generate a warning/error depending upon the
circumstances.
I may be wrong, but I think you were passing a character as a literal
(ex. 'x'). If so, the problem is your changing the size of int. The
literal is being treated as an int (ala ANSI). With 16 bit ints, this
is not a problem. The 68000 always pushes 16 bit values on the stack
anyway, so pushing a byte or a 16-bit int sets up the same stack frame.
But, if ints are extended in size, the char value is two bytes shifted
in the stack frame and the called routine picks up the wrong value. You
might be able to control literal handling in language or C68 settings.
I may be naive, but wouldn't it be easier to set int to match the native
size of the OS and specifically use long's when you really values larger
than +/- 32K? Your code would also be smaller and faster.
Good Luck,
-jjf
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 03, 2000 11:29 AM
To: Palm Developer Forum
Subject: Re: StrPrintF is not working for me.
[Snip]
I want my int to be 4 bytes, I have set all the right flags. The point
was and
is that the MSL runtime lib (4i) does not pass
char properly to the SDK systems ....
Has any one encountered this?
Thanks again
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html