Skip to content

Commit 9e72e5a

Browse files
Fix and ignore warnings
1 parent 7f2a5b8 commit 9e72e5a

File tree

6 files changed

+106
-248
lines changed

6 files changed

+106
-248
lines changed

glm/detail/compute_vector_decl.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ namespace glm {
9999
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
100100
{
101101
vec<L, T, Q> v(a);
102-
for (int i = 0; i < L; ++i)
102+
for (length_t i = 0; i < L; ++i)
103103
v[i] &= static_cast<T>(b[i]);
104104
return v;
105105
}
@@ -111,7 +111,7 @@ namespace glm {
111111
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
112112
{
113113
vec<L, T, Q> v(a);
114-
for (int i = 0; i < L; ++i)
114+
for (length_t i = 0; i < L; ++i)
115115
v[i] |= static_cast<T>(b[i]);
116116
return v;
117117
}
@@ -123,7 +123,7 @@ namespace glm {
123123
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
124124
{
125125
vec<L, T, Q> v(a);
126-
for (int i = 0; i < L; ++i)
126+
for (length_t i = 0; i < L; ++i)
127127
v[i] ^= static_cast<T>(b[i]);
128128
return v;
129129
}
@@ -135,7 +135,7 @@ namespace glm {
135135
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
136136
{
137137
vec<L, T, Q> v(a);
138-
for (int i = 0; i < L; ++i)
138+
for (length_t i = 0; i < L; ++i)
139139
v[i] <<= static_cast<T>(b[i]);
140140
return v;
141141
}
@@ -147,7 +147,7 @@ namespace glm {
147147
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
148148
{
149149
vec<L, T, Q> v(a);
150-
for (int i = 0; i < L; ++i)
150+
for (length_t i = 0; i < L; ++i)
151151
v[i] >>= static_cast<T>(b[i]);
152152
return v;
153153
}
@@ -159,7 +159,7 @@ namespace glm {
159159
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static bool call(vec<L, T, Q> const& v1, vec<L, T, Q> const& v2)
160160
{
161161
bool b = true;
162-
for (int i = 0; i < L; ++i)
162+
for (length_t i = 0; i < L; ++i)
163163
b = b && detail::compute_equal<T, std::numeric_limits<T>::is_iec559>::call(v1.x, v2.x);
164164
return b;
165165
}
@@ -180,7 +180,7 @@ namespace glm {
180180
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, T, Q> call(vec<L, T, Q> const& a)
181181
{
182182
vec<L, T, Q> v(a);
183-
for (int i = 0; i < L; ++i)
183+
for (length_t i = 0; i < L; ++i)
184184
v[i] = ~v[i];
185185
return v;
186186
}

glm/detail/type_vec3.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ namespace glm
3737
# pragma clang diagnostic push
3838
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
3939
# pragma clang diagnostic ignored "-Wnested-anon-types"
40+
# pragma clang diagnostic ignored "-Wpadded"
4041
# elif GLM_COMPILER & GLM_COMPILER_VC
4142
# pragma warning(push)
4243
# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union

glm/detail/type_vec4.inl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,8 @@ namespace detail
361361
template<typename T, qualifier Q>
362362
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i)
363363
{
364-
<<<<<<< HEAD
365364
GLM_ASSERT_LENGTH(i, this->length());
366365
switch(i)
367-
=======
368-
assert(i >= 0 && i < this->length());
369-
switch (i)
370-
>>>>>>> 5c1da05b (Simd improvement)
371366
{
372367
default:
373368
case 0:
@@ -384,13 +379,8 @@ namespace detail
384379
template<typename T, qualifier Q>
385380
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& vec<4, T, Q>::operator[](typename vec<4, T, Q>::length_type i) const
386381
{
387-
<<<<<<< HEAD
388382
GLM_ASSERT_LENGTH(i, this->length());
389383
switch(i)
390-
=======
391-
assert(i >= 0 && i < this->length());
392-
switch (i)
393-
>>>>>>> 5c1da05b (Simd improvement)
394384
{
395385
default:
396386
case 0:

test/CMakeLists.txt

Lines changed: 0 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -2,122 +2,6 @@ option(GLM_QUIET "No CMake Message" OFF)
22

33
option(GLM_TEST_ENABLE "Build unit tests" ON)
44
option(GLM_PERF_TEST_ENABLE "Build perf tests" OFF)
5-
<<<<<<< HEAD
6-
=======
7-
option(GLM_TEST_ENABLE_SIMD_SSE2 "Enable SSE2 optimizations" OFF)
8-
option(GLM_TEST_ENABLE_SIMD_SSE3 "Enable SSE3 optimizations" OFF)
9-
option(GLM_TEST_ENABLE_SIMD_SSSE3 "Enable SSSE3 optimizations" OFF)
10-
option(GLM_TEST_ENABLE_SIMD_SSE4_1 "Enable SSE 4.1 optimizations" OFF)
11-
option(GLM_TEST_ENABLE_SIMD_SSE4_2 "Enable SSE 4.2 optimizations" OFF)
12-
option(GLM_TEST_ENABLE_SIMD_AVX "Enable AVX optimizations" OFF)
13-
option(GLM_TEST_ENABLE_SIMD_AVX2 "Enable AVX2 optimizations" OFF)
14-
option(GLM_TEST_ENABLE_SIMD_NEON "Enable ARM NEON optimizations" OFF)
15-
option(GLM_TEST_ENABLE_SIMD_FMA "Enable FMA optimizations" OFF)
16-
option(GLM_TEST_FORCE_PURE "Force 'pure' instructions" OFF)
17-
18-
if(GLM_TEST_FORCE_PURE)
19-
add_definitions(-DGLM_FORCE_PURE)
20-
21-
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
22-
add_compile_options(-mfpmath=387)
23-
endif()
24-
message(STATUS "GLM: No SIMD instruction set")
25-
26-
elseif(GLM_TEST_ENABLE_SIMD_AVX2)
27-
add_definitions(-DGLM_FORCE_INTRINSICS)
28-
29-
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
30-
add_compile_options(-mavx2)
31-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
32-
add_compile_options(/QxAVX2)
33-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
34-
add_compile_options(/arch:AVX2)
35-
endif()
36-
message(STATUS "GLM: AVX2 instruction set")
37-
38-
elseif(GLM_TEST_ENABLE_SIMD_AVX)
39-
add_definitions(-DGLM_FORCE_INTRINSICS)
40-
41-
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
42-
add_compile_options(-mavx)
43-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
44-
add_compile_options(/QxAVX)
45-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
46-
add_compile_options(/arch:AVX)
47-
endif()
48-
message(STATUS "GLM: AVX instruction set")
49-
50-
elseif(GLM_TEST_ENABLE_SIMD_SSE4_2)
51-
add_definitions(-DGLM_FORCE_INTRINSICS)
52-
53-
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
54-
add_compile_options(-msse4.2)
55-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
56-
add_compile_options(/QxSSE4.2)
57-
elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
58-
add_compile_options(/arch:SSE2) # VC doesn't support SSE4.2
59-
endif()
60-
message(STATUS "GLM: SSE4.2 instruction set")
61-
62-
elseif(GLM_TEST_ENABLE_SIMD_SSE4_1)
63-
add_definitions(-DGLM_FORCE_INTRINSICS)
64-
65-
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
66-
add_compile_options(-msse4.1)
67-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
68-
add_compile_options(/QxSSE4.1)
69-
elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
70-
add_compile_options(/arch:SSE2) # VC doesn't support SSE4.1
71-
endif()
72-
message(STATUS "GLM: SSE4.1 instruction set")
73-
74-
elseif(GLM_TEST_ENABLE_SIMD_SSSE3)
75-
add_definitions(-DGLM_FORCE_INTRINSICS)
76-
77-
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
78-
add_compile_options(-mssse3)
79-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
80-
add_compile_options(/QxSSSE3)
81-
elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
82-
add_compile_options(/arch:SSE2) # VC doesn't support SSSE3
83-
endif()
84-
message(STATUS "GLM: SSSE3 instruction set")
85-
86-
elseif(GLM_TEST_ENABLE_SIMD_SSE3)
87-
add_definitions(-DGLM_FORCE_INTRINSICS)
88-
89-
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
90-
add_compile_options(-msse3)
91-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
92-
add_compile_options(/QxSSE3)
93-
elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
94-
add_compile_options(/arch:SSE2) # VC doesn't support SSE3
95-
endif()
96-
message(STATUS "GLM: SSE3 instruction set")
97-
98-
elseif(GLM_TEST_ENABLE_SIMD_SSE2)
99-
add_definitions(-DGLM_FORCE_INTRINSICS)
100-
101-
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
102-
add_compile_options(-msse2)
103-
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel")
104-
add_compile_options(/QxSSE2)
105-
elseif((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND NOT CMAKE_CL_64)
106-
add_compile_options(/arch:SSE2)
107-
endif()
108-
message(STATUS "GLM: SSE2 instruction set")
109-
elseif(GLM_TEST_ENABLE_SIMD_NEON)
110-
add_definitions(-DGLM_FORCE_NEON)
111-
message(STATUS "GLM: ARM NEON instruction set")
112-
endif()
113-
114-
if (GLM_TEST_ENABLE_SIMD_FMA)
115-
add_definitions(-DGLM_FORCE_FMA)
116-
if((CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
117-
add_compile_options(-mfma)
118-
endif()
119-
endif()
120-
>>>>>>> 5c1da05b (Simd improvement)
1215

1226
# Compiler and default options
1237

@@ -130,15 +14,6 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
13014
if(NOT GLM_DISABLE_AUTO_DETECTION)
13115
add_compile_options(-Werror -Weverything)
13216
endif()
133-
<<<<<<< HEAD
134-
=======
135-
if (NOT APPLE)
136-
add_compile_options(-Wno-unsafe-buffer-usage) #this option makes MacOS compilation fail but prevent error on windows
137-
endif()
138-
139-
add_compile_options(-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++11-long-long -Wno-padded -Wno-gnu-anonymous-struct -Wno-nested-anon-types)
140-
add_compile_options(-Wno-undefined-reinterpret-cast -Wno-sign-conversion -Wno-unused-variable -Wno-missing-prototypes -Wno-unreachable-code -Wno-missing-variable-declarations -Wno-sign-compare -Wno-global-constructors -Wno-unused-macros -Wno-format-nonliteral -Wno-float-equal)
141-
>>>>>>> 5c1da05b (Simd improvement)
14217

14318
elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
14419
if(NOT GLM_QUIET)

test/core/core_force_compiler_unknown.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#elif defined(_MSC_VER)
1616
# pragma warning(push)
1717
# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
18+
# pragma warning(disable: 4324) // structure was padded due to alignment specifier
1819
#endif
1920

2021
#include <glm/glm.hpp>

0 commit comments

Comments
 (0)