Fix wrong return type for ReverseBytes
This commit is contained in:
parent
5f29e9cc28
commit
880374f98e
|
@ -13,15 +13,15 @@ namespace Feather
|
|||
|
||||
// TODO: Make this constexpr
|
||||
inline uint8_t ReverseBytes(uint8_t n) { return n; }
|
||||
#ifdef __GNUC__
|
||||
#ifdef __GNUC__
|
||||
inline uint16_t ReverseBytes(uint16_t n) { return __builtin_bswap16(n); }
|
||||
inline uint32_t ReverseBytes(uint32_t n) { return __builtin_bswap32(n); }
|
||||
inline uint32_t ReverseBytes(uint64_t n) { return __builtin_bswap64(n); }
|
||||
#else
|
||||
inline uint64_t ReverseBytes(uint64_t n) { return __builtin_bswap64(n); }
|
||||
#else
|
||||
inline uint16_t ReverseBytes(uint16_t n) { return _byteswap_ushort(n); }
|
||||
inline uint32_t ReverseBytes(uint32_t n) { return _byteswap_ulong (n); }
|
||||
inline uint64_t ReverseBytes(uint64_t n) { return _byteswap_uint64(n); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
inline int8_t ReverseBytes(int8_t n) { return n; }
|
||||
inline int16_t ReverseBytes(int16_t n) { return int16_t(ReverseBytes(uint16_t(n))); }
|
||||
|
|
Loading…
Reference in New Issue