> Forgive my ignorance but I don't see what type of casting I 
> could do to prevent this sign extension. I tried:
>
> WChar w;
> Char  c;
>
> w = ( WChar ) c;
>
> to no avail, 0xEC became 0xFFEC. So in the end I added:
> w &= 0x00FF;

Char is a 'signed char' - so, naturally, it'll think about
the sign bit if you try to put it elsewhere, for example:

  w = (WChar) -1;

will put 0xFFFF into w :) what you really wanted to do is:

  WChar w;
  w = (unsigned short)c;

maybe that'll help :)

---
Aaron Ardiri                        [EMAIL PROTECTED]
CEO - CTO                                           +46 70 656 1143
Mobile Wizardry                      http://www.mobilewizardry.com/


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

Reply via email to