From ea1848ce0a5f03c3a9f7e0a221350f4f4044bb08 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 29 Sep 2022 09:18:07 +0300 Subject: Use `constexpr` in the conditions with template parameters and `sizeof`s to suppress C4127 warnings. --- core/math/bvh_split.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/math') diff --git a/core/math/bvh_split.inc b/core/math/bvh_split.inc index ff07166d4a..180bbfb511 100644 --- a/core/math/bvh_split.inc +++ b/core/math/bvh_split.inc @@ -13,7 +13,7 @@ void _split_inform_references(uint32_t p_node_id) { void _split_leaf_sort_groups_simple(int &num_a, int &num_b, uint16_t *group_a, uint16_t *group_b, const BVHABB_CLASS *temp_bounds, const BVHABB_CLASS full_bound) { // special case for low leaf sizes .. should static compile out - if (MAX_ITEMS < 4) { + if constexpr (MAX_ITEMS < 4) { uint32_t ind = group_a[0]; // add to b @@ -34,7 +34,7 @@ void _split_leaf_sort_groups_simple(int &num_a, int &num_b, uint16_t *group_a, u order[POINT::AXIS_COUNT - 1] = size.max_axis_index(); static_assert(POINT::AXIS_COUNT <= 3, "BVH POINT::AXIS_COUNT has unexpected size"); - if (POINT::AXIS_COUNT == 3) { + if constexpr (POINT::AXIS_COUNT == 3) { order[1] = 3 - (order[0] + order[2]); } -- cgit v1.2.3