apply static_cast before calling mask in bitfieldInsert

This commit is contained in:
Gergely Racz 2023-05-12 11:09:41 +02:00
parent efec5db081
commit 6486113379

View File

@ -270,7 +270,7 @@ namespace detail
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldInsert' only accept integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldInsert' only accept integer values");
T const Mask = static_cast<T>(detail::mask(Bits) << Offset); T const Mask = detail::mask(static_cast<T>(Bits)) << Offset;
return (Base & ~Mask) | ((Insert << static_cast<T>(Offset)) & Mask); return (Base & ~Mask) | ((Insert << static_cast<T>(Offset)) & Mask);
} }