6 inline int get_byte_order()
7 { // 1 if little endian
8 return (*(u_int32_t
*)"a ") & 0x00000001;
11 #define SWAP_ITERATE \
18 #define SWAP_24BIT_ITERATE \
27 #define SWAP_32BIT_ITERATE \
38 inline int swap_bytes(int wordsize
, unsigned char *buffer
, long len
)
40 register unsigned char byte1
, byte2
, byte3
, byte4
;
41 register unsigned char *buffer1
= buffer
;
42 register unsigned char *buffer2
= buffer
+ 1;
43 register unsigned char *buffer3
= buffer
+ 2;
44 register unsigned char *buffer4
= buffer
+ 3;
46 register long i
= 0, j
= 0, k
= 0;
48 //printf("swap bytes\n");