Mardi 20 Mars 2001 06:10, Rob Cochran a �crit:

> I've been unable to find any documentation or examples showing how to
> convert big endian to little endian types, and vice versa.
> Specifically, I need functions to convert palm integers (16-bit) to and
> from desktop (Intel) integers (32-bits).  

Just use these 2 macros :

#define SwapW(x) ((unsigned word)(((x>>8)&0xff)|(x<<8)))
#define SwapL(x) ((unsigned long)((SwapW(x))<<16)|(SwapW(x>>16)&0xffff))

-- 
Daniel Morais

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