diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-09-27 13:11:41 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-09-27 16:33:52 +0200 |
commit | cdc411fd54fbafc414b29abb1d50a0ff327f0d89 (patch) | |
tree | d6efd627de853bc73cd496f4f5872393590882cb /editor/import | |
parent | d95bbb89227cab293f17f325040084ea780652ab (diff) |
Fix various warnings: [-Waddress], [-Wpointer-arith], [-Wwrite-strings], [-Wreturn-local-addr] and more
Fixes the following GCC 5 warnings:
```
core/os/file_access.cpp:49:19: warning: the address of 'FileAccess::create_func' will always evaluate as 'true' [-Waddress]
servers/audio_server.cpp:192:70: warning: comparison with string literal results in unspecified behaviour [-Waddress]
drivers/gles2/rasterizer_storage_gles2.cpp:4095:90: warning: NULL used in arithmetic [-Wpointer-arith]
modules/gdnative/register_types.cpp:237:3: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
platform/android/export/export.cpp:207:1: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
modules/gdscript/gdscript.h:150:67: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:119:56: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:123:56: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:127:50: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:131:52: warning: returning reference to temporary [-Wreturn-local-addr]
editor/plugins/skeleton_editor_plugin.cpp:34:36: warning: extra tokens at end of #include directive
modules/bullet/bullet_types_converter.cpp:31:9: warning: #pragma once in main file
editor/import/editor_scene_importer_gltf.cpp:1996:51: warning: name lookup of 'i' changed
modules/visual_script/visual_script_property_selector.cpp:402:45: warning: name lookup of 'E' changed
scene/gui/tree.cpp:1268:25: warning: name lookup of 'i' changed
scene/resources/visual_shader.cpp:808:32: warning: name lookup of 'i' changed
```
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 85383fd69d..a6b754de3b 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -1910,15 +1910,15 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye NodePath node_path; GLTFNode *node = state.nodes[E->key()]; - for (int i = 0; i < node->godot_nodes.size(); i++) { + for (int n = 0; n < node->godot_nodes.size(); n++) { if (node->joints.size()) { - Skeleton *sk = (Skeleton *)node->godot_nodes[i]; + Skeleton *sk = (Skeleton *)node->godot_nodes[n]; String path = ap->get_parent()->get_path_to(sk); - String bone = sk->get_bone_name(node->joints[i].godot_bone_index); + String bone = sk->get_bone_name(node->joints[n].godot_bone_index); node_path = path + ":" + bone; } else { - node_path = ap->get_parent()->get_path_to(node->godot_nodes[i]); + node_path = ap->get_parent()->get_path_to(node->godot_nodes[n]); } for (int i = 0; i < track.rotation_track.times.size(); i++) { @@ -1993,8 +1993,8 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye xform.basis.set_quat_scale(rot, scale); xform.origin = pos; - Skeleton *skeleton = skeletons[node->joints[i].skin]; - int bone = node->joints[i].godot_bone_index; + Skeleton *skeleton = skeletons[node->joints[n].skin]; + int bone = node->joints[n].godot_bone_index; xform = skeleton->get_bone_rest(bone).affine_inverse() * xform; rot = xform.basis.get_rotation_quat(); |