aboutsummaryrefslogtreecommitdiffstats
path: root/include/chilbert/detail/operations.hpp
diff options
context:
space:
mode:
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);
}
}