diff options
author | Andrei Pavel <andrei@isc.org> | 2024-03-21 22:33:44 +0100 |
---|---|---|
committer | Andrei Pavel <andrei@isc.org> | 2024-03-21 22:33:44 +0100 |
commit | d54304e5d0d9f80eee97b378f0c7e4f10eea333d (patch) | |
tree | 0fff0aa3445cd70025aca671b2f5f46b60fbd56b | |
parent | [#3300] Added ChangeLog (diff) | |
download | kea-d54304e5d0d9f80eee97b378f0c7e4f10eea333d.tar.xz kea-d54304e5d0d9f80eee97b378f0c7e4f10eea333d.zip |
[#3210] fix clang error
error: constexpr function never produces a constant expression [-Winvalid-constexpr]
-rw-r--r-- | src/lib/util/io.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/util/io.h b/src/lib/util/io.h index 4e5f8c41bd..82c32fe88b 100644 --- a/src/lib/util/io.h +++ b/src/lib/util/io.h @@ -23,7 +23,7 @@ namespace util { /// /// \return Value of the integer. template <typename uint_t> -constexpr uint_t +uint_t readUint(void const* const buffer, size_t const length) { constexpr size_t size(sizeof(uint_t)); if (length < size) { @@ -52,7 +52,7 @@ readUint(void const* const buffer, size_t const length) { /// /// \return pointer to the next byte after stored value template <typename uint_t> -constexpr uint8_t* +uint8_t* writeUint(uint_t const value, void* const buffer, size_t const length) { constexpr size_t size(sizeof(uint_t)); if (length < size) { @@ -72,37 +72,37 @@ writeUint(uint_t const value, void* const buffer, size_t const length) { } /// \brief uint16_t wrapper over readUint. -constexpr inline uint16_t +inline uint16_t readUint16(void const* const buffer, size_t const length) { return (readUint<uint16_t>(buffer, length)); } /// \brief uint32_t wrapper over readUint. -constexpr inline uint32_t +inline uint32_t readUint32(void const* const buffer, size_t const length) { return (readUint<uint32_t>(buffer, length)); } /// \brief uint16_t wrapper over readUint. -constexpr inline uint64_t +inline uint64_t readUint64(void const* const buffer, size_t const length) { return (readUint<uint64_t>(buffer, length)); } /// \brief uint16_t wrapper over writeUint. -constexpr inline uint8_t* +inline uint8_t* writeUint16(uint16_t const value, void* const buffer, size_t const length) { return (writeUint(value, buffer, length)); } /// \brief uint32_t wrapper over writeUint. -constexpr inline uint8_t* +inline uint8_t* writeUint32(uint32_t const value, void* const buffer, size_t const length) { return (writeUint(value, buffer, length)); } /// \brief uint64_t wrapper over writeUint. -constexpr inline uint8_t* +inline uint8_t* writeUint64(uint64_t const value, void* const buffer, size_t const length) { return (writeUint(value, buffer, length)); } |