Well, not to sound .... <evil grin>  but this is why it is so popular to
use portal types:  ex.  UINT, DWORD, etc.  You just have to change the
header file to match the target OS.

Regarding your first question, yes, you can just cast the literal to
char (or 'Char'), as in "(Char)'t'".

Regarding your second question, the runtime library isn't even involved.
StrPrintF is built into the operating system.  Altering int size is a
compiler option.  The operating system and compiler are each doing what
you tell them to, the results just aren't what you want.  I don't know
about you, but this is something I experience frequently with
computers...

The reason that there are so many compiler options are:  1.  The same
compiler is sold for other systems and 2.  Situations like yours.

If you have a ton of code which assumes 'int' == 'long', then it is
easier to change the behavior of int to match.  Presumably, you have to
search and replace printf and sprintf calls anyway, so you can do your
casting and cleanup then...

If it is any consolation, I spent a very long night recently tracking
down a problem with a ported protocol stack - a Power PC compiler was
defaulting to unsigned char's.  Fortunately, I just had to change:

"typedef char ICHAR" to "typedef signed char ICHAR" in a header file to
fix the problem.

Best Regards,
-jjf

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 04, 2000 5:17 AM
To: Palm Developer Forum
Subject: RE: StrPrintF is not working for me.




JJF writes
> 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.

Not to sound ...., but it is naive when your porting a library that took
us a
year to develop
what I don't understand is why can the MSL runtime take care of this?
it's like
saying we got this
option but it really does not work... now which is it


Arman



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

Reply via email to