Spread Home
  News
  Docs
  Development
  License
  Credits
  Applications
  JMS4Spread
  Download Spread
  Mailing list
 

 
  Spread Concepts
  About us
 

 
  Center for Networking and Distributed Systems
  About us
  People
  Research
  Funding
  Publications
  Download
 

       

Spread Toolkit


Endian Conversion

These are utility functions for swapping the endianness of an 16 bit integer or 32 bit integer. You can use these to handle endianness problems or write your own.

#define	Flip_int16(type)  (((type >> 8) & 0x00ff) | 
                           ((type << 8) & 0xff00))

#define	Flip_int32(type)  (((type >>24) & 0x000000ff) | 
                           ((type >> 8) & 0x0000ff00) | 
			   ((type << 8) & 0x00ff0000) | 
			   ((type <<24) & 0xff000000) )

Questions or comments to:
webmaster@spread.org
TEL: (410) 516-5562
FAX: (410) 516-6134