From f7f1239bb72d2d9f5a084b6cd70a9cc3c29c033c Mon Sep 17 00:00:00 2001 From: Jesse Talavera-Greenberg Date: Fri, 11 Sep 2015 19:20:16 -0400 Subject: [PATCH] Add GLM_NOEXCEPT to most functions in glm/detail - No class members, though --- glm/detail/_noise.hpp | 30 ++--- glm/detail/_vectorize.hpp | 24 ++-- glm/detail/func_common.hpp | 90 +++++++-------- glm/detail/func_common.inl | 160 +++++++++++++------------- glm/detail/func_exponential.hpp | 16 +-- glm/detail/func_exponential.inl | 28 ++--- glm/detail/func_geometric.hpp | 16 +-- glm/detail/func_geometric.inl | 36 +++--- glm/detail/func_matrix.hpp | 10 +- glm/detail/func_matrix.inl | 34 +++--- glm/detail/func_noise.hpp | 8 +- glm/detail/func_noise.inl | 34 +++--- glm/detail/func_packing.hpp | 24 ++-- glm/detail/func_packing.inl | 24 ++-- glm/detail/func_trigonometric.hpp | 30 ++--- glm/detail/func_trigonometric.inl | 44 +++---- glm/detail/func_vector_relational.hpp | 18 +-- glm/detail/func_vector_relational.inl | 18 +-- glm/detail/intrinsic_common.hpp | 38 +++--- glm/detail/intrinsic_common.inl | 38 +++--- glm/detail/intrinsic_exponential.hpp | 4 +- glm/detail/intrinsic_geometric.hpp | 18 +-- glm/detail/intrinsic_geometric.inl | 18 +-- glm/detail/intrinsic_integer.hpp | 4 +- glm/detail/intrinsic_integer.inl | 4 +- glm/detail/intrinsic_matrix.hpp | 18 +-- glm/detail/intrinsic_matrix.inl | 24 ++-- glm/detail/setup.hpp | 4 +- glm/detail/type_half.hpp | 4 +- glm/detail/type_half.inl | 10 +- 30 files changed, 414 insertions(+), 414 deletions(-) diff --git a/glm/detail/_noise.hpp b/glm/detail/_noise.hpp index e8875976..d49aac51 100644 --- a/glm/detail/_noise.hpp +++ b/glm/detail/_noise.hpp @@ -41,92 +41,92 @@ namespace glm{ namespace detail { template - GLM_FUNC_QUALIFIER T mod289(T const & x) + GLM_FUNC_QUALIFIER T mod289(T const & x) GLM_NOEXCEPT { return x - floor(x * static_cast(1.0) / static_cast(289.0)) * static_cast(289.0); } template - GLM_FUNC_QUALIFIER T permute(T const & x) + GLM_FUNC_QUALIFIER T permute(T const & x) GLM_NOEXCEPT { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } template - GLM_FUNC_QUALIFIER tvec2 permute(tvec2 const & x) + GLM_FUNC_QUALIFIER tvec2 permute(tvec2 const & x) GLM_NOEXCEPT { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } template - GLM_FUNC_QUALIFIER tvec3 permute(tvec3 const & x) + GLM_FUNC_QUALIFIER tvec3 permute(tvec3 const & x) GLM_NOEXCEPT { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } template - GLM_FUNC_QUALIFIER tvec4 permute(tvec4 const & x) + GLM_FUNC_QUALIFIER tvec4 permute(tvec4 const & x) GLM_NOEXCEPT { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } /* template class vecType> - GLM_FUNC_QUALIFIER vecType permute(vecType const & x) + GLM_FUNC_QUALIFIER vecType permute(vecType const & x) GLM_NOEXCEPT { return mod289(((x * T(34)) + T(1)) * x); } */ template - GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) + GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) GLM_NOEXCEPT { return T(1.79284291400159) - T(0.85373472095314) * r; } template - GLM_FUNC_QUALIFIER tvec2 taylorInvSqrt(tvec2 const & r) + GLM_FUNC_QUALIFIER tvec2 taylorInvSqrt(tvec2 const & r) GLM_NOEXCEPT { return T(1.79284291400159) - T(0.85373472095314) * r; } template - GLM_FUNC_QUALIFIER tvec3 taylorInvSqrt(tvec3 const & r) + GLM_FUNC_QUALIFIER tvec3 taylorInvSqrt(tvec3 const & r) GLM_NOEXCEPT { return T(1.79284291400159) - T(0.85373472095314) * r; } template - GLM_FUNC_QUALIFIER tvec4 taylorInvSqrt(tvec4 const & r) + GLM_FUNC_QUALIFIER tvec4 taylorInvSqrt(tvec4 const & r) GLM_NOEXCEPT { return T(1.79284291400159) - T(0.85373472095314) * r; } /* template class vecType> - GLM_FUNC_QUALIFIER vecType taylorInvSqrt(vecType const & r) + GLM_FUNC_QUALIFIER vecType taylorInvSqrt(vecType const & r) GLM_NOEXCEPT { return T(1.79284291400159) - T(0.85373472095314) * r; } */ template - GLM_FUNC_QUALIFIER tvec2 fade(tvec2 const & t) + GLM_FUNC_QUALIFIER tvec2 fade(tvec2 const & t) GLM_NOEXCEPT { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } template - GLM_FUNC_QUALIFIER tvec3 fade(tvec3 const & t) + GLM_FUNC_QUALIFIER tvec3 fade(tvec3 const & t) GLM_NOEXCEPT { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } template - GLM_FUNC_QUALIFIER tvec4 fade(tvec4 const & t) + GLM_FUNC_QUALIFIER tvec4 fade(tvec4 const & t) GLM_NOEXCEPT { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } /* template class vecType> - GLM_FUNC_QUALIFIER vecType fade(vecType const & t) + GLM_FUNC_QUALIFIER vecType fade(vecType const & t) GLM_NOEXCEPT { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } diff --git a/glm/detail/_vectorize.hpp b/glm/detail/_vectorize.hpp index 53cf5b37..3557f8e4 100644 --- a/glm/detail/_vectorize.hpp +++ b/glm/detail/_vectorize.hpp @@ -46,7 +46,7 @@ namespace detail template struct functor1 { - GLM_FUNC_QUALIFIER static tvec1 call(R (*Func) (T x), tvec1 const & v) + GLM_FUNC_QUALIFIER static tvec1 call(R (*Func) (T x), tvec1 const & v) GLM_NOEXCEPT { return tvec1(Func(v.x)); } @@ -55,7 +55,7 @@ namespace detail template struct functor1 { - GLM_FUNC_QUALIFIER static tvec2 call(R (*Func) (T x), tvec2 const & v) + GLM_FUNC_QUALIFIER static tvec2 call(R (*Func) (T x), tvec2 const & v) GLM_NOEXCEPT { return tvec2(Func(v.x), Func(v.y)); } @@ -64,7 +64,7 @@ namespace detail template struct functor1 { - GLM_FUNC_QUALIFIER static tvec3 call(R (*Func) (T x), tvec3 const & v) + GLM_FUNC_QUALIFIER static tvec3 call(R (*Func) (T x), tvec3 const & v) GLM_NOEXCEPT { return tvec3(Func(v.x), Func(v.y), Func(v.z)); } @@ -73,7 +73,7 @@ namespace detail template struct functor1 { - GLM_FUNC_QUALIFIER static tvec4 call(R (*Func) (T x), tvec4 const & v) + GLM_FUNC_QUALIFIER static tvec4 call(R (*Func) (T x), tvec4 const & v) GLM_NOEXCEPT { return tvec4(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); } @@ -85,7 +85,7 @@ namespace detail template struct functor2 { - GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, tvec1 const & b) + GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, tvec1 const & b) GLM_NOEXCEPT { return tvec1(Func(a.x, b.x)); } @@ -94,7 +94,7 @@ namespace detail template struct functor2 { - GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, tvec2 const & b) + GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, tvec2 const & b) GLM_NOEXCEPT { return tvec2(Func(a.x, b.x), Func(a.y, b.y)); } @@ -103,7 +103,7 @@ namespace detail template struct functor2 { - GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, tvec3 const & b) + GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, tvec3 const & b) GLM_NOEXCEPT { return tvec3(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); } @@ -112,7 +112,7 @@ namespace detail template struct functor2 { - GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, tvec4 const & b) + GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, tvec4 const & b) GLM_NOEXCEPT { return tvec4(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); } @@ -124,7 +124,7 @@ namespace detail template struct functor2_vec_sca { - GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, T b) + GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, T b) GLM_NOEXCEPT { return tvec1(Func(a.x, b)); } @@ -133,7 +133,7 @@ namespace detail template struct functor2_vec_sca { - GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, T b) + GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, T b) GLM_NOEXCEPT { return tvec2(Func(a.x, b), Func(a.y, b)); } @@ -142,7 +142,7 @@ namespace detail template struct functor2_vec_sca { - GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, T b) + GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, T b) GLM_NOEXCEPT { return tvec3(Func(a.x, b), Func(a.y, b), Func(a.z, b)); } @@ -151,7 +151,7 @@ namespace detail template struct functor2_vec_sca { - GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, T b) + GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, T b) GLM_NOEXCEPT { return tvec4(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); } diff --git a/glm/detail/func_common.hpp b/glm/detail/func_common.hpp index 08b69c80..3aca1a4e 100644 --- a/glm/detail/func_common.hpp +++ b/glm/detail/func_common.hpp @@ -56,10 +56,10 @@ namespace glm /// @see GLSL abs man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType abs(genType x); + GLM_FUNC_DECL genType abs(genType x) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType abs(vecType const & x); + GLM_FUNC_DECL vecType abs(vecType const & x) GLM_NOEXCEPT; /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. /// @@ -68,7 +68,7 @@ namespace glm /// @see GLSL sign man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template class vecType> - GLM_FUNC_DECL vecType sign(vecType const & x); + GLM_FUNC_DECL vecType sign(vecType const & x) GLM_NOEXCEPT; /// Returns a value equal to the nearest integer that is less then or equal to x. /// @@ -77,7 +77,7 @@ namespace glm /// @see GLSL floor man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template class vecType> - GLM_FUNC_DECL vecType floor(vecType const & x); + GLM_FUNC_DECL vecType floor(vecType const & x) GLM_NOEXCEPT; /// Returns a value equal to the nearest integer to x /// whose absolute value is not larger than the absolute value of x. @@ -87,7 +87,7 @@ namespace glm /// @see GLSL trunc man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template class vecType> - GLM_FUNC_DECL vecType trunc(vecType const & x); + GLM_FUNC_DECL vecType trunc(vecType const & x) GLM_NOEXCEPT; /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the @@ -100,7 +100,7 @@ namespace glm /// @see GLSL round man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template class vecType> - GLM_FUNC_DECL vecType round(vecType const & x); + GLM_FUNC_DECL vecType round(vecType const & x) GLM_NOEXCEPT; /// Returns a value equal to the nearest integer to x. /// A fractional part of 0.5 will round toward the nearest even @@ -112,7 +112,7 @@ namespace glm /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// @see New round to even technique template class vecType> - GLM_FUNC_DECL vecType roundEven(vecType const & x); + GLM_FUNC_DECL vecType roundEven(vecType const & x) GLM_NOEXCEPT; /// Returns a value equal to the nearest integer /// that is greater than or equal to x. @@ -122,7 +122,7 @@ namespace glm /// @see GLSL ceil man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template class vecType> - GLM_FUNC_DECL vecType ceil(vecType const & x); + GLM_FUNC_DECL vecType ceil(vecType const & x) GLM_NOEXCEPT; /// Return x - floor(x). /// @@ -131,10 +131,10 @@ namespace glm /// @see GLSL fract man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType fract(genType x); + GLM_FUNC_DECL genType fract(genType x) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType fract(vecType const & x); + GLM_FUNC_DECL vecType fract(vecType const & x) GLM_NOEXCEPT; /// Modulus. Returns x - y * floor(x / y) /// for each component in x using the floating point value y. @@ -144,13 +144,13 @@ namespace glm /// @see GLSL mod man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType mod(genType x, genType y); + GLM_FUNC_DECL genType mod(genType x, genType y) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType mod(vecType const & x, T y); + GLM_FUNC_DECL vecType mod(vecType const & x, T y) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType mod(vecType const & x, vecType const & y); + GLM_FUNC_DECL vecType mod(vecType const & x, vecType const & y) GLM_NOEXCEPT; /// Returns the fractional part of x and sets i to the integer /// part (as a whole number floating point value). Both the @@ -162,7 +162,7 @@ namespace glm /// @see GLSL modf man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType modf(genType x, genType & i); + GLM_FUNC_DECL genType modf(genType x, genType & i) GLM_NOEXCEPT; /// Returns y if y < x; otherwise, it returns x. /// @@ -171,13 +171,13 @@ namespace glm /// @see GLSL min man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType min(genType x, genType y); + GLM_FUNC_DECL genType min(genType x, genType y) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType min(vecType const & x, T y); + GLM_FUNC_DECL vecType min(vecType const & x, T y) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType min(vecType const & x, vecType const & y); + GLM_FUNC_DECL vecType min(vecType const & x, vecType const & y) GLM_NOEXCEPT; /// Returns y if x < y; otherwise, it returns x. /// @@ -186,13 +186,13 @@ namespace glm /// @see GLSL max man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType max(genType x, genType y); + GLM_FUNC_DECL genType max(genType x, genType y) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType max(vecType const & x, T y); + GLM_FUNC_DECL vecType max(vecType const & x, T y) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType max(vecType const & x, vecType const & y); + GLM_FUNC_DECL vecType max(vecType const & x, vecType const & y) GLM_NOEXCEPT; /// Returns min(max(x, minVal), maxVal) for each component in x /// using the floating-point values minVal and maxVal. @@ -202,13 +202,13 @@ namespace glm /// @see GLSL clamp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); + GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType clamp(vecType const & x, T minVal, T maxVal); + GLM_FUNC_DECL vecType clamp(vecType const & x, T minVal, T maxVal) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType clamp(vecType const & x, vecType const & minVal, vecType const & maxVal); + GLM_FUNC_DECL vecType clamp(vecType const & x, vecType const & minVal, vecType const & maxVal) GLM_NOEXCEPT; /// If genTypeU is a floating scalar or vector: /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of @@ -253,34 +253,34 @@ namespace glm /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. /// @endcode template class vecType> - GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, vecType const & a); + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, vecType const & a) GLM_NOEXCEPT; template class vecType> - GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, U a); + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, U a) GLM_NOEXCEPT; template - GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); + GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a) GLM_NOEXCEPT; /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. /// /// @see GLSL step man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType step(genType edge, genType x); + GLM_FUNC_DECL genType step(genType edge, genType x) GLM_NOEXCEPT; /// Returns 0.0 if x < edge, otherwise it returns 1.0. /// /// @see GLSL step man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template