From 0092c91f429bfeece88d9b6d215eba8a4feca9b5 Mon Sep 17 00:00:00 2001 From: Simon Krogmann Date: Sun, 9 Aug 2015 19:08:41 +0200 Subject: [PATCH] Fix incorrect parenthesis In VC++ 2013 this error led to a runtime exception when using circularRand or linearRand while "Smaller Type Check" (/RTCc) was enabled. --- glm/gtc/random.inl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl index e21b1953..d299af2f 100644 --- a/glm/gtc/random.inl +++ b/glm/gtc/random.inl @@ -51,7 +51,7 @@ namespace detail GLM_FUNC_QUALIFIER static tvec1 call() { return tvec1( - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max()); } }; @@ -61,8 +61,8 @@ namespace detail GLM_FUNC_QUALIFIER static tvec2 call() { return tvec2( - std::rand(), - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); } }; @@ -72,9 +72,9 @@ namespace detail GLM_FUNC_QUALIFIER static tvec3 call() { return tvec3( - std::rand(), - std::rand(), - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); } }; @@ -84,10 +84,10 @@ namespace detail GLM_FUNC_QUALIFIER static tvec4 call() { return tvec4( - std::rand(), - std::rand(), - std::rand(), - std::rand()) % std::numeric_limits::max(); + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max(), + std::rand() % std::numeric_limits::max()); } };