From f9467ec1ea6c0dac2ea513b7dfe58d0349788e02 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Thu, 31 Aug 2017 23:30:35 +0200 Subject: Fix signed and unsigned comparisons The first in my quest to make Godot 3.x compile with -Werror on GCC7 --- core/packed_data_container.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/packed_data_container.cpp') diff --git a/core/packed_data_container.cpp b/core/packed_data_container.cpp index 4040680c6d..ad8438e416 100644 --- a/core/packed_data_container.cpp +++ b/core/packed_data_container.cpp @@ -61,7 +61,7 @@ Variant PackedDataContainer::_iter_init_ofs(const Array &p_iter, uint32_t p_offs Variant PackedDataContainer::_iter_next_ofs(const Array &p_iter, uint32_t p_offset) { Array ref = p_iter; - uint32_t size = _size(p_offset); + int size = _size(p_offset); if (ref.size() != 1) return false; int pos = ref[0]; @@ -74,7 +74,7 @@ Variant PackedDataContainer::_iter_next_ofs(const Array &p_iter, uint32_t p_offs Variant PackedDataContainer::_iter_get_ofs(const Variant &p_iter, uint32_t p_offset) { - uint32_t size = _size(p_offset); + int size = _size(p_offset); int pos = p_iter; if (pos < 0 || pos >= size) return Variant(); @@ -164,7 +164,7 @@ Variant PackedDataContainer::_key_at_ofs(uint32_t p_ofs, const Variant &p_key, b if (p_key.is_num()) { int idx = p_key; - uint32_t len = decode_uint32(r + 4); + int len = decode_uint32(r + 4); if (idx < 0 || idx >= len) { err = true; return Variant(); @@ -183,7 +183,7 @@ Variant PackedDataContainer::_key_at_ofs(uint32_t p_ofs, const Variant &p_key, b uint32_t len = decode_uint32(r + 4); bool found = false; - for (int i = 0; i < len; i++) { + for (uint32_t i = 0; i < len; i++) { uint32_t khash = decode_uint32(r + 8 + i * 12 + 0); if (khash == hash) { Variant key = _get_at_ofs(decode_uint32(r + 8 + i * 12 + 4), rd.ptr(), err); -- cgit v1.2.3