Changeset 921 for trunk/lib/format_helper.c
- Timestamp:
- 08/21/06 21:04:59 (7 years ago)
- File:
-
- 1 edited
-
trunk/lib/format_helper.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/format_helper.c
r898 r921 272 272 } 273 273 274 uint64_t byteswap64(uint64_t num) 275 { 276 return (byteswap32((num&0xFFFFFFFF00000000ULL)>>32)) 277 |((uint64_t)byteswap32(num&0x00000000FFFFFFFFULL)<<32); 278 } 279 280 uint32_t byteswap32(uint32_t num) 281 { 282 return ((num&0x000000FFU)<<24) 283 | ((num&0x0000FF00U)<<8) 284 | ((num&0x00FF0000U)>>8) 285 | ((num&0xFF000000U)>>24); 286 } 287 288 uint16_t byteswap16(uint16_t num) 289 { 290 return ((num<<8)&0xFF00)|((num>>8)&0x00FF); 291 } 292
Note: See TracChangeset
for help on using the changeset viewer.
