diff options
Diffstat (limited to 'common/bits.c')
| -rw-r--r-- | common/bits.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/common/bits.c b/common/bits.c index b9814f6..698c082 100644 --- a/common/bits.c +++ b/common/bits.c @@ -12,21 +12,19 @@ __weak uint16_t __bswap16(const uint16_t u) #undef __bswap32 __weak uint32_t __bswap32(const uint32_t u) { - return (u & 0xff000000) >> 24 | - (u & 0x00ff0000) >> 8 | - (u & 0x0000ff00) << 8 | - (u & 0x000000ff) << 24; + return (u & 0xff000000) >> 24 | (u & 0x00ff0000) >> 8 | + (u & 0x0000ff00) << 8 | (u & 0x000000ff) << 24; } #undef __bswap64 __weak uint64_t __bswap64(const uint64_t u) { - return (u & 0xff00000000000000ULL) >> 56 | - (u & 0x00ff000000000000ULL) >> 40 | - (u & 0x0000ff0000000000ULL) >> 24 | - (u & 0x000000ff00000000ULL) >> 8 | - (u & 0x00000000ff000000ULL) << 8 | - (u & 0x0000000000ff0000ULL) << 24 | - (u & 0x000000000000ff00ULL) << 40 | - (u & 0x00000000000000ffULL) << 56; + return (u & 0xff00000000000000ULL) >> 56 | + (u & 0x00ff000000000000ULL) >> 40 | + (u & 0x0000ff0000000000ULL) >> 24 | + (u & 0x000000ff00000000ULL) >> 8 | + (u & 0x00000000ff000000ULL) << 8 | + (u & 0x0000000000ff0000ULL) << 24 | + (u & 0x000000000000ff00ULL) << 40 | + (u & 0x00000000000000ffULL) << 56; } |
