From 9097b1469be846d5caf864367e82420d259a9dc1 Mon Sep 17 00:00:00 2001 From: Tr1NgleDev <77019520+Tr1NgleDev@users.noreply.github.com> Date: Sat, 2 Nov 2024 17:38:34 +0800 Subject: [PATCH] make a bit more readable --- glm/detail/type_vec2.inl | 28 ++++++++++++++-------------- glm/detail/type_vec3.inl | 29 +++++++++++++++-------------- glm/detail/type_vec4.inl | 28 ++++++++++++++-------------- 3 files changed, 43 insertions(+), 42 deletions(-) diff --git a/glm/detail/type_vec2.inl b/glm/detail/type_vec2.inl index 47709a03..6444f0df 100644 --- a/glm/detail/type_vec2.inl +++ b/glm/detail/type_vec2.inl @@ -107,11 +107,11 @@ namespace glm { GLM_ASSERT_LENGTH(i, this->length()); -# if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG -# if GLM_LANG & GLM_LANG_CXX20_FLAG +#if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG if (std::is_constant_evaluated()) { -# endif + #endif switch (i) { default: @@ -120,16 +120,16 @@ namespace glm case 1: return y; } -# if GLM_LANG & GLM_LANG_CXX20_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG } else { return (&x)[i]; } -# endif -# else + #endif +#else return (&x)[i]; -# endif +#endif } template @@ -137,11 +137,11 @@ namespace glm { GLM_ASSERT_LENGTH(i, this->length()); -# if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG -# if GLM_LANG & GLM_LANG_CXX20_FLAG +#if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG if (std::is_constant_evaluated()) { -# endif + #endif switch (i) { default: @@ -150,16 +150,16 @@ namespace glm case 1: return y; } -# if GLM_LANG & GLM_LANG_CXX20_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG } else { return (&x)[i]; } -# endif -# else + #endif +#else return (&x)[i]; -# endif +#endif } // -- Unary arithmetic operators -- diff --git a/glm/detail/type_vec3.inl b/glm/detail/type_vec3.inl index 531cd61b..d5b3cf28 100644 --- a/glm/detail/type_vec3.inl +++ b/glm/detail/type_vec3.inl @@ -171,11 +171,12 @@ namespace glm GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & vec<3, T, Q>::operator[](typename vec<3, T, Q>::length_type i) { GLM_ASSERT_LENGTH(i, this->length()); -# if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG -# if GLM_LANG & GLM_LANG_CXX20_FLAG + +#if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG if (std::is_constant_evaluated()) { -# endif + #endif switch (i) { default: @@ -186,16 +187,16 @@ namespace glm case 2: return z; } -# if GLM_LANG & GLM_LANG_CXX20_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG } else { return (&x)[i]; } -# endif -# else + #endif +#else return (&x)[i]; -# endif +#endif } template @@ -203,11 +204,11 @@ namespace glm { GLM_ASSERT_LENGTH(i, this->length()); -# if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG -# if GLM_LANG & GLM_LANG_CXX20_FLAG +#if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG if (std::is_constant_evaluated()) { -# endif + #endif switch (i) { default: @@ -218,16 +219,16 @@ namespace glm case 2: return z; } -# if GLM_LANG & GLM_LANG_CXX20_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG } else { return (&x)[i]; } -# endif -# else + #endif +#else return (&x)[i]; -# endif +#endif } // -- Unary arithmetic operators -- diff --git a/glm/detail/type_vec4.inl b/glm/detail/type_vec4.inl index 44f827b9..f83cfca2 100644 --- a/glm/detail/type_vec4.inl +++ b/glm/detail/type_vec4.inl @@ -363,11 +363,11 @@ namespace detail { GLM_ASSERT_LENGTH(i, this->length()); -# if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG -# if GLM_LANG & GLM_LANG_CXX20_FLAG +#if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG if (std::is_constant_evaluated()) { -# endif + #endif switch (i) { default: @@ -380,16 +380,16 @@ namespace detail case 3: return w; } -# if GLM_LANG & GLM_LANG_CXX20_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG } else { return (&x)[i]; } -# endif -# else + #endif +#else return (&x)[i]; -# endif +#endif } template @@ -397,11 +397,11 @@ namespace detail { GLM_ASSERT_LENGTH(i, this->length()); -# if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG -# if GLM_LANG & GLM_LANG_CXX20_FLAG +#if GLM_LANG & GLM_LANG_CXX14_FLAG || GLM_LANG & GLM_LANG_CXX17_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG if (std::is_constant_evaluated()) { -# endif + #endif switch (i) { default: @@ -414,16 +414,16 @@ namespace detail case 3: return w; } -# if GLM_LANG & GLM_LANG_CXX20_FLAG + #if GLM_LANG & GLM_LANG_CXX20_FLAG } else { return (&x)[i]; } -# endif -# else + #endif +#else return (&x)[i]; -# endif +#endif } // -- Unary arithmetic operators --