diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-10 20:06:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-10 20:06:12 +0100 |
commit | e8f73124a7d97abc94cea3cf7fe5b5614f61a448 (patch) | |
tree | ff99e368359d56d760c8617af1021d0313635e38 /scene/resources/resource_format_text.h | |
parent | 3c39aa8302a4f07a1470685bbf66f883c49f571e (diff) | |
parent | 7961a1dea3e7ce8c4e7197a0000e35ab31e9ff2e (diff) |
Merge pull request #45845 from qarmin/cppcheck_scene_2
Initialize class variables with default values in scene/ [2/2]
Diffstat (limited to 'scene/resources/resource_format_text.h')
-rw-r--r-- | scene/resources/resource_format_text.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/scene/resources/resource_format_text.h b/scene/resources/resource_format_text.h index e67a13d41a..3fc7814fe5 100644 --- a/scene/resources/resource_format_text.h +++ b/scene/resources/resource_format_text.h @@ -38,12 +38,12 @@ #include "scene/resources/packed_scene.h" class ResourceLoaderText { - bool translation_remapped; + bool translation_remapped = false; String local_path; String res_path; String error_text; - FileAccess *f; + FileAccess *f = nullptr; VariantParser::StreamFile stream; @@ -53,28 +53,28 @@ class ResourceLoaderText { String type; }; - bool is_scene; + bool is_scene = false; String res_type; - bool ignore_resource_parsing; + bool ignore_resource_parsing = false; //Map<String,String> remaps; Map<int, ExtResource> ext_resources; Map<int, RES> int_resources; - int resources_total; - int resource_current; + int resources_total = 0; + int resource_current = 0; String resource_type; VariantParser::Tag next_tag; - bool use_nocache; + bool use_nocache = false; - bool use_sub_threads; - float *progress; + bool use_sub_threads = false; + float *progress = nullptr; - mutable int lines; + mutable int lines = 0; Map<String, String> remaps; //void _printerr(); @@ -107,7 +107,7 @@ class ResourceLoaderText { friend class ResourceFormatLoaderText; - Error error; + Error error = OK; RES resource; @@ -152,11 +152,11 @@ class ResourceFormatSaverTextInstance { Ref<PackedScene> packed_scene; - bool takeover_paths; - bool relative_paths; - bool bundle_resources; - bool skip_editor; - FileAccess *f; + bool takeover_paths = false; + bool relative_paths = false; + bool bundle_resources = false; + bool skip_editor = false; + FileAccess *f = nullptr; struct NonPersistentKey { //for resource properties generated on the fly RES base; @@ -173,7 +173,7 @@ class ResourceFormatSaverTextInstance { struct ResourceSort { RES resource; - int index; + int index = 0; bool operator<(const ResourceSort &p_right) const { return index < p_right.index; } |