endian: mark one-byte "swap" functions as constexpr
While being here only for templates to work with various data types, the one-byte "swap" functions are actually noop. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
bf029efd07
commit
016577dbec
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
namespace stdex
|
namespace stdex
|
||||||
{
|
{
|
||||||
inline uint8_t byteswap(_In_ const uint8_t value)
|
inline constexpr uint8_t byteswap(_In_ const uint8_t value)
|
||||||
{
|
{
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@ -95,8 +95,8 @@ namespace stdex
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int8_t byteswap(_In_ const char value) { return byteswap(static_cast<uint8_t>(value)); }
|
inline constexpr int8_t byteswap(_In_ const char value) { return byteswap(static_cast<uint8_t>(value)); }
|
||||||
inline int8_t byteswap(_In_ const int8_t value) { return byteswap(static_cast<uint8_t>(value)); }
|
inline constexpr int8_t byteswap(_In_ const int8_t value) { return byteswap(static_cast<uint8_t>(value)); }
|
||||||
inline int16_t byteswap(_In_ const int16_t value) { return byteswap(static_cast<uint16_t>(value)); }
|
inline int16_t byteswap(_In_ const int16_t value) { return byteswap(static_cast<uint16_t>(value)); }
|
||||||
inline int32_t byteswap(_In_ const int32_t value) { return byteswap(static_cast<uint32_t>(value)); }
|
inline int32_t byteswap(_In_ const int32_t value) { return byteswap(static_cast<uint32_t>(value)); }
|
||||||
inline int64_t byteswap(_In_ const int64_t value) { return byteswap(static_cast<uint64_t>(value)); }
|
inline int64_t byteswap(_In_ const int64_t value) { return byteswap(static_cast<uint64_t>(value)); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user