aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics/glm/glm/0001-Silence-clang-warnings.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-graphics/glm/glm/0001-Silence-clang-warnings.patch')
-rw-r--r--meta-oe/recipes-graphics/glm/glm/0001-Silence-clang-warnings.patch143
1 files changed, 119 insertions, 24 deletions
diff --git a/meta-oe/recipes-graphics/glm/glm/0001-Silence-clang-warnings.patch b/meta-oe/recipes-graphics/glm/glm/0001-Silence-clang-warnings.patch
index 25e851883e..10692dd423 100644
--- a/meta-oe/recipes-graphics/glm/glm/0001-Silence-clang-warnings.patch
+++ b/meta-oe/recipes-graphics/glm/glm/0001-Silence-clang-warnings.patch
@@ -1,6 +1,6 @@
-From 5b83983b246cff440de4421696b6b5dd9072ed2d Mon Sep 17 00:00:00 2001
+From bd9b5060bc3b9581090d44f15b4e236566ea86a6 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
-Date: Sat, 6 Feb 2021 11:36:23 -0800
+Date: Fri, 4 Jun 2021 12:57:57 -0700
Subject: [PATCH] Silence clang warnings
Fixes
@@ -12,15 +12,20 @@ glm/gtc/../ext/quaternion_common.inl:76:87: error: unused parameter 'k' [-Werror
GLM_FUNC_QUALIFIER qua<T, Q> slerp(qua<T, Q> const& x, qua<T, Q> const& y, T a, S k)
^
+and
+
+test/gtx/gtx_fast_trigonometry.cpp:135:9: error: variable 'result' set but not used [-Werror,-Wunused-but-set-variable]
+| float result = 0.f;
+| ^
+
Upstream-Status: Submitted [https://github.com/g-truc/glm/pull/1055]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
- glm/ext/quaternion_common.inl | 2 +-
- glm/gtc/random.inl | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ glm/ext/quaternion_common.inl | 2 +-
+ glm/gtc/random.inl | 2 +-
+ test/gtx/gtx_fast_trigonometry.cpp | 30 ++++++++++++------------------
+ 3 files changed, 14 insertions(+), 20 deletions(-)
-diff --git a/glm/ext/quaternion_common.inl b/glm/ext/quaternion_common.inl
-index 0e4a3bb2..8f9dccef 100644
--- a/glm/ext/quaternion_common.inl
+++ b/glm/ext/quaternion_common.inl
@@ -104,7 +104,7 @@ namespace glm
@@ -28,23 +33,113 @@ index 0e4a3bb2..8f9dccef 100644
// Graphics Gems III, page 96
T angle = acos(cosTheta);
- T phi = angle + k * glm::pi<T>();
-+ T phi = angle + static_cast<float>(k) * glm::pi<T>();
++ T phi = angle + static_cast<T>(k) * glm::pi<T>();
return (sin(angle - a * phi)* x + sin(a * phi) * z) / sin(angle);
}
}
-diff --git a/glm/gtc/random.inl b/glm/gtc/random.inl
-index 70485098..a4af2a06 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<uint8>::max());
-+ static_cast<uint8>(std::rand()) % std::numeric_limits<uint8>::max());
- }
- };
-
---
-2.30.0
-
+--- a/test/gtx/gtx_fast_trigonometry.cpp
++++ b/test/gtx/gtx_fast_trigonometry.cpp
+@@ -19,15 +19,14 @@ namespace fastCos
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+- float result = 0.f;
+
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::fastCos(i);
++ glm::fastCos(i);
+
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::cos(i);
++ glm::cos(i);
+
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+@@ -53,15 +52,14 @@ namespace fastSin
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+- float result = 0.f;
+
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::fastSin(i);
++ glm::fastSin(i);
+
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::sin(i);
++ glm::sin(i);
+
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+@@ -79,15 +77,14 @@ namespace fastTan
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+- float result = 0.f;
+
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::fastTan(i);
++ glm::fastTan(i);
+
+ const std::clock_t timestamp2 = std::clock();
+ for (float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::tan(i);
++ glm::tan(i);
+
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+@@ -105,15 +102,14 @@ namespace fastAcos
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+- float result = 0.f;
+
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::fastAcos(i);
++ glm::fastAcos(i);
+
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::acos(i);
++ glm::acos(i);
+
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+@@ -132,13 +128,12 @@ namespace fastAsin
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+- float result = 0.f;
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::fastAsin(i);
++ glm::fastAsin(i);
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::asin(i);
++ glm::asin(i);
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+ const std::clock_t time_default = timestamp3 - timestamp2;
+@@ -155,13 +150,12 @@ namespace fastAtan
+ {
+ const float begin = -glm::pi<float>();
+ const float end = glm::pi<float>();
+- float result = 0.f;
+ const std::clock_t timestamp1 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::fastAtan(i);
++ glm::fastAtan(i);
+ const std::clock_t timestamp2 = std::clock();
+ for(float i = begin; i < end; i = NextFloat ? glm::nextFloat(i) : i += 0.1f)
+- result = glm::atan(i);
++ glm::atan(i);
+ const std::clock_t timestamp3 = std::clock();
+ const std::clock_t time_fast = timestamp2 - timestamp1;
+ const std::clock_t time_default = timestamp3 - timestamp2;