summaryrefslogtreecommitdiff
path: root/modules/regex
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-09-01 21:52:55 +0200
committerGitHub <noreply@github.com>2017-09-01 21:52:55 +0200
commitdac150108ab3c1f41d5fd86cc6853f883064caaf (patch)
tree09195c9dd5e0d651e96b7d26f26985ab5ff6f871 /modules/regex
parent69ac4cbb3764a454194e27a7afe71d98af65c32c (diff)
parentf9467ec1ea6c0dac2ea513b7dfe58d0349788e02 (diff)
Merge pull request #10846 from hpvb/fix-sign-compare
Fix signed and unsigned comparisons
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) {