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.
This commit is contained in:
Rémi Verschelde 2022-04-04 15:06:57 +02:00
parent 53317bbe14
commit f8ab79e68a
258 changed files with 2398 additions and 2421 deletions

View file

@ -325,7 +325,7 @@ private:
List<TextOperation> undo_stack;
List<TextOperation>::Element *undo_stack_pos = nullptr;
Timer *idle_detect;
Timer *idle_detect = nullptr;
uint32_t version = 0;
uint32_t saved_version = 0;
@ -380,7 +380,7 @@ private:
bool draw_caret = true;
bool caret_blink_enabled = false;
Timer *caret_blink_timer;
Timer *caret_blink_timer = nullptr;
bool move_caret_on_right_click = true;
@ -426,7 +426,7 @@ private:
bool dragging_selection = false;
Timer *click_select_held;
Timer *click_select_held = nullptr;
uint64_t last_dblclk = 0;
Vector2 last_dblclk_pos;
void _click_selection_held();
@ -449,8 +449,8 @@ private:
void _update_caret_wrap_offset();
/* Viewport. */
HScrollBar *h_scroll;
VScrollBar *v_scroll;
HScrollBar *h_scroll = nullptr;
VScrollBar *v_scroll = nullptr;
bool scroll_past_end_of_file_enabled = false;