4 inline unsigned short byteswap(unsigned short x
)
6 #if defined(__ppc__) || defined(__ppc64__)
7 return (x
<< 8 | x
>> 8);
13 inline unsigned long byteswap(unsigned long x
)
15 #if defined(__ppc__) || defined(__ppc64__)
17 ( (x
<< 24) & 0xFF000000) |
18 ( (x
<< 8) & 0x00FF0000) |
19 ( (x
>> 8) & 0x0000FF00) |
20 ( (x
>> 24) & 0x000000FF) ;
26 inline unsigned int byteswap(unsigned int x
)
28 #if defined(__ppc__) || defined(__ppc64__)
30 ( (x
<< 24) & 0xFF000000) |
31 ( (x
<< 8) & 0x00FF0000) |
32 ( (x
>> 8) & 0x0000FF00) |
33 ( (x
>> 24) & 0x000000FF) ;
39 inline short byteswap(short x
) { return byteswap( (unsigned short) x
); }
40 inline long byteswap(long x
) { return byteswap( (unsigned long) x
); }
41 inline int byteswap(int x
) { return byteswap( (unsigned int) x
); }