1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fix warnings found by Emscripten 3.1.10

Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and
`-Wliteral-range` warnings.

(cherry picked from commit d8935b27a9)
This commit is contained in:
Rémi Verschelde
2022-05-10 12:05:52 +02:00
parent 67d2013e67
commit d0306332ac
10 changed files with 35 additions and 48 deletions

View File

@@ -1390,14 +1390,14 @@ void CSGBrushOperation::update_faces(const CSGBrush &p_brush_a, const int p_face
if (has_degenerate) return;
// Ensure B has points either side of or in the plane of A.
int in_plane_count = 0, over_count = 0, under_count = 0;
int over_count = 0, under_count = 0;
Plane plane_a(vertices_a[0], vertices_a[1], vertices_a[2]);
ERR_FAIL_COND_MSG(plane_a.normal == Vector3(), "Couldn't form plane from Brush A face.");
for (int i = 0; i < 3; i++) {
if (plane_a.has_point(vertices_b[i]))
in_plane_count++;
else if (plane_a.is_point_over(vertices_b[i]))
if (plane_a.has_point(vertices_b[i])) {
// In plane.
} else if (plane_a.is_point_over(vertices_b[i]))
over_count++;
else
under_count++;
@@ -1406,16 +1406,15 @@ void CSGBrushOperation::update_faces(const CSGBrush &p_brush_a, const int p_face
if (over_count == 3 || under_count == 3) return;
// Ensure A has points either side of or in the plane of B.
in_plane_count = 0;
over_count = 0;
under_count = 0;
Plane plane_b(vertices_b[0], vertices_b[1], vertices_b[2]);
ERR_FAIL_COND_MSG(plane_b.normal == Vector3(), "Couldn't form plane from Brush B face.");
for (int i = 0; i < 3; i++) {
if (plane_b.has_point(vertices_a[i]))
in_plane_count++;
else if (plane_b.is_point_over(vertices_a[i]))
if (plane_b.has_point(vertices_a[i])) {
// In plane.
} else if (plane_b.is_point_over(vertices_a[i]))
over_count++;
else
under_count++;