From 63a229359efd1b8ad35c63110027687a42343112 Mon Sep 17 00:00:00 2001 From: Baldvin Kovacs Date: Thu, 10 Feb 2022 22:12:46 +0100 Subject: [PATCH] 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::max()); ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- glm/gtc/random.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl index 70485098..249ec9f9 100644 --- a/glm/gtc/random.inl +++ b/glm/gtc/random.inl @@ -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::max()); + static_cast(std::rand() % std::numeric_limits::max())); } };