summaryrefslogtreecommitdiffstats
path: root/editor/editor_properties_array_dict.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-04-04 15:06:57 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-04-04 19:49:50 +0200
commitf8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch)
treea9d2df2e2df939c189135b1c36a01e06b37b80b2 /editor/editor_properties_array_dict.h
parent53317bbe146dd19a919685df8d846c55568daba1 (diff)
downloadredot-engine-f8ab79e68af20e18e1d868b64d6dfd0c429bc554.tar.gz
Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
Diffstat (limited to 'editor/editor_properties_array_dict.h')
-rw-r--r--editor/editor_properties_array_dict.h42
1 files changed, 21 insertions, 21 deletions
diff --git a/editor/editor_properties_array_dict.h b/editor/editor_properties_array_dict.h
index 3d9fe90b20..070353c538 100644
--- a/editor/editor_properties_array_dict.h
+++ b/editor/editor_properties_array_dict.h
@@ -80,7 +80,7 @@ public:
class EditorPropertyArray : public EditorProperty {
GDCLASS(EditorPropertyArray, EditorProperty);
- PopupMenu *change_type;
+ PopupMenu *change_type = nullptr;
bool updating = false;
bool dropping = false;
@@ -88,12 +88,12 @@ class EditorPropertyArray : public EditorProperty {
int page_length = 20;
int page_index = 0;
int changing_type_index;
- Button *edit;
- VBoxContainer *vbox;
- VBoxContainer *property_vbox;
- EditorSpinSlider *size_slider;
- Button *button_add_item;
- EditorPaginator *paginator;
+ Button *edit = nullptr;
+ VBoxContainer *vbox = nullptr;
+ VBoxContainer *property_vbox = nullptr;
+ EditorSpinSlider *size_slider = nullptr;
+ Button *button_add_item = nullptr;
+ EditorPaginator *paginator = nullptr;
Variant::Type array_type;
Variant::Type subtype;
PropertyHint subtype_hint;
@@ -138,19 +138,19 @@ public:
class EditorPropertyDictionary : public EditorProperty {
GDCLASS(EditorPropertyDictionary, EditorProperty);
- PopupMenu *change_type;
+ PopupMenu *change_type = nullptr;
bool updating = false;
Ref<EditorPropertyDictionaryObject> object;
int page_length = 20;
int page_index = 0;
int changing_type_index;
- Button *edit;
- VBoxContainer *vbox;
- VBoxContainer *property_vbox;
- EditorSpinSlider *size_slider;
- Button *button_add_item;
- EditorPaginator *paginator;
+ Button *edit = nullptr;
+ VBoxContainer *vbox = nullptr;
+ VBoxContainer *property_vbox = nullptr;
+ EditorSpinSlider *size_slider = nullptr;
+ Button *button_add_item = nullptr;
+ EditorPaginator *paginator = nullptr;
void _page_changed(int p_page);
void _edit_pressed();
@@ -173,19 +173,19 @@ public:
class EditorPropertyLocalizableString : public EditorProperty {
GDCLASS(EditorPropertyLocalizableString, EditorProperty);
- EditorLocaleDialog *locale_select;
+ EditorLocaleDialog *locale_select = nullptr;
bool updating;
Ref<EditorPropertyDictionaryObject> object;
int page_length = 20;
int page_index = 0;
- Button *edit;
- VBoxContainer *vbox;
- VBoxContainer *property_vbox;
- EditorSpinSlider *size_slider;
- Button *button_add_item;
- EditorPaginator *paginator;
+ Button *edit = nullptr;
+ VBoxContainer *vbox = nullptr;
+ VBoxContainer *property_vbox = nullptr;
+ EditorSpinSlider *size_slider = nullptr;
+ Button *button_add_item = nullptr;
+ EditorPaginator *paginator = nullptr;
void _page_changed(int p_page);
void _edit_pressed();