summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-10-04 18:54:20 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-10-04 18:54:20 +0200
commit3e9740ac93f291f9576f1f8d87ac07f7bd27b82a (patch)
tree54fd527195bd1c314d068c17d585443569cd12a6 /scene/gui
parent8068d0217a5e74c25f83fe93fa6e077b8d0b3bf5 (diff)
Fix more "may be used initialized" warnings from GCC 7
Fixes the following GCC 7 warnings: ``` core/cowdata.h:269:47: warning: 'alloc_size' may be used uninitialized in this function [-Wmaybe-uninitialized] core/error_macros.h:163:26: warning: 'nearest_point' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:1579:5: warning: 'colormap_size' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:1582:12: warning: 'size_height' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:1590:23: warning: 'size_width' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:1599:29: warning: 'pixel_size' may be used uninitialized in this function [-Wmaybe-uninitialized] core/math/face3.cpp:207:15: warning: 'tri_max' may be used uninitialized in this function [-Wmaybe-uninitialized] core/math/face3.cpp:209:15: warning: 'tri_min' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/gles3/rasterizer_scene_gles3.cpp:665:22: warning: 'best_used_frame' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/gles3/rasterizer_storage_gles3.cpp:865:27: warning: 'blit_target' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/gles3/rasterizer_storage_gles3.cpp:980:29: warning: 'blit_target' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::frag_id' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::id' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::vert_id' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/plugins/script_editor_plugin.cpp:1980:31: warning: 'se' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/scene_tree_dock.cpp:840:30: warning: 'new_node' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/spatial_editor_gizmos.cpp:4259:9: warning: 'a1' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/spatial_editor_gizmos.cpp:4259:9: warning: 'lll' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/spatial_editor_gizmos.cpp:4259:9: warning: 'lul' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/spatial_editor_gizmos.cpp:4260:9: warning: 'a2' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/spatial_editor_gizmos.cpp:4261:9: warning: 'a3' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/spatial_editor_gizmos.cpp:4265:3: warning: 'enable_lin' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/spatial_editor_gizmos.cpp:4294:3: warning: 'enable_ang' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/spatial_editor_gizmos.cpp:4311:34: warning: 'll' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/spatial_editor_gizmos.cpp:4311:34: warning: 'ul' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1655:47: warning: 'cone_dirs' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1656:73: warning: 'cone_weights' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/gui/texture_progress.cpp:181:6: warning: 'cp' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/gui/texture_progress.cpp:181:6: warning: 'cq' may be used uninitialized in this function [-Wmaybe-uninitialized] servers/physics/shape_sw.cpp:1056:19: warning: 'support_max' may be used uninitialized in this function [-Wmaybe-uninitialized] ```
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/gradient_edit.cpp10
-rw-r--r--scene/gui/texture_progress.cpp6
2 files changed, 8 insertions, 8 deletions
diff --git a/scene/gui/gradient_edit.cpp b/scene/gui/gradient_edit.cpp
index 19ffe681ef..934b84ec0c 100644
--- a/scene/gui/gradient_edit.cpp
+++ b/scene/gui/gradient_edit.cpp
@@ -238,21 +238,21 @@ void GradientEdit::_gui_input(const Ref<InputEvent> &p_event) {
if (mm->get_shift()) {
float snap_treshhold = 0.03;
float smallest_ofs = snap_treshhold;
- bool founded = false;
- int nearest_point;
+ bool found = false;
+ int nearest_point = 0;
for (int i = 0; i < points.size(); ++i) {
if (i != grabbed) {
float temp_ofs = ABS(points[i].offset - newofs);
if (temp_ofs < smallest_ofs) {
smallest_ofs = temp_ofs;
nearest_point = i;
- if (founded)
+ if (found)
break;
- founded = true;
+ found = true;
}
}
}
- if (founded) {
+ if (found) {
if (points[nearest_point].offset < newofs)
newofs = points[nearest_point].offset + 0.00001;
else
diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp
index 7ecdccb0e4..75f88dc4e6 100644
--- a/scene/gui/texture_progress.cpp
+++ b/scene/gui/texture_progress.cpp
@@ -148,9 +148,9 @@ Point2 TextureProgress::unit_val_to_uv(float val) {
float angle = (val * Math_TAU) - Math_PI * 0.5;
Point2 dir = Vector2(Math::cos(angle), Math::sin(angle));
float t1 = 1.0;
- float cp;
- float cq;
- float cr;
+ float cp = 0;
+ float cq = 0;
+ float cr = 0;
float edgeLeft = 0.0;
float edgeRight = 1.0;
float edgeBottom = 0.0;