summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2017-08-31 23:30:35 +0200
committerHein-Pieter van Braam <hp@tmm.cx>2017-09-01 08:13:12 +0200
commitf9467ec1ea6c0dac2ea513b7dfe58d0349788e02 (patch)
tree05421200fdd55c97b3b60895597f487d8ac51afa /scene
parent51ae90d7893fd392dd8938cc41c52081e5065794 (diff)
Fix signed and unsigned comparisons
The first in my quest to make Godot 3.x compile with -Werror on GCC7
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/item_list.cpp4
-rw-r--r--scene/resources/texture.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index 9bad871ef9..f8d82a339c 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -534,7 +534,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec;
- if (diff < int(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
+ if (diff < uint64_t(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
for (int i = current - 1; i >= 0; i--) {
@@ -569,7 +569,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
uint64_t now = OS::get_singleton()->get_ticks_msec();
uint64_t diff = now - search_time_msec;
- if (diff < int(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
+ if (diff < uint64_t(ProjectSettings::get_singleton()->get("gui/timers/incremental_search_max_interval_msec")) * 2) {
for (int i = current + 1; i < items.size(); i++) {
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 9751d6e711..6a9ded9ea3 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -501,9 +501,9 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
Vector<Ref<Image> > mipmap_images;
int total_size = 0;
- for (int i = 0; i < mipmaps; i++) {
+ for (uint32_t i = 0; i < mipmaps; i++) {
- if (i > 0) {
+ if (i) {
size = f->get_32();
}