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

@ -48,10 +48,10 @@ class ShaderFileEditor : public PanelContainer {
Ref<RDShaderFile> shader_file;
HBoxContainer *stage_hb;
ItemList *versions;
HBoxContainer *stage_hb = nullptr;
ItemList *versions = nullptr;
Button *stages[RD::SHADER_STAGE_MAX];
RichTextLabel *error_text;
RichTextLabel *error_text = nullptr;
void _update_version(const StringName &p_version_txt, const RenderingDevice::ShaderStage p_stage);
void _version_selected(int p_stage);
@ -74,8 +74,8 @@ public:
class ShaderFileEditorPlugin : public EditorPlugin {
GDCLASS(ShaderFileEditorPlugin, EditorPlugin);
ShaderFileEditor *shader_editor;
Button *button;
ShaderFileEditor *shader_editor = nullptr;
Button *button = nullptr;
public:
virtual String get_name() const override { return "ShaderFile"; }