Changeset 17 for abuse/trunk/src/net/include/endian.hpp
- Timestamp:
- Nov 10, 2005, 9:41:13 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/net/include/endian.hpp
r2 r17 19 19 20 20 #ifdef BIGUNS 21 #define swap_ short(x) (((((unsigned short) (x)))<<8)|((((unsigned short) (x)))>>8))22 #define swap_ long(x) \23 ((( ((u nsigned long)(x)) )>>24)|((( ((unsigned long)(x)) )&0x00ff0000)>>8)| \24 ((( ((u nsigned long)(x)) )&0x0000ff00)<<8)|(( ((unsigned long)(x)) )<<24))21 #define swap_uint16(x) (((((uint16_t) (x)))<<8)|((((uint16_t) (x)))>>8)) 22 #define swap_uint32(x) \ 23 ((( ((uint32_t)(x)) )>>24)|((( ((uint32_t)(x)) )&0x00ff0000)>>8)| \ 24 ((( ((uint32_t)(x)) )&0x0000ff00)<<8)|(( ((uint32_t)(x)) )<<24)) 25 25 #else 26 #define swap_ short(x) (x)27 #define swap_ long(x) (x)26 #define swap_uint16(x) (x) 27 #define swap_uint32(x) (x) 28 28 29 29 #endif 30 31 #define uchar unsigned char32 30 33 31 #endif
Note: See TracChangeset
for help on using the changeset viewer.