Skip to content

Removed unnecessary assignments

After scanning the master branch again with cppcheck I noticed a couple of unnecessary assignments.

This pull request definitely needs a couple more eyes. I'm not familiar with all the code I've modified.

# Fixed
[core/math/aabb.cpp:248]: (style) Variable 'max_size' is assigned a value that is never used.
[core/math/aabb.cpp:265]: (style) Variable 'max_size' is assigned a value that is never used.
[core/math/aabb.cpp:283]: (style) Variable 'max_size' is assigned a value that is never used.
[core/math/aabb.cpp:300]: (style) Variable 'max_size' is assigned a value that is never used.
[core/math/bsp_tree.cpp:247]: (style) Variable 'plane_count' is assigned a value that is never used.
[core/math/bsp_tree.cpp:276]: (style) Variable 'steps' is modified but its new value is never used.
[core/math/bsp_tree.cpp:262]: (style) Variable 'plane' is assigned a value that is never used.
[drivers/gles2/rasterizer_canvas_gles2.cpp:198]: (style) Variable 'buffer_ofs' is assigned a value that is never used.
[drivers/gles3/rasterizer_canvas_gles3.cpp:330]: (style) Variable 'buffer_ofs' is assigned a value that is never used.
[drivers/gles3/rasterizer_canvas_gles3.cpp:382]: (style) Variable 'buffer_ofs' is assigned a value that is never used.
[drivers/gles3/rasterizer_scene_gles3.cpp:2970]: (style) Variable 'contrib' is assigned a value that is never used.
[drivers/gles3/shader_gles3.cpp:253]: (style) Variable 'define_line_ofs' is modified but its new value is never used.
[drivers/pulseaudio/audio_driver_pulseaudio.cpp:81]: (style) Variable 'state' is assigned a value that is never used.
[drivers/xaudio2/audio_driver_xaudio2.cpp:100]: (style) Variable 'usdelay' is assigned a value that is never used.
[editor/editor_node.cpp:150]: (style) Variable 'current' is assigned a value that is never used.
[editor/editor_settings.cpp:1375]: (style) struct member 'ShortCutMapping::path' is never used.
[editor/editor_settings.cpp:1376]: (style) struct member 'ShortCutMapping::keycode' is never used.
[editor/plugins/script_editor_plugin.cpp:2214]: (style) Variable 'eh' is assigned a value that is never used.
[modules/gdnative/nativescript/api_generator.cpp:113]: (style) struct member 'ClassAPI::is_creatable' is never used.
[modules/mono/editor/bindings_generator.cpp:1494]: (style) Variable 'tools_sequence' is assigned a value that is never used.
[modules/mono/editor/godotsharp_builds.cpp:81]: (style) Variable 'build_tool' is assigned a value that is never used.
[modules/websocket/emws_client.cpp:67]: (style) Variable 'i' is assigned a value that is never used.
[platform/android/audio_driver_opensl.cpp:192]: (style) Variable 'required' is assigned a value that is never used.
[platform/android/audio_driver_opensl.cpp:193]: (style) Variable 'iidArray' is assigned a value that is never used.
[platform/android/dir_access_jandroid.cpp:156]: (style) Variable 'env' is assigned a value that is never used.
[platform/android/export/export.cpp:535]: (style) Variable 'start_pos' is assigned a value that is never used.
[platform/android/java_glue.cpp:891]: (style) Variable 'use_apk_expansion' is assigned a value that is never used.
[platform/android/thread_jandroid.cpp:135]: (style) Variable 'status' is assigned a value that is never used.
[platform/iphone/export/export.cpp:814]: (style) Variable 'is_execute' is assigned a value that is never used.
[platform/javascript/os_javascript.cpp:191]: (style) Variable 'os' is assigned a value that is never used.
[scene/2d/line_builder.cpp:293]: (style) Variable 'uvx0' is assigned a value that is never used.
[scene/2d/parallax_layer.cpp:123]: (style) Variable 'before' is assigned a value that is never used.
[scene/3d/light.cpp:171]: (style) Variable 'editor_ok' is assigned a value that is never used.
[scene/3d/light.cpp:166]: (style) Variable 'editor_ok' is assigned a value that is never used.
[scene/3d/vehicle_body.cpp:677]: (style) Variable 'numWheelsOnGround' is modified but its new value is never used.
[scene/3d/voxel_light_baker.cpp:2354]: (style) Variable 'vtx_idx' is modified but its new value is never used.
[scene/gui/split_container.cpp:38]: (style) struct member '_MinSizeCache::min_size' is never used.
[scene/gui/split_container.cpp:39]: (style) struct member '_MinSizeCache::will_stretch' is never used.
[scene/gui/split_container.cpp:40]: (style) struct member '_MinSizeCache::final_size' is never used.
[scene/gui/text_edit.cpp:303]: (style) Variable 'num_rows' is assigned a value that is never used.
[scene/resources/mesh.cpp:1190]: (style) Variable 'vertex_idx' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:105]: (style) Variable 'v2' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:106]: (style) Variable 'v3' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:107]: (style) Variable 'v4' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:108]: (style) Variable 'v5' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:109]: (style) Variable 'v0n' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:110]: (style) Variable 'v1n' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:111]: (style) Variable 'v2n' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:112]: (style) Variable 'v3n' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:113]: (style) Variable 'v4n' is assigned a value that is never used.
[servers/audio/audio_rb_resampler.cpp:114]: (style) Variable 'v5n' is assigned a value that is never used.
[servers/physics/collision_solver_sat.cpp:236]: (style) Variable 'added' is modified but its new value is never used.
[servers/physics/step_sw.cpp:289]: (style) Variable 'profile_begtime' is assigned a value that is never used.
[servers/visual_server.cpp:232]: (style) Variable 'vtx_idx' is modified but its new value is never used.

# Possible False Positives -- these prompted changes member variables that would likely end up in bugs. These were not touched:
[editor/editor_settings.cpp:1077]: (style) Variable 'hints' is assigned a value that is never used.
[editor/file_type_cache.cpp:53]: (style) Variable 'file_type_map' is assigned a value that is never used.
[editor/progress_dialog.cpp:126]: (style) Variable 'updates' is assigned a value that is never used.
[modules/dds/texture_loader_dds.cpp:68]: (style) struct member 'DDSFormatInfo::name' is never used.
[scene/resources/dynamic_font.cpp:212]: (style) Variable 'error' is assigned a value that is never used.

Merge request reports

Loading