summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-07 11:07:13 +0200
committerGitHub <noreply@github.com>2018-10-07 11:07:13 +0200
commitbf6dcb91059c7cb59771cbff23364612309193a4 (patch)
tree5819ae11fc608a6d2c4bbeb0df73d7bd7dd02d18 /core/math
parenteae742312f757ceb8b10ef3d343733e764a9c36a (diff)
parent3e9740ac93f291f9576f1f8d87ac07f7bd27b82a (diff)
Merge pull request #22722 from akien-mga/fix-warnings
Fix more "may be used initialized" warnings from GCC 7
Diffstat (limited to 'core/math')
-rw-r--r--core/math/face3.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/math/face3.cpp b/core/math/face3.cpp
index aa46fde7f7..8366137131 100644
--- a/core/math/face3.cpp
+++ b/core/math/face3.cpp
@@ -202,11 +202,12 @@ bool Face3::intersects_aabb(const AABB &p_aabb) const {
{ \
real_t aabb_min = p_aabb.position.m_ax; \
real_t aabb_max = p_aabb.position.m_ax + p_aabb.size.m_ax; \
- real_t tri_min, tri_max; \
- for (int i = 0; i < 3; i++) { \
- if (i == 0 || vertex[i].m_ax > tri_max) \
+ real_t tri_min = vertex[0].m_ax; \
+ real_t tri_max = vertex[0].m_ax; \
+ for (int i = 1; i < 3; i++) { \
+ if (vertex[i].m_ax > tri_max) \
tri_max = vertex[i].m_ax; \
- if (i == 0 || vertex[i].m_ax < tri_min) \
+ if (vertex[i].m_ax < tri_min) \
tri_min = vertex[i].m_ax; \
} \
\