diff options
author | Rafał Mikrut <mikrutrafal@protonmail.com> | 2021-02-08 10:57:18 +0100 |
---|---|---|
committer | Rafał Mikrut <mikrutrafal@protonmail.com> | 2021-02-08 10:57:18 +0100 |
commit | f7209b459b4faaae9d93bfb6ac5346eb41787f92 (patch) | |
tree | 790808a314837cd3f16c9d229401882046bd6fae /modules/regex | |
parent | 57e2822a05c29db3980ad243c37a34acf6c4d14b (diff) |
Initialize class/struct variables with default values in modules/
Diffstat (limited to 'modules/regex')
-rw-r--r-- | modules/regex/regex.cpp | 2 | ||||
-rw-r--r-- | modules/regex/regex.h | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp index fe8136ef35..6bae12e7e6 100644 --- a/modules/regex/regex.cpp +++ b/modules/regex/regex.cpp @@ -365,12 +365,10 @@ Array RegEx::get_names() const { RegEx::RegEx() { general_ctx = pcre2_general_context_create_32(&_regex_malloc, &_regex_free, nullptr); - code = nullptr; } RegEx::RegEx(const String &p_pattern) { general_ctx = pcre2_general_context_create_32(&_regex_malloc, &_regex_free, nullptr); - code = nullptr; compile(p_pattern); } diff --git a/modules/regex/regex.h b/modules/regex/regex.h index 46505855d7..f5773042fb 100644 --- a/modules/regex/regex.h +++ b/modules/regex/regex.h @@ -42,8 +42,8 @@ class RegExMatch : public Reference { GDCLASS(RegExMatch, Reference); struct Range { - int start; - int end; + int start = 0; + int end = 0; }; String subject; @@ -72,7 +72,7 @@ class RegEx : public Reference { GDCLASS(RegEx, Reference); void *general_ctx; - void *code; + void *code = nullptr; String pattern; void _pattern_info(uint32_t what, void *where) const; |