diff options
author | lloyd <[email protected]> | 2007-10-21 08:25:52 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2007-10-21 08:25:52 +0000 |
commit | 903c761d994599541dd1bc60d5196e6f926abd71 (patch) | |
tree | b32f60bc9301abf8809c911d43ef942c109c2b41 /include | |
parent | cfcfaf67d64abab036d3c4b66837b2a0116e1946 (diff) |
Move reverse_bytes from bit_ops.h to bit_ops.cpp
Diffstat (limited to 'include')
-rw-r--r-- | include/bit_ops.h | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/include/bit_ops.h b/include/bit_ops.h index c160d48e3..9949a1dbb 100644 --- a/include/bit_ops.h +++ b/include/bit_ops.h @@ -26,25 +26,9 @@ template<typename T> inline T rotate_right(T input, u32bit rot) /************************************************* * Byteswap * *************************************************/ -inline u16bit reverse_bytes(u16bit input) - { - return rotate_left(input, 8); - } - -inline u32bit reverse_bytes(u32bit input) - { - input = ((input & 0xFF00FF00) >> 8) | ((input & 0x00FF00FF) << 8); - return rotate_left(input, 16); - } - -inline u64bit reverse_bytes(u64bit input) - { - input = ((input & 0xFF00FF00FF00FF00) >> 8) | - ((input & 0x00FF00FF00FF00FF) << 8); - input = ((input & 0xFFFF0000FFFF0000) >> 16) | - ((input & 0x0000FFFF0000FFFF) << 16); - return rotate_left(input, 32); - } +u16bit reverse_bytes(u16bit); +u32bit reverse_bytes(u32bit); +u64bit reverse_bytes(u64bit); /************************************************* * Array XOR * |