summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-07 11:07:13 +0200
committerGitHub <noreply@github.com>2018-10-07 11:07:13 +0200
commitbf6dcb91059c7cb59771cbff23364612309193a4 (patch)
tree5819ae11fc608a6d2c4bbeb0df73d7bd7dd02d18 /scene/gui
parenteae742312f757ceb8b10ef3d343733e764a9c36a (diff)
parent3e9740ac93f291f9576f1f8d87ac07f7bd27b82a (diff)
Merge pull request #22722 from akien-mga/fix-warnings
Fix more "may be used initialized" warnings from GCC 7
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;