Fixes logically dead code (Coverity)
Fixes reported logically dead codes by Coverity * image.cpp: Doesn't really need any modification. But to remove the bug report then we have to move the MAX call away from the for loop statement. * rasterizer_gles3.cpp: Removes unnecessary elif condition since it is checked earlier in the function * collada.cpp: If stamement never reached due to macro ERR_CONTINUE does the same. * navigation_mesh.cpp: Variables should always be null - however, also checked for the very same condition in their function call. Leaving this for review (whether the function call is necessary or not) * path_editor_plugin.cpp: If cancel is true, then it should restore the edited value to the original provided. http://docs.godotengine.org/en/3.0/classes/class_editorspatialgizmo.html#class-editorspatialgizmo-commit-handle * spatial_editor_gizmos.cpp: the very condition of i >= 3 is predetermined in the if case right before it. Thus case 1 is always '1' and case 2 is always '-1' * grid_map_editor.cpp: Same as above in spatial_editor_gizmos.cpp * voxel_light_baker.cpp: Same as above in spatial_editor_gizmos.cpp * visual_server.cpp: Same as above in spatial_editor_gizmos.cpp * visual_script_expression.cpp: char '-' is already true in the switch case mechanism. Thus it can never reach to default case. * particles.cpp: Case 'PARAM_MAX' is unreachable due to index checking right before the switch execution. * shader_language.cpp: Invalid index is handled in switch default case. `type < TYPE_FLOAT && type > TYPE_VEC4` -> `(type < TYPE_FLOAT || type > TYPE_VEC4`) Fixes the "always false problem" in TODO comment.
This commit is contained in:
parent
7d6f210ccb
commit
e6deba8d19
13 changed files with 38 additions and 65 deletions
|
|
@ -280,26 +280,20 @@ void NavigationMeshGenerator::bake(Ref<NavigationMesh> p_nav_mesh, Node *p_node)
|
|||
|
||||
_build_recast_navigation_mesh(p_nav_mesh, &ep, hf, chf, cset, poly_mesh, detail_mesh, vertices, indices);
|
||||
|
||||
if (hf) {
|
||||
rcFreeHeightField(hf);
|
||||
hf = 0;
|
||||
}
|
||||
if (chf) {
|
||||
rcFreeCompactHeightfield(chf);
|
||||
chf = 0;
|
||||
}
|
||||
if (cset) {
|
||||
rcFreeContourSet(cset);
|
||||
cset = 0;
|
||||
}
|
||||
if (poly_mesh) {
|
||||
rcFreePolyMesh(poly_mesh);
|
||||
poly_mesh = 0;
|
||||
}
|
||||
if (detail_mesh) {
|
||||
rcFreePolyMeshDetail(detail_mesh);
|
||||
detail_mesh = 0;
|
||||
}
|
||||
rcFreeHeightField(hf);
|
||||
hf = 0;
|
||||
|
||||
rcFreeCompactHeightfield(chf);
|
||||
chf = 0;
|
||||
|
||||
rcFreeContourSet(cset);
|
||||
cset = 0;
|
||||
|
||||
rcFreePolyMesh(poly_mesh);
|
||||
poly_mesh = 0;
|
||||
|
||||
rcFreePolyMeshDetail(detail_mesh);
|
||||
detail_mesh = 0;
|
||||
}
|
||||
ep.step(TTR("Done!"), 11);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,18 +167,12 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p
|
|||
|
||||
Vector3 ofs;
|
||||
|
||||
if (p_cancel) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (t == 0) {
|
||||
|
||||
if (p_cancel) {
|
||||
|
||||
c->set_point_in(p_idx, p_restore);
|
||||
return;
|
||||
}
|
||||
|
||||
ur->create_action(TTR("Set Curve In Position"));
|
||||
ur->add_do_method(c.ptr(), "set_point_in", idx, c->get_point_in(idx));
|
||||
ur->add_undo_method(c.ptr(), "set_point_in", idx, p_restore);
|
||||
|
|
@ -186,10 +180,11 @@ void PathSpatialGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p
|
|||
|
||||
} else {
|
||||
if (p_cancel) {
|
||||
|
||||
c->set_point_out(idx, p_restore);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ur->create_action(TTR("Set Curve Out Position"));
|
||||
ur->add_do_method(c.ptr(), "set_point_out", idx, c->get_point_out(idx));
|
||||
ur->add_undo_method(c.ptr(), "set_point_out", idx, p_restore);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue