diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-04 15:06:57 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-04 19:49:50 +0200 |
commit | f8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch) | |
tree | a9d2df2e2df939c189135b1c36a01e06b37b80b2 /editor/find_in_files.h | |
parent | 53317bbe146dd19a919685df8d846c55568daba1 (diff) | |
download | redot-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/find_in_files.h')
-rw-r--r-- | editor/find_in_files.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/editor/find_in_files.h b/editor/find_in_files.h index cf14f3d5c3..9def190b5b 100644 --- a/editor/find_in_files.h +++ b/editor/find_in_files.h @@ -132,18 +132,18 @@ private: void _on_replace_text_submitted(String text); FindInFilesMode _mode; - LineEdit *_search_text_line_edit; - - Label *_replace_label; - LineEdit *_replace_text_line_edit; - - LineEdit *_folder_line_edit; - CheckBox *_match_case_checkbox; - CheckBox *_whole_words_checkbox; - Button *_find_button; - Button *_replace_button; - FileDialog *_folder_dialog; - HBoxContainer *_filters_container; + LineEdit *_search_text_line_edit = nullptr; + + Label *_replace_label = nullptr; + LineEdit *_replace_text_line_edit = nullptr; + + LineEdit *_folder_line_edit = nullptr; + CheckBox *_match_case_checkbox = nullptr; + CheckBox *_whole_words_checkbox = nullptr; + Button *_find_button = nullptr; + Button *_replace_button = nullptr; + FileDialog *_folder_dialog = nullptr; + HBoxContainer *_filters_container = nullptr; HashMap<String, bool> _filters_preferences; }; @@ -201,20 +201,20 @@ private: void set_progress_visible(bool visible); void clear(); - FindInFiles *_finder; - Label *_search_text_label; - Tree *_results_display; - Label *_status_label; - Button *_refresh_button; - Button *_cancel_button; - ProgressBar *_progress_bar; + FindInFiles *_finder = nullptr; + Label *_search_text_label = nullptr; + Tree *_results_display = nullptr; + Label *_status_label = nullptr; + Button *_refresh_button = nullptr; + Button *_cancel_button = nullptr; + ProgressBar *_progress_bar = nullptr; Map<String, TreeItem *> _file_items; Map<TreeItem *, Result> _result_items; bool _with_replace = false; - HBoxContainer *_replace_container; - LineEdit *_replace_line_edit; - Button *_replace_all_button; + HBoxContainer *_replace_container = nullptr; + LineEdit *_replace_line_edit = nullptr; + Button *_replace_all_button = nullptr; }; #endif // FIND_IN_FILES_H |