blob: 25e851883ed9571c480dc1899e4e2d68f3306af5 [file] [log] [blame]
Andrew Geisslerac970dd2021-02-12 15:32:45 -06001From 5b83983b246cff440de4421696b6b5dd9072ed2d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 6 Feb 2021 11:36:23 -0800
4Subject: [PATCH] Silence clang warnings
5
6Fixes
7glm/gtc/random.inl:25:17: error: implicit conversion loses integer precision: 'int' to 'unsigned char' [-Werror,-Wimplicit-int-conversion]
8| std::rand() % std::numeric_limits<uint8>::max());
9| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10
11glm/gtc/../ext/quaternion_common.inl:76:87: error: unused parameter 'k' [-Werror,-Wunused-parameter]
12 GLM_FUNC_QUALIFIER qua<T, Q> slerp(qua<T, Q> const& x, qua<T, Q> const& y, T a, S k)
13 ^
14
15Upstream-Status: Submitted [https://github.com/g-truc/glm/pull/1055]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 glm/ext/quaternion_common.inl | 2 +-
19 glm/gtc/random.inl | 2 +-
20 2 files changed, 2 insertions(+), 2 deletions(-)
21
22diff --git a/glm/ext/quaternion_common.inl b/glm/ext/quaternion_common.inl
23index 0e4a3bb2..8f9dccef 100644
24--- a/glm/ext/quaternion_common.inl
25+++ b/glm/ext/quaternion_common.inl
26@@ -104,7 +104,7 @@ namespace glm
27 {
28 // Graphics Gems III, page 96
29 T angle = acos(cosTheta);
30- T phi = angle + k * glm::pi<T>();
31+ T phi = angle + static_cast<float>(k) * glm::pi<T>();
32 return (sin(angle - a * phi)* x + sin(a * phi) * z) / sin(angle);
33 }
34 }
35diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl
36index 70485098..a4af2a06 100644
37--- a/glm/gtc/random.inl
38+++ b/glm/gtc/random.inl
39@@ -22,7 +22,7 @@ namespace detail
40 GLM_FUNC_QUALIFIER static vec<1, uint8, P> call()
41 {
42 return vec<1, uint8, P>(
43- std::rand() % std::numeric_limits<uint8>::max());
44+ static_cast<uint8>(std::rand()) % std::numeric_limits<uint8>::max());
45 }
46 };
47
48--
492.30.0
50