summaryrefslogtreecommitdiff
path: root/core/io/marshalls.cpp
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 /core/io/marshalls.cpp
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 'core/io/marshalls.cpp')
-rw-r--r--core/io/marshalls.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index af7db904e9..0834d6c321 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -333,14 +333,14 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
len -= 12;
buf += 12;
- int total = namecount + subnamecount;
+ uint32_t total = namecount + subnamecount;
if (flags & 2)
total++;
if (r_len)
(*r_len) += 12;
- for (int i = 0; i < total; i++) {
+ for (uint32_t i = 0; i < total; i++) {
ERR_FAIL_COND_V((int)len < 4, ERR_INVALID_DATA);
strlen = decode_uint32(buf);
@@ -566,7 +566,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
if (count) {
data.resize(count);
PoolVector<uint8_t>::Write w = data.write();
- for (int i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
w[i] = buf[i];
}
@@ -597,7 +597,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
//const int*rbuf=(const int*)buf;
data.resize(count);
PoolVector<int>::Write w = data.write();
- for (int i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
w[i] = decode_uint32(&buf[i * 4]);
}
@@ -624,7 +624,7 @@ Error decode_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int
//const float*rbuf=(const float*)buf;
data.resize(count);
PoolVector<float>::Write w = data.write();
- for (int i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
w[i] = decode_float(&buf[i * 4]);
}