mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03: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:
@@ -1380,14 +1380,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++;
|
||||
@@ -1396,16 +1396,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++;
|
||||
|
||||
@@ -1264,7 +1264,6 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser::
|
||||
Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::BlockNode *p_block, int p_stack_level, int p_break_addr, int p_continue_addr) {
|
||||
|
||||
codegen.push_stack_identifiers();
|
||||
int new_identifiers = 0;
|
||||
codegen.current_line = p_block->line;
|
||||
|
||||
for (int i = 0; i < p_block->statements.size(); i++) {
|
||||
@@ -1297,7 +1296,6 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
|
||||
// copied because there is no _parse_statement :(
|
||||
codegen.add_stack_identifier(id->name, p_stack_level++);
|
||||
codegen.alloc_stack(p_stack_level);
|
||||
new_identifiers++;
|
||||
|
||||
GDScriptParser::OperatorNode *op = memnew(GDScriptParser::OperatorNode);
|
||||
op->op = GDScriptParser::OperatorNode::OP_ASSIGN;
|
||||
@@ -1557,8 +1555,6 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
|
||||
|
||||
codegen.add_stack_identifier(lv->name, p_stack_level++);
|
||||
codegen.alloc_stack(p_stack_level);
|
||||
new_identifiers++;
|
||||
|
||||
} break;
|
||||
default: {
|
||||
//expression
|
||||
|
||||
Reference in New Issue
Block a user