Merge pull request #80615 from akien-mga/gcc-fix-Wmaybe-uninitialized-warnings

Fix GCC `-Wmaybe-uninitialized` warnings
This commit is contained in:
Rémi Verschelde 2023-08-14 15:31:42 +02:00
commit c495eb5102
No known key found for this signature in database
GPG Key ID: C3336907360768E1
3 changed files with 8 additions and 6 deletions

View File

@ -44,8 +44,8 @@ protected:
String _get_cache_path() { return cache_path; } String _get_cache_path() { return cache_path; }
struct FileCache { struct FileCache {
String path; // Local path (as in "folder/to/file.png") String path; // Local path (as in "folder/to/file.png")
uint64_t server_modified_time; // MD5 checksum. uint64_t server_modified_time = 0; // MD5 checksum.
uint64_t modified_time; uint64_t modified_time = 0;
}; };
virtual bool _is_configured() { return !cache_path.is_empty(); } virtual bool _is_configured() { return !cache_path.is_empty(); }
// Can be re-implemented per platform. If so, feel free to ignore get_cache_path() // Can be re-implemented per platform. If so, feel free to ignore get_cache_path()

View File

@ -74,17 +74,17 @@ private:
}; };
struct GLDisplay { struct GLDisplay {
GLDisplay() { context = nullptr; } GLDisplay() {}
~GLDisplay(); ~GLDisplay();
GLManager_X11_Private *context = nullptr; GLManager_X11_Private *context = nullptr;
::Display *x11_display; ::Display *x11_display = nullptr;
XVisualInfo x_vi; XVisualInfo x_vi = {};
}; };
// just for convenience, window and display struct // just for convenience, window and display struct
struct XWinDisp { struct XWinDisp {
::Window x11_window; ::Window x11_window;
::Display *x11_display; ::Display *x11_display = nullptr;
} _x_windisp; } _x_windisp;
LocalVector<GLWindow> _windows; LocalVector<GLWindow> _windows;

View File

@ -423,6 +423,7 @@ TEST_SUITE("[Navigation]") {
navigation_server->free(map); navigation_server->free(map);
} }
#ifndef DISABLE_DEPRECATED
// This test case uses only public APIs on purpose - other test cases use simplified baking. // This test case uses only public APIs on purpose - other test cases use simplified baking.
// FIXME: Remove once deprecated `region_bake_navigation_mesh()` is removed. // FIXME: Remove once deprecated `region_bake_navigation_mesh()` is removed.
TEST_CASE("[NavigationServer3D][SceneTree][DEPRECATED] Server should be able to bake map correctly") { TEST_CASE("[NavigationServer3D][SceneTree][DEPRECATED] Server should be able to bake map correctly") {
@ -470,6 +471,7 @@ TEST_SUITE("[Navigation]") {
memdelete(mesh_instance); memdelete(mesh_instance);
memdelete(node_3d); memdelete(node_3d);
} }
#endif // DISABLE_DEPRECATED
// This test case uses only public APIs on purpose - other test cases use simplified baking. // This test case uses only public APIs on purpose - other test cases use simplified baking.
TEST_CASE("[NavigationServer3D][SceneTree] Server should be able to bake map correctly") { TEST_CASE("[NavigationServer3D][SceneTree] Server should be able to bake map correctly") {