浏览代码

wrap min/max calls in brackets

Steven French 1 年之前
父节点
当前提交
59268156f5
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 1 1
      glm/ext/quaternion_exponential.inl
  2. 5 5
      glm/gtx/component_wise.inl

+ 1 - 1
glm/ext/quaternion_exponential.inl

@@ -60,7 +60,7 @@ namespace glm
 			//VectorMagnitude to 0. here; we could use denorm_int() compiling a
 			//VectorMagnitude to 0. here; we could use denorm_int() compiling a
 			//project with unsafe maths optimizations might make the comparison
 			//project with unsafe maths optimizations might make the comparison
 			//always false, even when VectorMagnitude is 0.
 			//always false, even when VectorMagnitude is 0.
-			if (VectorMagnitude < std::numeric_limits<T>::min()) {
+			if (VectorMagnitude < (std::numeric_limits<T>::min)()) {
 				//Equivalent to raising a real number to a power
 				//Equivalent to raising a real number to a power
 				return qua<T, Q>::wxyz(pow(x.w, y), 0, 0, 0);
 				return qua<T, Q>::wxyz(pow(x.w, y), 0, 0, 0);
 			}
 			}

+ 5 - 5
glm/gtx/component_wise.inl

@@ -16,8 +16,8 @@ namespace detail
 	{
 	{
 		GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
 		GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
 		{
 		{
-			floatType const Min = static_cast<floatType>(std::numeric_limits<T>::min());
-			floatType const Max = static_cast<floatType>(std::numeric_limits<T>::max());
+			floatType const Min = static_cast<floatType>((std::numeric_limits<T>::min)());
+			floatType const Max = static_cast<floatType>((std::numeric_limits<T>::max)());
 			return (vec<L, floatType, Q>(v) - Min) / (Max - Min) * static_cast<floatType>(2) - static_cast<floatType>(1);
 			return (vec<L, floatType, Q>(v) - Min) / (Max - Min) * static_cast<floatType>(2) - static_cast<floatType>(1);
 		}
 		}
 	};
 	};
@@ -27,7 +27,7 @@ namespace detail
 	{
 	{
 		GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
 		GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
 		{
 		{
-			return vec<L, floatType, Q>(v) / static_cast<floatType>(std::numeric_limits<T>::max());
+			return vec<L, floatType, Q>(v) / static_cast<floatType>((std::numeric_limits<T>::max)());
 		}
 		}
 	};
 	};
 
 
@@ -49,7 +49,7 @@ namespace detail
 	{
 	{
 		GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
 		GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
 		{
 		{
-			floatType const Max = static_cast<floatType>(std::numeric_limits<T>::max()) + static_cast<floatType>(0.5);
+			floatType const Max = static_cast<floatType>((std::numeric_limits<T>::max)()) + static_cast<floatType>(0.5);
 			vec<L, floatType, Q> const Scaled(v * Max);
 			vec<L, floatType, Q> const Scaled(v * Max);
 			vec<L, T, Q> const Result(Scaled - static_cast<floatType>(0.5));
 			vec<L, T, Q> const Result(Scaled - static_cast<floatType>(0.5));
 			return Result;
 			return Result;
@@ -61,7 +61,7 @@ namespace detail
 	{
 	{
 		GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
 		GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
 		{
 		{
-			return vec<L, T, Q>(vec<L, floatType, Q>(v) * static_cast<floatType>(std::numeric_limits<T>::max()));
+			return vec<L, T, Q>(vec<L, floatType, Q>(v) * static_cast<floatType>((std::numeric_limits<T>::max)()));
 		}
 		}
 	};
 	};