Skip to content

Commit

Permalink
Update byteswap.h
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryptogenic authored Dec 21, 2021
1 parent 7c0bc2c commit d148a96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/byteswap.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ static __inline uint16_t __bswap_16(uint16_t __x)

static __inline uint32_t __bswap_32(uint32_t __x)
{
return __x>>24 | __x>>8&0xff00 | __x<<8&0xff0000 | __x<<24;
return __x>>24 | (__x>>8&0xff00) | (__x<<8&0xff0000) | __x<<24;
}

static __inline uint64_t __bswap_64(uint64_t __x)
{
return __bswap_32(__x)+0ULL<<32 | __bswap_32(__x>>32);
return (__bswap_32(__x)+0ULL)<<32 | __bswap_32(__x>>32);
}

#define bswap_16(x) __bswap_16(x)
Expand Down

0 comments on commit d148a96

Please sign in to comment.