Merge pull request #1151 from rgergely/reorder_static_cast

Apply `static_cast` before calling `detail::mask` in `bitfieldInsert` #1151
This commit is contained in:
Christophe 2023-06-08 17:07:41 +02:00 committed by GitHub
commit 1bd1d627be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,7 +270,7 @@ namespace detail
{
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);
}