summaryrefslogtreecommitdiff
path: root/modules/regex
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 /modules/regex
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 'modules/regex')
-rw-r--r--modules/regex/regex.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp
index 8afd01e20b..00e8ce0f54 100644
--- a/modules/regex/regex.cpp
+++ b/modules/regex/regex.cpp
@@ -309,7 +309,7 @@ Ref<RegExMatch> RegEx::search(const String &p_subject, int p_offset, int p_end)
_pattern_info(PCRE2_INFO_NAMETABLE, &table);
_pattern_info(PCRE2_INFO_NAMEENTRYSIZE, &entry_size);
- for (int i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
CharType id = table[i * entry_size];
if (result->data[id].start == -1)
@@ -338,7 +338,7 @@ String RegEx::sub(const String &p_subject, const String &p_replacement, bool p_a
PCRE2_SIZE olength = output.length();
PCRE2_SIZE length = p_subject.length();
- if (p_end >= 0 && p_end < length)
+ if (p_end >= 0 && (uint32_t)p_end < length)
length = p_end;
if (sizeof(CharType) == 2) {
@@ -430,7 +430,7 @@ Array RegEx::get_names() const {
_pattern_info(PCRE2_INFO_NAMETABLE, &table);
_pattern_info(PCRE2_INFO_NAMEENTRYSIZE, &entry_size);
- for (int i = 0; i < count; i++) {
+ for (uint32_t i = 0; i < count; i++) {
String name = &table[i * entry_size + 1];
if (result.find(name) < 0) {