Port member initialization from constructor to declaration (C++11)

Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
This commit is contained in:
Rémi Verschelde 2020-05-12 17:01:17 +02:00
parent e7c9d81876
commit 1f6f364a56
325 changed files with 1689 additions and 3480 deletions

View file

@ -55,15 +55,15 @@ public:
};
private:
Align align;
VAlign valign;
Align align = ALIGN_LEFT;
VAlign valign = VALIGN_TOP;
String text;
String xl_text;
bool autowrap;
bool clip;
bool autowrap = false;
bool clip = false;
Size2 minsize;
int line_count;
bool uppercase;
int line_count = 0;
bool uppercase = false;
int get_longest_line_width() const;
@ -73,30 +73,23 @@ private:
CHAR_NEWLINE = -1,
CHAR_WRAPLINE = -2
};
int char_pos; // if -1, then newline
int word_len;
int pixel_width;
int space_count;
WordCache *next;
WordCache() {
char_pos = 0;
word_len = 0;
pixel_width = 0;
next = 0;
space_count = 0;
}
int char_pos = 0; // if -1, then newline
int word_len = 0;
int pixel_width = 0;
int space_count = 0;
WordCache *next = nullptr;
};
bool word_cache_dirty;
bool word_cache_dirty = true;
void regenerate_word_cache();
float percent_visible;
float percent_visible = 1;
WordCache *word_cache;
int total_char_cache;
int visible_chars;
int lines_skipped;
int max_lines_visible;
WordCache *word_cache = nullptr;
int total_char_cache = 0;
int visible_chars = -1;
int lines_skipped = 0;
int max_lines_visible = -1;
protected:
void _notification(int p_what);