diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-08 11:53:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 11:53:02 +0100 |
commit | 332a33503bf6ddd25f4012a0b8caaaeb67e9b18e (patch) | |
tree | 0eb10c2fcb4e7f94a2ca16365e9d36076b94bc03 /modules/gdnavigation | |
parent | 5260b6e046c244ed6376c47c7af5a0f27d934c12 (diff) | |
parent | f7209b459b4faaae9d93bfb6ac5346eb41787f92 (diff) |
Merge pull request #43952 from qarmin/cppcheck_modules
Initialize class/struct variables with default values in modules/
Diffstat (limited to 'modules/gdnavigation')
-rw-r--r-- | modules/gdnavigation/nav_utils.h | 14 | ||||
-rw-r--r-- | modules/gdnavigation/rvo_agent.h | 2 |
2 files changed, 6 insertions, 10 deletions
diff --git a/modules/gdnavigation/nav_utils.h b/modules/gdnavigation/nav_utils.h index d1d1687a1f..d257a95ef1 100644 --- a/modules/gdnavigation/nav_utils.h +++ b/modules/gdnavigation/nav_utils.h @@ -51,7 +51,7 @@ union PointKey { int64_t z : 21; }; - uint64_t key; + uint64_t key = 0; bool operator<(const PointKey &p_key) const { return key < p_key.key; } }; @@ -86,8 +86,6 @@ struct Edge { /// The other `Polygon` at this edge id has this `Polygon`. int other_edge = -1; - - Edge() {} }; struct Polygon { @@ -111,8 +109,6 @@ struct Connection { int A_edge = -1; Polygon *B = nullptr; int B_edge = -1; - - Connection() {} }; struct NavigationPoly { @@ -141,12 +137,12 @@ struct NavigationPoly { }; struct FreeEdge { - bool is_free; - Polygon *poly; - uint32_t edge_id; + bool is_free = false; + Polygon *poly = nullptr; + uint32_t edge_id = 0; Vector3 edge_center; Vector3 edge_dir; - float edge_len_squared; + float edge_len_squared = 0.0; }; } // namespace gd diff --git a/modules/gdnavigation/rvo_agent.h b/modules/gdnavigation/rvo_agent.h index d9e3345498..369cb1f9a3 100644 --- a/modules/gdnavigation/rvo_agent.h +++ b/modules/gdnavigation/rvo_agent.h @@ -53,7 +53,7 @@ class RvoAgent : public NavRid { NavMap *map = nullptr; RVO::Agent agent; AvoidanceComputedCallback callback; - uint32_t map_update_id; + uint32_t map_update_id = 0; public: RvoAgent(); |