Skip to content

Commit d54304e

Browse files
committed
[#3210] fix clang error
error: constexpr function never produces a constant expression [-Winvalid-constexpr]
1 parent f09f40a commit d54304e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/lib/util/io.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace util {
2323
///
2424
/// \return Value of the integer.
2525
template <typename uint_t>
26-
constexpr uint_t
26+
uint_t
2727
readUint(void const* const buffer, size_t const length) {
2828
constexpr size_t size(sizeof(uint_t));
2929
if (length < size) {
@@ -52,7 +52,7 @@ readUint(void const* const buffer, size_t const length) {
5252
///
5353
/// \return pointer to the next byte after stored value
5454
template <typename uint_t>
55-
constexpr uint8_t*
55+
uint8_t*
5656
writeUint(uint_t const value, void* const buffer, size_t const length) {
5757
constexpr size_t size(sizeof(uint_t));
5858
if (length < size) {
@@ -72,37 +72,37 @@ writeUint(uint_t const value, void* const buffer, size_t const length) {
7272
}
7373

7474
/// \brief uint16_t wrapper over readUint.
75-
constexpr inline uint16_t
75+
inline uint16_t
7676
readUint16(void const* const buffer, size_t const length) {
7777
return (readUint<uint16_t>(buffer, length));
7878
}
7979

8080
/// \brief uint32_t wrapper over readUint.
81-
constexpr inline uint32_t
81+
inline uint32_t
8282
readUint32(void const* const buffer, size_t const length) {
8383
return (readUint<uint32_t>(buffer, length));
8484
}
8585

8686
/// \brief uint16_t wrapper over readUint.
87-
constexpr inline uint64_t
87+
inline uint64_t
8888
readUint64(void const* const buffer, size_t const length) {
8989
return (readUint<uint64_t>(buffer, length));
9090
}
9191

9292
/// \brief uint16_t wrapper over writeUint.
93-
constexpr inline uint8_t*
93+
inline uint8_t*
9494
writeUint16(uint16_t const value, void* const buffer, size_t const length) {
9595
return (writeUint(value, buffer, length));
9696
}
9797

9898
/// \brief uint32_t wrapper over writeUint.
99-
constexpr inline uint8_t*
99+
inline uint8_t*
100100
writeUint32(uint32_t const value, void* const buffer, size_t const length) {
101101
return (writeUint(value, buffer, length));
102102
}
103103

104104
/// \brief uint64_t wrapper over writeUint.
105-
constexpr inline uint8_t*
105+
inline uint8_t*
106106
writeUint64(uint64_t const value, void* const buffer, size_t const length) {
107107
return (writeUint(value, buffer, length));
108108
}

0 commit comments

Comments
 (0)