Browse Source

Removed floor_log2, comment that isnan and isinf are not working on MinGW

Christophe Riccio 13 years ago
parent
commit
c2eea6da26
4 changed files with 12 additions and 10 deletions
  1. 5 4
      glm/core/func_common.inl
  2. 3 2
      glm/gtx/integer.inl
  3. 1 1
      test/core/core_func_common.cpp
  4. 3 3
      test/gtx/gtx_integer.cpp

+ 5 - 4
glm/core/func_common.inl

@@ -803,6 +803,7 @@ namespace detail
             smoothstep(edge0.w, edge1.w, x.w));
     }
 
+	// TODO: Not working on MinGW...
 	template <typename genType> 
 	GLM_FUNC_QUALIFIER bool isnan(genType const & x)
 	{
@@ -814,12 +815,12 @@ namespace detail
 #           if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
                 return _isnan(x) != 0;
 #           else
-                return std::isnan(x) != 0;
+                return std::isnan(x);
 #           endif
 #       elif(GLM_COMPILER & GLM_COMPILER_INTEL)
             return isnan(x) != 0;			
 #       else
-            return std::isnan(x) != 0;
+            return std::isnan(x);
 #       endif
 	}
 
@@ -871,12 +872,12 @@ namespace detail
 #           if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
                 return _isinf(x) != 0;
 #           else
-                return std::isinf(x) != 0;
+                return std::isinf(x);
 #           endif
 #       elif(GLM_COMPILER & GLM_COMPILER_INTEL)
             return isinf(x) != 0;			
 #       else
-            return std::isinf(x) != 0;
+            return std::isinf(x);
 #       endif
 	}
 

+ 3 - 2
glm/gtx/integer.inl

@@ -71,6 +71,7 @@ namespace _detail
 }//namespace _detail
 
 	// Henry Gordon Dietz: http://aggregate.org/MAGIC/
+/*
 	GLM_FUNC_QUALIFIER unsigned int floor_log2(unsigned int x)
 	{
 		x |= (x >> 1);
@@ -79,9 +80,9 @@ namespace _detail
 		x |= (x >> 8);
 		x |= (x >> 16);
 
-		return(_detail::ones32(x) - 1);
+		return _detail::ones32(x) >> 1;
 	}
-
+*/
 	// mod
 	GLM_FUNC_QUALIFIER int mod(int x, int y)
 	{

+ 1 - 1
test/core/core_func_common.cpp

@@ -371,7 +371,7 @@ int test_isnan()
  		Error += true == glm::any(glm::isnan(glm::vec3(0.0f/Zero_f))) ? 0 : 1;
  		Error += true == glm::any(glm::isnan(glm::vec4(0.0f/Zero_f))) ? 0 : 1;
 	}
- 
+
 	return Error;
 }
  

+ 3 - 3
test/gtx/gtx_integer.cpp

@@ -11,7 +11,7 @@
 #include <glm/gtc/epsilon.hpp>
 #include <glm/gtx/integer.hpp>
 #include <cstdio>
-
+/*
 int test_floor_log2()
 {
 	int Error = 0;
@@ -27,7 +27,7 @@ int test_floor_log2()
 
 	return Error;
 }
-
+*/
 int test_log2()
 {
 	int Error = 0;
@@ -65,7 +65,7 @@ int main()
 	int Error = 0;
 
 	Error += test_nlz();
-	Error += test_floor_log2();
+//	Error += test_floor_log2();
 	Error += test_log2();
 
 	return Error;