浏览代码

Fixed warnings

Christophe Riccio 7 年之前
父节点
当前提交
72c3b98e5b
共有 4 个文件被更改,包括 22 次插入22 次删除
  1. 0 4
      glm/detail/setup.hpp
  2. 6 4
      test/ext/ext_scalar_float_sized.cpp
  3. 8 7
      test/ext/ext_scalar_int_sized.cpp
  4. 8 7
      test/ext/ext_scalar_uint_sized.cpp

+ 0 - 4
glm/detail/setup.hpp

@@ -1,6 +1,3 @@
-/// @ref core
-/// @file glm/detail/setup.hpp
-
 #ifndef GLM_SETUP_INCLUDED
 #ifndef GLM_SETUP_INCLUDED
 
 
 #include <cassert>
 #include <cassert>
@@ -402,7 +399,6 @@
 #	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
 
 
 ///////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////////////////////////////////////////////////////

+ 6 - 4
test/ext/ext_scalar_float_sized.cpp

@@ -1,10 +1,12 @@
 #include <glm/ext/scalar_float_sized.hpp>
 #include <glm/ext/scalar_float_sized.hpp>
 
 
-GLM_STATIC_ASSERT(sizeof(glm::float32) == 4, "float32 size isn't 4 bytes on this platform");
+#if GLM_HAS_STATIC_ASSERT
+	static_assert(sizeof(glm::float32) == 4, "float32 size isn't 4 bytes on this platform");
 
 
-#ifndef GLM_FORCE_SINGLE_ONLY
-	GLM_STATIC_ASSERT(sizeof(glm::float64) == 8, "float64 size isn't 8 bytes on this platform");
-#endif//GLM_FORCE_SINGLE_ONLY
+#	ifndef GLM_FORCE_SINGLE_ONLY
+		static_assert(sizeof(glm::float64) == 8, "float64 size isn't 8 bytes on this platform");
+#	endif
+#endif
 
 
 static int test_float_size()
 static int test_float_size()
 {
 {

+ 8 - 7
test/ext/ext_scalar_int_sized.cpp

@@ -1,12 +1,13 @@
 #include <glm/ext/scalar_int_sized.hpp>
 #include <glm/ext/scalar_int_sized.hpp>
 
 
-GLM_STATIC_ASSERT(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform");
-
-GLM_STATIC_ASSERT(sizeof(glm::int16) == sizeof(short), "signed short size isn't 4 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::int32) == sizeof(int), "signed int size isn't 4 bytes on this platform");
+#if GLM_HAS_STATIC_ASSERT
+	static_assert(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform");
+	static_assert(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform");
+	static_assert(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform");
+	static_assert(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform");
+	static_assert(sizeof(glm::int16) == sizeof(short), "signed short size isn't 4 bytes on this platform");
+	static_assert(sizeof(glm::int32) == sizeof(int), "signed int size isn't 4 bytes on this platform");
+#endif
 
 
 static int test_size()
 static int test_size()
 {
 {

+ 8 - 7
test/ext/ext_scalar_uint_sized.cpp

@@ -1,12 +1,13 @@
 #include <glm/ext/scalar_uint_sized.hpp>
 #include <glm/ext/scalar_uint_sized.hpp>
 
 
-GLM_STATIC_ASSERT(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
-
-GLM_STATIC_ASSERT(sizeof(glm::uint16) == sizeof(unsigned short), "unsigned short size isn't 4 bytes on this platform");
-GLM_STATIC_ASSERT(sizeof(glm::uint32) == sizeof(unsigned int), "unsigned int size isn't 4 bytes on this platform");
+#if GLM_HAS_STATIC_ASSERT
+	static_assert(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform");
+	static_assert(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
+	static_assert(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
+	static_assert(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
+	static_assert(sizeof(glm::uint16) == sizeof(unsigned short), "unsigned short size isn't 4 bytes on this platform");
+	static_assert(sizeof(glm::uint32) == sizeof(unsigned int), "unsigned int size isn't 4 bytes on this platform");
+#endif
 
 
 static int test_size()
 static int test_size()
 {
 {