Fix SB function when using sizes greater than 32 bits

pull/362/head
Jonathan G Rennison 2 years ago
parent 9e1a78c86e
commit 29521ef883

@ -60,7 +60,8 @@ template <typename T, typename U>
static inline T SB(T &x, const uint8 s, const uint8 n, const U d)
{
x &= (T)(~((((T)1U << n) - 1) << s));
x |= (T)(d << s);
typename std::make_unsigned<T>::type td = d;
x |= (T)(td << s);
return x;
}

Loading…
Cancel
Save