diff options
Diffstat (limited to 'mfbt/EndianUtils.h')
-rw-r--r-- | mfbt/EndianUtils.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/mfbt/EndianUtils.h b/mfbt/EndianUtils.h index 719e048c12..1dce2bdc29 100644 --- a/mfbt/EndianUtils.h +++ b/mfbt/EndianUtils.h @@ -343,37 +343,37 @@ class Endian : private EndianUtils { protected: /** Read a uint16_t in ThisEndian endianness from |aPtr| and return it. */ - static MOZ_MUST_USE uint16_t readUint16(const void* aPtr) + [[nodiscard]] static uint16_t readUint16(const void* aPtr) { return read<uint16_t>(aPtr); } /** Read a uint32_t in ThisEndian endianness from |aPtr| and return it. */ - static MOZ_MUST_USE uint32_t readUint32(const void* aPtr) + [[nodiscard]] static uint32_t readUint32(const void* aPtr) { return read<uint32_t>(aPtr); } /** Read a uint64_t in ThisEndian endianness from |aPtr| and return it. */ - static MOZ_MUST_USE uint64_t readUint64(const void* aPtr) + [[nodiscard]] static uint64_t readUint64(const void* aPtr) { return read<uint64_t>(aPtr); } /** Read an int16_t in ThisEndian endianness from |aPtr| and return it. */ - static MOZ_MUST_USE int16_t readInt16(const void* aPtr) + [[nodiscard]] static int16_t readInt16(const void* aPtr) { return read<int16_t>(aPtr); } /** Read an int32_t in ThisEndian endianness from |aPtr| and return it. */ - static MOZ_MUST_USE int32_t readInt32(const void* aPtr) + [[nodiscard]] static int32_t readInt32(const void* aPtr) { return read<uint32_t>(aPtr); } /** Read an int64_t in ThisEndian endianness from |aPtr| and return it. */ - static MOZ_MUST_USE int64_t readInt64(const void* aPtr) + [[nodiscard]] static int64_t readInt64(const void* aPtr) { return read<int64_t>(aPtr); } @@ -422,7 +422,7 @@ protected: * format for transmission. */ template<typename T> - MOZ_MUST_USE static T swapToLittleEndian(T aValue) + [[nodiscard]] static T swapToLittleEndian(T aValue) { return maybeSwap<ThisEndian, Little>(aValue); } @@ -452,7 +452,7 @@ protected: * Converts a value of type T to big-endian format. */ template<typename T> - MOZ_MUST_USE static T swapToBigEndian(T aValue) + [[nodiscard]] static T swapToBigEndian(T aValue) { return maybeSwap<ThisEndian, Big>(aValue); } @@ -484,7 +484,7 @@ protected: */ template<typename T> - MOZ_MUST_USE static T swapToNetworkOrder(T aValue) + [[nodiscard]] static T swapToNetworkOrder(T aValue) { return swapToBigEndian(aValue); } @@ -507,7 +507,7 @@ protected: * Converts a value of type T from little-endian format. */ template<typename T> - MOZ_MUST_USE static T swapFromLittleEndian(T aValue) + [[nodiscard]] static T swapFromLittleEndian(T aValue) { return maybeSwap<Little, ThisEndian>(aValue); } @@ -537,7 +537,7 @@ protected: * Converts a value of type T from big-endian format. */ template<typename T> - MOZ_MUST_USE static T swapFromBigEndian(T aValue) + [[nodiscard]] static T swapFromBigEndian(T aValue) { return maybeSwap<Big, ThisEndian>(aValue); } @@ -568,7 +568,7 @@ protected: * in network code. */ template<typename T> - MOZ_MUST_USE static T swapFromNetworkOrder(T aValue) + [[nodiscard]] static T swapFromNetworkOrder(T aValue) { return swapFromBigEndian(aValue); } |