From bc60ce8cc4a390ad4303bb906b46ea94435d20be Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Tue, 3 Jan 2017 20:19:38 +0100 Subject: [PATCH 1/3] Fixed shadow warnings for gcc (vec3 and vec4) --- glm/detail/type_vec3.inl | 32 +++++++------- glm/detail/type_vec4.inl | 96 ++++++++++++++++++++-------------------- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 664554eb3..ec587121d 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -39,25 +39,25 @@ namespace glm {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(T a, T b, T c) - : x(a), y(b), z(c) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(T a, T _b, T c) + : x(a), y(_b), z(c) {} // -- Conversion scalar constructors -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(A a, B b, C c) : + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(A a, B _b, C c) : x(static_cast(a)), - y(static_cast(b)), + y(static_cast(_b)), z(static_cast(c)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(tvec1 const & a, tvec1 const & b, tvec1 const & c) : + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(tvec1 const & a, tvec1 const & _b, tvec1 const & c) : x(static_cast(a)), - y(static_cast(b)), + y(static_cast(_b)), z(static_cast(c)) {} @@ -65,34 +65,34 @@ namespace glm template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(tvec2 const & a, B b) : + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(tvec2 const & a, B _b) : x(static_cast(a.x)), y(static_cast(a.y)), - z(static_cast(b)) + z(static_cast(_b)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(tvec2 const & a, tvec1 const & b) : + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(tvec2 const & a, tvec1 const & _b) : x(static_cast(a.x)), y(static_cast(a.y)), - z(static_cast(b.x)) + z(static_cast(_b.x)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(A a, tvec2 const & b) : + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(A a, tvec2 const & _b) : x(static_cast(a)), - y(static_cast(b.x)), - z(static_cast(b.y)) + y(static_cast(_b.x)), + z(static_cast(_b.y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(tvec1 const & a, tvec2 const & b) : + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec3::tvec3(tvec1 const & a, tvec2 const & _b) : x(static_cast(a.x)), - y(static_cast(b.x)), - z(static_cast(b.y)) + y(static_cast(_b.x)), + z(static_cast(_b.y)) {} template diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 2377e2b11..d3e6cd696 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -188,26 +188,26 @@ namespace detail {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(T a, T b, T c, T d) - : x(a), y(b), z(c), w(d) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(T _a, T _b, T c, T d) + : x(_a), y(_b), z(c), w(d) {} // -- Conversion scalar constructors -- template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(A a, B b, C c, D d) : - x(static_cast(a)), - y(static_cast(b)), + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(A _a, B _b, C c, D d) : + x(static_cast(_a)), + y(static_cast(_b)), z(static_cast(c)), w(static_cast(d)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4::tvec4(tvec1 const & a, tvec1 const & b, tvec1 const & c, tvec1 const & d) : - x(static_cast(a.x)), - y(static_cast(b.x)), + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec4::tvec4(tvec1 const & _a, tvec1 const & _b, tvec1 const & c, tvec1 const & d) : + x(static_cast(_a.x)), + y(static_cast(_b.x)), z(static_cast(c.x)), w(static_cast(d.x)) {} @@ -216,19 +216,19 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec2 const & a, B b, C c) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(b)), + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec2 const & _a, B _b, C c) : + x(static_cast(_a.x)), + y(static_cast(_a.y)), + z(static_cast(_b)), w(static_cast(c)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec2 const & a, tvec1 const & b, tvec1 const & c) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(b.x)), + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec2 const & _a, tvec1 const & _b, tvec1 const & c) : + x(static_cast(_a.x)), + y(static_cast(_a.y)), + z(static_cast(_b.x)), w(static_cast(c.x)) {} @@ -243,10 +243,10 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec1 const & a, tvec2 const & b, tvec1 const & c) : - x(static_cast(a.x)), - y(static_cast(b.x)), - z(static_cast(b.y)), + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec1 const & _a, tvec2 const & _b, tvec1 const & c) : + x(static_cast(_a.x)), + y(static_cast(_b.x)), + z(static_cast(_b.y)), w(static_cast(c.x)) {} @@ -261,56 +261,56 @@ namespace detail template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec1 const & a, tvec1 const & b, tvec2 const & c) : - x(static_cast(a.x)), - y(static_cast(b.x)), + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec1 const & _a, tvec1 const & _b, tvec2 const & c) : + x(static_cast(_a.x)), + y(static_cast(_b.x)), z(static_cast(c.x)), w(static_cast(c.y)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec3 const & a, B b) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(a.z)), - w(static_cast(b)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec3 const & _a, B _b) : + x(static_cast(_a.x)), + y(static_cast(_a.y)), + z(static_cast(_a.z)), + w(static_cast(_b)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec3 const & a, tvec1 const & b) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(a.z)), - w(static_cast(b.x)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec3 const & _a, tvec1 const & _b) : + x(static_cast(_a.x)), + y(static_cast(_a.y)), + z(static_cast(_a.z)), + w(static_cast(_b.x)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(A a, tvec3 const & b) : - x(static_cast(a)), - y(static_cast(b.x)), - z(static_cast(b.y)), - w(static_cast(b.z)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(A _a, tvec3 const & _b) : + x(static_cast(_a)), + y(static_cast(_b.x)), + z(static_cast(_b.y)), + w(static_cast(_b.z)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec1 const & a, tvec3 const & b) : - x(static_cast(a.x)), - y(static_cast(b.x)), - z(static_cast(b.y)), - w(static_cast(b.z)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec1 const & _a, tvec3 const & _b) : + x(static_cast(_a.x)), + y(static_cast(_b.x)), + z(static_cast(_b.y)), + w(static_cast(_b.z)) {} template template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec2 const & a, tvec2 const & b) : - x(static_cast(a.x)), - y(static_cast(a.y)), - z(static_cast(b.x)), - w(static_cast(b.y)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec4::tvec4(tvec2 const & _a, tvec2 const & _b) : + x(static_cast(_a.x)), + y(static_cast(_a.y)), + z(static_cast(_b.x)), + w(static_cast(_b.y)) {} template From d63d803e8f29dd4f2704bf901c7fce58df84d1ad Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Tue, 3 Jan 2017 20:22:54 +0100 Subject: [PATCH 2/3] Fixed shadow warnings for quaternions --- glm/gtc/quaternion.inl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index c9b2af73f..30699f718 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -117,8 +117,8 @@ namespace detail {} template - GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T const & w, T const & x, T const & y, T const & z) - : x(x), y(y), z(z), w(w) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat::tquat(T const & _w, T const & _x, T const & _y, T const & _z) + : x(_x), y(_y), z(_z), w(_w) {} // -- Conversion constructors -- From 9e45b450625bcc6c883ac049257b36fef934b0ae Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Tue, 3 Jan 2017 20:30:31 +0100 Subject: [PATCH 3/3] Fixed more shadow warnings in vec4 simd version --- glm/detail/type_vec4_simd.inl | 84 +++++++++++++++++------------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/glm/detail/type_vec4_simd.inl b/glm/detail/type_vec4_simd.inl index 90652fd91..5867422ee 100644 --- a/glm/detail/type_vec4_simd.inl +++ b/glm/detail/type_vec4_simd.inl @@ -363,118 +363,118 @@ namespace detail # endif//!GLM_HAS_DEFAULTED_FUNCTIONS template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float s) : - data(_mm_set1_ps(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _s) : + data(_mm_set1_ps(_s)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float s) : - data(_mm_set1_ps(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _s) : + data(_mm_set1_ps(_s)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float s) : - data(_mm_set1_ps(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _s) : + data(_mm_set1_ps(_s)) {} # if GLM_ARCH & GLM_ARCH_AVX_BIT template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(double s) : - data(_mm256_set1_pd(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(double _s) : + data(_mm256_set1_pd(_s)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(double s) : - data(_mm256_set1_pd(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(double _s) : + data(_mm256_set1_pd(_s)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(double s) : - data(_mm256_set1_pd(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(double _s) : + data(_mm256_set1_pd(_s)) {} # endif template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 s) : - data(_mm_set1_epi32(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _s) : + data(_mm_set1_epi32(_s)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 s) : - data(_mm_set1_epi32(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _s) : + data(_mm_set1_epi32(_s)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 s) : - data(_mm_set1_epi32(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _s) : + data(_mm_set1_epi32(_s)) {} # if GLM_ARCH & GLM_ARCH_AVX2_BIT template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int64 s) : - data(_mm256_set1_epi64x(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int64 _s) : + data(_mm256_set1_epi64x(_s)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int64 s) : - data(_mm256_set1_epi64x(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int64 _s) : + data(_mm256_set1_epi64x(_s)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int64 s) : - data(_mm256_set1_epi64x(s)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int64 _s) : + data(_mm256_set1_epi64x(_s)) {} # endif template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float a, float b, float c, float d) : - data(_mm_set_ps(d, c, b, a)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _a, float _b, float c, float d) : + data(_mm_set_ps(d, c, _b, _a)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float a, float b, float c, float d) : - data(_mm_set_ps(d, c, b, a)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _a, float _b, float c, float d) : + data(_mm_set_ps(d, c, _b, _a)) {} template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float a, float b, float c, float d) : - data(_mm_set_ps(d, c, b, a)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(float _a, float _b, float c, float d) : + data(_mm_set_ps(d, c, _b, _a)) {} template <> template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 a, int32 b, int32 c, int32 d) : - data(_mm_set_epi32(d, c, b, a)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_set_epi32(d, c, _b, _a)) {} template <> template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 a, int32 b, int32 c, int32 d) : - data(_mm_set_epi32(d, c, b, a)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_set_epi32(d, c, _b, _a)) {} template <> template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 a, int32 b, int32 c, int32 d) : - data(_mm_set_epi32(d, c, b, a)) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_set_epi32(d, c, _b, _a)) {} template <> template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 a, int32 b, int32 c, int32 d) : - data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a))) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_castsi128_ps(_mm_set_epi32(d, c, _b, _a))) {} template <> template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 a, int32 b, int32 c, int32 d) : - data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a))) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_castsi128_ps(_mm_set_epi32(d, c, _b, _a))) {} template <> template <> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 a, int32 b, int32 c, int32 d) : - data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a))) + GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4::tvec4(int32 _a, int32 _b, int32 c, int32 d) : + data(_mm_castsi128_ps(_mm_set_epi32(d, c, _b, _a))) {} }//namespace glm