1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

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.
This commit is contained in:
Rémi Verschelde
2022-09-22 09:25:47 +02:00
parent 8e14f9ba21
commit d1a155e3cd
7 changed files with 31 additions and 26 deletions

View File

@@ -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;
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 = "";
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: