Commit 4284b0e2 authored by Max Kellermann's avatar Max Kellermann

util/ByteReverse: add "noexcept"

parent 9def9b35
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
void void
reverse_bytes_16(uint16_t *gcc_restrict dest, reverse_bytes_16(uint16_t *gcc_restrict dest,
const uint16_t *gcc_restrict src, const uint16_t *src_end) const uint16_t *gcc_restrict src,
const uint16_t *src_end) noexcept
{ {
assert(dest != nullptr); assert(dest != nullptr);
assert(src != nullptr); assert(src != nullptr);
...@@ -39,7 +40,8 @@ reverse_bytes_16(uint16_t *gcc_restrict dest, ...@@ -39,7 +40,8 @@ reverse_bytes_16(uint16_t *gcc_restrict dest,
void void
reverse_bytes_32(uint32_t *gcc_restrict dest, reverse_bytes_32(uint32_t *gcc_restrict dest,
const uint32_t *gcc_restrict src, const uint32_t *src_end) const uint32_t *gcc_restrict src,
const uint32_t *src_end) noexcept
{ {
assert(dest != nullptr); assert(dest != nullptr);
assert(src != nullptr); assert(src != nullptr);
...@@ -53,7 +55,8 @@ reverse_bytes_32(uint32_t *gcc_restrict dest, ...@@ -53,7 +55,8 @@ reverse_bytes_32(uint32_t *gcc_restrict dest,
void void
reverse_bytes_64(uint64_t *gcc_restrict dest, reverse_bytes_64(uint64_t *gcc_restrict dest,
const uint64_t *gcc_restrict src, const uint64_t *src_end) const uint64_t *gcc_restrict src,
const uint64_t *src_end) noexcept
{ {
assert(dest != nullptr); assert(dest != nullptr);
assert(src != nullptr); assert(src != nullptr);
...@@ -67,7 +70,7 @@ reverse_bytes_64(uint64_t *gcc_restrict dest, ...@@ -67,7 +70,7 @@ reverse_bytes_64(uint64_t *gcc_restrict dest,
static void static void
reverse_bytes_linear(uint8_t *gcc_restrict dest, reverse_bytes_linear(uint8_t *gcc_restrict dest,
const uint8_t *gcc_restrict src, size_t n) const uint8_t *gcc_restrict src, size_t n) noexcept
{ {
src += n; src += n;
...@@ -78,7 +81,7 @@ reverse_bytes_linear(uint8_t *gcc_restrict dest, ...@@ -78,7 +81,7 @@ reverse_bytes_linear(uint8_t *gcc_restrict dest,
static void static void
reverse_bytes_generic(uint8_t *gcc_restrict dest, reverse_bytes_generic(uint8_t *gcc_restrict dest,
const uint8_t *gcc_restrict src, const uint8_t *src_end, const uint8_t *gcc_restrict src, const uint8_t *src_end,
size_t frame_size) size_t frame_size) noexcept
{ {
assert(dest != nullptr); assert(dest != nullptr);
assert(src != nullptr); assert(src != nullptr);
...@@ -96,7 +99,7 @@ reverse_bytes_generic(uint8_t *gcc_restrict dest, ...@@ -96,7 +99,7 @@ reverse_bytes_generic(uint8_t *gcc_restrict dest,
void void
reverse_bytes(uint8_t *gcc_restrict dest, reverse_bytes(uint8_t *gcc_restrict dest,
const uint8_t *gcc_restrict src, const uint8_t *src_end, const uint8_t *gcc_restrict src, const uint8_t *src_end,
size_t frame_size) size_t frame_size) noexcept
{ {
assert(dest != nullptr); assert(dest != nullptr);
assert(src != nullptr); assert(src != nullptr);
......
...@@ -28,21 +28,24 @@ ...@@ -28,21 +28,24 @@
* used for in-place operation. * used for in-place operation.
*/ */
void void
reverse_bytes_16(uint16_t *dest, const uint16_t *src, const uint16_t *src_end); reverse_bytes_16(uint16_t *dest,
const uint16_t *src, const uint16_t *src_end) noexcept;
/** /**
* Reverse the bytes in each 32 bit "frame". This function can be * Reverse the bytes in each 32 bit "frame". This function can be
* used for in-place operation. * used for in-place operation.
*/ */
void void
reverse_bytes_32(uint32_t *dest, const uint32_t *src, const uint32_t *src_end); reverse_bytes_32(uint32_t *dest,
const uint32_t *src, const uint32_t *src_end) noexcept;
/** /**
* Reverse the bytes in each 64 bit "frame". This function can be * Reverse the bytes in each 64 bit "frame". This function can be
* used for in-place operation. * used for in-place operation.
*/ */
void void
reverse_bytes_64(uint64_t *dest, const uint64_t *src, const uint64_t *src_end); reverse_bytes_64(uint64_t *dest,
const uint64_t *src, const uint64_t *src_end) noexcept;
/** /**
* Reverse the bytes in each "frame". This function cannot be used * Reverse the bytes in each "frame". This function cannot be used
...@@ -50,6 +53,6 @@ reverse_bytes_64(uint64_t *dest, const uint64_t *src, const uint64_t *src_end); ...@@ -50,6 +53,6 @@ reverse_bytes_64(uint64_t *dest, const uint64_t *src, const uint64_t *src_end);
*/ */
void void
reverse_bytes(uint8_t *dest, const uint8_t *src, const uint8_t *src_end, reverse_bytes(uint8_t *dest, const uint8_t *src, const uint8_t *src_end,
size_t frame_size); size_t frame_size) noexcept;
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment