3 #include <netinet/in.h>
5 float l3Fswap(
float swapped)
7 unsigned int* uintptr = (
unsigned int*) &swapped;
8 unsigned int uintvar = ntohl(*uintptr);
9 float* floatvar = (
float*)&uintvar;
13 uint32 l3Swap32(uint32 in)
18 return (x&0xff000000) >> 24 | \
19 (x&0x00ff0000) >> 8 | \
20 (x&0x0000ff00) << 8 | \
25 uint16 l3Swap16(uint16 in)
31 return (x&0xFF00) >> 8 | (x&0xFF) << 8 ;
34 void l3SwapBuffer(
void *dest,
void *src,
unsigned int nDWords)
36 for (
unsigned int i = 0; i<nDWords; i++) {
37 ((uint32 *)dest)[i] = swap32(((uint32 *)src)[i]);
41 bool checkByteOrder(uint32 byte_order)
43 uint32 raw_format_order = 0x04030201;
44 return ( byte_order == raw_format_order );