From 72c3b98e5ba449dbd67799d39a96de5647a3f418 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 13 Aug 2018 20:41:11 +0200 Subject: [PATCH] Fixed warnings --- glm/detail/setup.hpp | 4 ---- test/ext/ext_scalar_float_sized.cpp | 10 ++++++---- test/ext/ext_scalar_int_sized.cpp | 15 ++++++++------- test/ext/ext_scalar_uint_sized.cpp | 15 ++++++++------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp index 7de9ed11..4c6b8e93 100644 --- a/glm/detail/setup.hpp +++ b/glm/detail/setup.hpp @@ -1,6 +1,3 @@ -/// @ref core -/// @file glm/detail/setup.hpp - #ifndef GLM_SETUP_INCLUDED #include @@ -402,7 +399,6 @@ # define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1] #else # define GLM_STATIC_ASSERT(x, message) -# define GLM_STATIC_ASSERT_NULL #endif//GLM_LANG /////////////////////////////////////////////////////////////////////////////////// diff --git a/test/ext/ext_scalar_float_sized.cpp b/test/ext/ext_scalar_float_sized.cpp index fb3d4d0a..3608f715 100644 --- a/test/ext/ext_scalar_float_sized.cpp +++ b/test/ext/ext_scalar_float_sized.cpp @@ -1,10 +1,12 @@ #include -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() { diff --git a/test/ext/ext_scalar_int_sized.cpp b/test/ext/ext_scalar_int_sized.cpp index 29ba8fd9..b55c6ca7 100644 --- a/test/ext/ext_scalar_int_sized.cpp +++ b/test/ext/ext_scalar_int_sized.cpp @@ -1,12 +1,13 @@ #include -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() { diff --git a/test/ext/ext_scalar_uint_sized.cpp b/test/ext/ext_scalar_uint_sized.cpp index 9eca7c04..1122947d 100644 --- a/test/ext/ext_scalar_uint_sized.cpp +++ b/test/ext/ext_scalar_uint_sized.cpp @@ -1,12 +1,13 @@ #include -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() {