From: Andrei Pavel Date: Thu, 21 Mar 2024 21:33:44 +0000 (+0200) Subject: [#3210] fix clang error X-Git-Tag: Kea-2.5.7~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d54304e5d0d9f80eee97b378f0c7e4f10eea333d;p=thirdparty%2Fkea.git [#3210] fix clang error error: constexpr function never produces a constant expression [-Winvalid-constexpr] --- 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 -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 -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(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(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(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)); }