Browse Source

Factorised code, reduces number of warnings

Christophe Riccio 15 years ago
parent
commit
441f8a6575
4 changed files with 33 additions and 41 deletions
  1. 10 0
      glm/core/_detail.hpp
  2. 7 28
      glm/core/type_int.hpp
  3. 15 13
      glm/glm.hpp
  4. 1 0
      glm/setup.hpp

+ 10 - 0
glm/core/_detail.hpp

@@ -24,6 +24,16 @@ namespace detail
 #elif(GLM_COMPILER & GLM_COMPILER_GCC)
 #elif(GLM_COMPILER & GLM_COMPILER_GCC)
 	__extension__ typedef signed long long		sint64;
 	__extension__ typedef signed long long		sint64;
 	__extension__ typedef unsigned long long	uint64;
 	__extension__ typedef unsigned long long	uint64;
+//#	if GLM_MODEL == GLM_MODEL_64
+//		typedef signed long							highp_int_t;
+//		typedef unsigned long						highp_uint_t;
+//#   elif GLM_MODEL == GLM_MODEL_32
+//		__extension__ typedef signed long long		highp_int_t;
+//		__extension__ typedef unsigned long long	highp_uint_t;
+//#	endif//GLM_MODEL
+#elif(GLM_COMPILER & GLM_COMPILER_BC)
+	typedef Int64								sint64;
+	typedef Uint64								uint64;
 #else//unknown compiler
 #else//unknown compiler
 	typedef signed long							sint64;
 	typedef signed long							sint64;
 	typedef unsigned long						uint64;
 	typedef unsigned long						uint64;

+ 7 - 28
glm/core/type_int.hpp

@@ -17,26 +17,13 @@ namespace glm
 {
 {
 	namespace detail
 	namespace detail
 	{
 	{
-#if defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_VC)
-		typedef signed __int64						highp_int_t;
-		typedef unsigned __int64					highp_uint_t;
-#elif(defined(GLM_COMPILER) && (GLM_COMPILER & GLM_COMPILER_GCC))
-		__extension__ typedef signed long long		highp_int_t;
-		__extension__ typedef unsigned long long	highp_uint_t;
-//#	if GLM_MODEL == GLM_MODEL_64
-//		typedef signed long							highp_int_t;
-//		typedef unsigned long						highp_uint_t;
-//#   elif GLM_MODEL == GLM_MODEL_32
-//		__extension__ typedef signed long long		highp_int_t;
-//		__extension__ typedef unsigned long long	highp_uint_t;
-//#	endif//GLM_MODEL
-#elif(defined(GLM_COMPILER_BC))
-		typedef Int64								highp_int_t;
-		typedef Uint64								highp_uint_t;
-#else
-		typedef signed long	long					highp_int_t;
-		typedef unsigned long long					highp_uint_t;
-#endif//GLM_COMPILER
+		typedef signed short			lowp_int_t;
+		typedef signed int				mediump_int_t;
+		typedef sint64					highp_int_t;
+
+		typedef unsigned short			lowp_uint_t;
+		typedef unsigned int			mediump_uint_t;
+		typedef uint64					highp_uint_t;
 
 
 		GLM_DETAIL_IS_INT(signed char);
 		GLM_DETAIL_IS_INT(signed char);
 		GLM_DETAIL_IS_INT(signed short);
 		GLM_DETAIL_IS_INT(signed short);
@@ -49,14 +36,6 @@ namespace glm
 		GLM_DETAIL_IS_UINT(unsigned int);
 		GLM_DETAIL_IS_UINT(unsigned int);
 		GLM_DETAIL_IS_UINT(unsigned long);
 		GLM_DETAIL_IS_UINT(unsigned long);
 		GLM_DETAIL_IS_UINT(highp_uint_t);
 		GLM_DETAIL_IS_UINT(highp_uint_t);
-
-		typedef signed short			lowp_int_t;
-		typedef signed int				mediump_int_t;
-		typedef detail::highp_int_t		highp_int_t;
-
-		typedef unsigned short			lowp_uint_t;
-		typedef unsigned int			mediump_uint_t;
-		typedef detail::highp_uint_t	highp_uint_t;
 	}
 	}
 	//namespace detail
 	//namespace detail
 
 

+ 15 - 13
glm/glm.hpp

@@ -95,18 +95,20 @@ namespace glm
 
 
 ////////////////////
 ////////////////////
 // check type sizes
 // check type sizes
-GLM_STATIC_ASSERT(sizeof(glm::detail::int8) == 1, "int8 size isn't 1 byte on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::detail::int16) == 2, "int16 size isn't 2 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::detail::int32) == 4, "int32 size isn't 4 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::detail::int64) == 8, "int64 size isn't 8 bytes on this platform");
-
-GLM_STATIC_ASSERT(sizeof(glm::detail::uint8) == 1, "uint8 size isn't 1 byte on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::detail::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::detail::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::detail::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
-
-GLM_STATIC_ASSERT(sizeof(glm::detail::float16) == 2, "float16 size isn't 2 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::detail::float32) == 4, "float32 size isn't 4 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::detail::float64) == 8, "float64 size isn't 8 bytes on this platform");
+#ifndef GLM_STATIC_ASSERT_NULL
+	GLM_STATIC_ASSERT(sizeof(glm::detail::int8) == 1, "int8 size isn't 1 byte on this platform");
+	GLM_STATIC_ASSERT(sizeof(glm::detail::int16) == 2, "int16 size isn't 2 bytes on this platform");
+	GLM_STATIC_ASSERT(sizeof(glm::detail::int32) == 4, "int32 size isn't 4 bytes on this platform");
+	GLM_STATIC_ASSERT(sizeof(glm::detail::int64) == 8, "int64 size isn't 8 bytes on this platform");
+
+	GLM_STATIC_ASSERT(sizeof(glm::detail::uint8) == 1, "uint8 size isn't 1 byte on this platform");
+	GLM_STATIC_ASSERT(sizeof(glm::detail::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
+	GLM_STATIC_ASSERT(sizeof(glm::detail::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
+	GLM_STATIC_ASSERT(sizeof(glm::detail::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
+
+	GLM_STATIC_ASSERT(sizeof(glm::detail::float16) == 2, "float16 size isn't 2 bytes on this platform");
+	GLM_STATIC_ASSERT(sizeof(glm::detail::float32) == 4, "float32 size isn't 4 bytes on this platform");
+	GLM_STATIC_ASSERT(sizeof(glm::detail::float64) == 8, "float64 size isn't 8 bytes on this platform");
+#endif//GLM_STATIC_ASSERT_NULL
 
 
 #endif //glm_glm
 #endif //glm_glm

+ 1 - 0
glm/setup.hpp

@@ -365,6 +365,7 @@
 #	define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
 #	define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
 #else
 #else
 #	define GLM_STATIC_ASSERT(x, message)
 #	define GLM_STATIC_ASSERT(x, message)
+#	define GLM_STATIC_ASSERT_NULL
 #endif//GLM_LANG
 #endif//GLM_LANG
 
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////////////////////