From 84692c6252438393999c427bf7f5d35b9c43926c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 12 Dec 2023 11:00:06 +0100 Subject: [PATCH] Navigation: Fix GCC 12.3 `-Wtype-limits` warnings --- modules/navigation/nav_map.cpp | 2 +- modules/navigation/nav_region.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index 2add9f5ef5f..3b875b7fa75 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -816,7 +816,7 @@ Vector3 NavMap::get_random_point(uint32_t p_navigation_layers, bool p_uniformly) RBMap::Iterator E = accessible_regions_area_map.find_closest(random_accessible_regions_area_map); ERR_FAIL_COND_V(!E, Vector3()); uint32_t random_region_index = E->value; - ERR_FAIL_INDEX_V(random_region_index, accessible_regions.size(), Vector3()); + ERR_FAIL_UNSIGNED_INDEX_V(random_region_index, accessible_regions.size(), Vector3()); const NavRegion *random_region = accessible_regions[random_region_index]; ERR_FAIL_NULL_V(random_region, Vector3()); diff --git a/modules/navigation/nav_region.cpp b/modules/navigation/nav_region.cpp index 11b77593580..9cb235d79f6 100644 --- a/modules/navigation/nav_region.cpp +++ b/modules/navigation/nav_region.cpp @@ -135,7 +135,7 @@ Vector3 NavRegion::get_random_point(uint32_t p_navigation_layers, bool p_uniform RBMap::Iterator region_E = region_area_map.find_closest(region_area_map_pos); ERR_FAIL_COND_V(!region_E, Vector3()); uint32_t rrp_polygon_index = region_E->value; - ERR_FAIL_INDEX_V(rrp_polygon_index, region_polygons.size(), Vector3()); + ERR_FAIL_UNSIGNED_INDEX_V(rrp_polygon_index, region_polygons.size(), Vector3()); const gd::Polygon &rr_polygon = region_polygons[rrp_polygon_index]; @@ -161,7 +161,7 @@ Vector3 NavRegion::get_random_point(uint32_t p_navigation_layers, bool p_uniform RBMap::Iterator polygon_E = polygon_area_map.find_closest(polygon_area_map_pos); ERR_FAIL_COND_V(!polygon_E, Vector3()); uint32_t rrp_face_index = polygon_E->value; - ERR_FAIL_INDEX_V(rrp_face_index, rr_polygon.points.size(), Vector3()); + ERR_FAIL_UNSIGNED_INDEX_V(rrp_face_index, rr_polygon.points.size(), Vector3()); const Face3 face(rr_polygon.points[0].pos, rr_polygon.points[rrp_face_index - 1].pos, rr_polygon.points[rrp_face_index].pos);