Fix implicit conversion compiler error in glm/gtc/random.inl

/glm/gtc/random.inl:25:17: error: implicit conversion loses integer precision: 'int' to 'unsigned char' [-Werror,-Wimplicit-int-conversion]
                                std::rand() % std::numeric_limits<uint8>::max());
                                ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Baldvin Kovacs 2022-02-10 22:12:46 +01:00
parent 6ad79aae3e
commit 63a229359e

View file

@ -22,7 +22,7 @@ namespace detail
GLM_FUNC_QUALIFIER static vec<1, uint8, P> call()
{
return vec<1, uint8, P>(
std::rand() % std::numeric_limits<uint8>::max());
static_cast<uint8>(std::rand() % std::numeric_limits<uint8>::max()));
}
};