diff --git a/libuavcan/include/uavcan/internal/marshalling/scalar_codec.hpp b/libuavcan/include/uavcan/internal/marshalling/scalar_codec.hpp index f62336676d..78a30b72a8 100644 --- a/libuavcan/include/uavcan/internal/marshalling/scalar_codec.hpp +++ b/libuavcan/include/uavcan/internal/marshalling/scalar_codec.hpp @@ -78,7 +78,7 @@ class ScalarCodec static typename EnableIf<((sizeof(T) * 8) > BITLEN)>::Type clearExtraBits(T& value) { - value &= (1 << BITLEN) - 1; // Signedness doesn't matter + value &= (T(1) << BITLEN) - 1; // Signedness doesn't matter } template