diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-22 09:25:47 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-22 11:29:48 +0200 |
commit | d1a155e3cd3214eafe6d157bd235932e4ae6bfe3 (patch) | |
tree | d1eb3e0af66f7d69a4b20919e8cc08aad05edae8 /editor/plugins/theme_editor_plugin.cpp | |
parent | 8e14f9ba21725a9445f3979742f2fc87c8a7b463 (diff) |
Fix various -Wmaybe-uninitialized warnings from GCC 12.2.1
Not sure why I didn't get those before, it may be due to upstream
changes (12.2.1 is a moving target, it's basically 12.3-dev), or simply
rebuilding Godot from scratch with different options.
Diffstat (limited to 'editor/plugins/theme_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/theme_editor_plugin.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 1fb9b42449..e2ed8e44c4 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -134,7 +134,7 @@ void ThemeItemImportTree::_update_items_tree() { data_type_node->set_checked(IMPORT_ITEM_DATA, false); data_type_node->set_editable(IMPORT_ITEM_DATA, true); - List<TreeItem *> *item_list; + List<TreeItem *> *item_list = nullptr; switch (dt) { case Theme::DATA_TYPE_COLOR: @@ -398,7 +398,7 @@ void ThemeItemImportTree::_restore_selected_item(TreeItem *p_tree_item) { void ThemeItemImportTree::_update_total_selected(Theme::DataType p_data_type) { ERR_FAIL_INDEX_MSG(p_data_type, Theme::DATA_TYPE_MAX, "Theme item data type is out of bounds."); - Label *total_selected_items_label; + Label *total_selected_items_label = nullptr; switch (p_data_type) { case Theme::DATA_TYPE_COLOR: total_selected_items_label = total_selected_colors_label; @@ -562,7 +562,7 @@ void ThemeItemImportTree::_select_all_data_type_pressed(int p_data_type) { } Theme::DataType data_type = (Theme::DataType)p_data_type; - List<TreeItem *> *item_list; + List<TreeItem *> *item_list = nullptr; switch (data_type) { case Theme::DATA_TYPE_COLOR: @@ -617,7 +617,7 @@ void ThemeItemImportTree::_select_full_data_type_pressed(int p_data_type) { } Theme::DataType data_type = (Theme::DataType)p_data_type; - List<TreeItem *> *item_list; + List<TreeItem *> *item_list = nullptr; switch (data_type) { case Theme::DATA_TYPE_COLOR: @@ -674,7 +674,7 @@ void ThemeItemImportTree::_deselect_all_data_type_pressed(int p_data_type) { } Theme::DataType data_type = (Theme::DataType)p_data_type; - List<TreeItem *> *item_list; + List<TreeItem *> *item_list = nullptr; switch (data_type) { case Theme::DATA_TYPE_COLOR: @@ -982,17 +982,17 @@ ThemeItemImportTree::ThemeItemImportTree() { for (int i = 0; i < Theme::DATA_TYPE_MAX; i++) { Theme::DataType dt = (Theme::DataType)i; - TextureRect *select_items_icon; - Label *select_items_label; - Button *deselect_all_items_button; - Button *select_all_items_button; - Button *select_full_items_button; - Label *total_selected_items_label; - - String items_title = ""; - String select_all_items_tooltip = ""; - String select_full_items_tooltip = ""; - String deselect_all_items_tooltip = ""; + TextureRect *select_items_icon = nullptr; + Label *select_items_label = nullptr; + Button *deselect_all_items_button = nullptr; + Button *select_all_items_button = nullptr; + Button *select_full_items_button = nullptr; + Label *total_selected_items_label = nullptr; + + String items_title; + String select_all_items_tooltip; + String select_full_items_tooltip; + String deselect_all_items_tooltip; switch (dt) { case Theme::DATA_TYPE_COLOR: |