aboutsummaryrefslogtreecommitdiffstats
path: root/include/chilbert/detail/operations.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-09-16 16:27:19 -0400
committerDavid Robillard <d@drobilla.net>2022-09-16 22:31:06 -0400
commit8697e134aeac0318e6686d785113f0763cbc3c1c (patch)
tree86897017d682939a1faf586b5bb61a15f814387a /include/chilbert/detail/operations.hpp
parent49dab5622b31421eb6af84eae376d73fae1cd4a0 (diff)
downloadchilbert-8697e134aeac0318e6686d785113f0763cbc3c1c.tar.gz
chilbert-8697e134aeac0318e6686d785113f0763cbc3c1c.tar.bz2
chilbert-8697e134aeac0318e6686d785113f0763cbc3c1c.zip
Fix signed bitwise operator operands
Diffstat (limited to 'include/chilbert/detail/operations.hpp')
-rw-r--r--include/chilbert/detail/operations.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/chilbert/detail/operations.hpp b/include/chilbert/detail/operations.hpp
index 7e846b3..398944f 100644
--- a/include/chilbert/detail/operations.hpp
+++ b/include/chilbert/detail/operations.hpp
@@ -145,7 +145,7 @@ template <typename T>
std::enable_if_t<std::is_integral<T>::value>
gray_code(T& value)
{
- value ^= (value >> 1);
+ value ^= (value >> 1U);
}
/// Calculates the inverse Gray Code of `value` in place
@@ -158,7 +158,7 @@ std::enable_if_t<std::is_integral<T>::value>
gray_code_inv(T& value)
{
constexpr T shift_end = sizeof(T) * CHAR_BIT;
- for (T shift = 1; shift < shift_end; shift <<= 1) {
+ for (T shift = 1U; shift < shift_end; shift <<= 1U) {
value ^= (value >> shift);
}
}