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/packed_scene.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/packed_scene.h')
-rw-r--r-- | scene/resources/packed_scene.h | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/scene/resources/packed_scene.h b/scene/resources/packed_scene.h index a31dcd8d39..e24b09e77f 100644 --- a/scene/resources/packed_scene.h +++ b/scene/resources/packed_scene.h @@ -44,7 +44,7 @@ class SceneState : public Reference { mutable HashMap<NodePath, int> node_path_cache; mutable Map<int, int> base_scene_node_remap; - int base_scene_idx; + int base_scene_idx = -1; enum { NO_PARENT_SAVED = 0x7FFFFFFF, @@ -53,16 +53,16 @@ class SceneState : public Reference { }; struct NodeData { - int parent; - int owner; - int type; - int name; - int instance; - int index; + int parent = 0; + int owner = 0; + int type = 0; + int name = 0; + int instance = 0; + int index = 0; struct Property { - int name; - int value; + int name = 0; + int value = 0; }; Vector<Property> properties; @@ -71,18 +71,17 @@ class SceneState : public Reference { struct PackState { Ref<SceneState> state; - int node; - PackState() { node = -1; } + int node = -1; }; Vector<NodeData> nodes; struct ConnectionData { - int from; - int to; - int signal; - int method; - int flags; + int from = 0; + int to = 0; + int signal = 0; + int method = 0; + int flags = 0; Vector<int> binds; }; @@ -93,7 +92,7 @@ class SceneState : public Reference { String path; - uint64_t last_modified_time; + uint64_t last_modified_time = 0; _FORCE_INLINE_ Ref<SceneState> _get_base_scene_state() const; |