diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_bone.cc b/source/blender/editors/interface/eyedroppers/eyedropper_bone.cc index b9417518413..9eb462b8182 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_bone.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_bone.cc @@ -48,18 +48,18 @@ enum class SampleResult { }; struct BoneDropper { - PointerRNA ptr; - PropertyRNA *prop; - PointerRNA search_ptr; - PropertyRNA *search_prop; + PointerRNA ptr = {}; + PropertyRNA *prop = nullptr; + PointerRNA search_ptr = {}; + PropertyRNA *search_prop = nullptr; - bool is_undo; + bool is_undo = false; - ScrArea *cursor_area; /* Area under the cursor. */ - ARegionType *area_region_type; - void *draw_handle_pixel; - int name_pos[2]; - char name[64]; + ScrArea *cursor_area = nullptr; /* Area under the cursor. */ + ARegionType *area_region_type = nullptr; + void *draw_handle_pixel = nullptr; + int name_pos[2] = {}; + char name[64] = {}; }; struct BoneSampleData { diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_color.cc b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc index 8dc83445e45..c3cc57a149c 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_color.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc @@ -60,28 +60,28 @@ #include "eyedropper_intern.hh" struct Eyedropper { - ColorManagedDisplay *display; + ColorManagedDisplay *display = nullptr; - PointerRNA ptr; - PropertyRNA *prop; - int index; - bool is_undo; + PointerRNA ptr = {}; + PropertyRNA *prop = nullptr; + int index = 0; + bool is_undo = false; - bool is_set; - float init_col[3]; /* for resetting on cancel */ + bool is_set = false; + float init_col[3] = {}; /* for resetting on cancel */ - bool accum_start; /* has mouse been pressed */ - float accum_col[3]; - int accum_tot; + bool accum_start = false; /* has mouse been pressed */ + float accum_col[3] = {}; + int accum_tot = 0; - wmWindow *cb_win; - int cb_win_event_xy[2]; - void *draw_handle_sample_text; - char sample_text[MAX_NAME]; + wmWindow *cb_win = nullptr; + int cb_win_event_xy[2] = {}; + void *draw_handle_sample_text = nullptr; + char sample_text[MAX_NAME] = {}; - bNode *crypto_node; - CryptomatteSession *cryptomatte_session; - ViewportColorSampleSession *viewport_session; + bNode *crypto_node = nullptr; + CryptomatteSession *cryptomatte_session = nullptr; + ViewportColorSampleSession *viewport_session = nullptr; }; static void eyedropper_draw_cb(const wmWindow * /*window*/, void *arg) diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc b/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc index a8604d86f6b..5ab4617568b 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_colorband.cc @@ -41,16 +41,16 @@ namespace blender::ui { struct EyedropperColorband { - int event_xy_last[2]; + int event_xy_last[2] = {}; /* Alpha is currently fixed at 1.0, may support in future. */ - Vector color_buffer; - bool sample_start; - ColorBand init_color_band; - ColorBand *color_band; - PointerRNA ptr; - PropertyRNA *prop; - bool is_undo; - bool is_set; + Vector color_buffer = {}; + bool sample_start = false; + ColorBand init_color_band = {}; + ColorBand *color_band = nullptr; + PointerRNA ptr = {}; + PropertyRNA *prop = nullptr; + bool is_undo = false; + bool is_set = false; }; /* For user-data only. */ @@ -105,7 +105,7 @@ static bool eyedropper_colorband_init(bContext *C, wmOperator *op) return false; } - EyedropperColorband *eye = MEM_new(__func__, EyedropperColorband{}); + EyedropperColorband *eye = MEM_new(__func__); eye->color_band = band; eye->init_color_band = *eye->color_band; eye->ptr = rna_update_ptr; diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc b/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc index b1926fb9106..4de2b48ac86 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc @@ -46,19 +46,19 @@ * \note #DataDropper is only internal name to avoid confusion with other kinds of eye-droppers. */ struct DataDropper { - PointerRNA ptr; - PropertyRNA *prop; - short idcode; - const char *idcode_name; - bool is_undo; + PointerRNA ptr = {}; + PropertyRNA *prop = nullptr; + short idcode = 0; + const char *idcode_name = nullptr; + bool is_undo = false; - ID *init_id; /* for resetting on cancel */ + ID *init_id = nullptr; /* for resetting on cancel */ - ScrArea *cursor_area; /* Area under the cursor */ - ARegionType *art; - void *draw_handle_pixel; - int name_pos[2]; - char name[200]; + ScrArea *cursor_area = nullptr; /* Area under the cursor */ + ARegionType *art = nullptr; + void *draw_handle_pixel = nullptr; + int name_pos[2] = {}; + char name[200] = {}; }; static void datadropper_draw_cb(const bContext * /*C*/, ARegion * /*region*/, void *arg) diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc b/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc index 9a1d12de601..dd365e460c3 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc @@ -49,21 +49,21 @@ * \note #DepthDropper is only internal name to avoid confusion with other kinds of eye-droppers. */ struct DepthDropper { - PointerRNA ptr; - PropertyRNA *prop; - bool is_undo; + PointerRNA ptr = {}; + PropertyRNA *prop = nullptr; + bool is_undo = false; - bool is_set; - float init_depth; /* For resetting on cancel. */ + bool is_set = false; + float init_depth = 0.0f; /* For resetting on cancel. */ - bool accum_start; /* Has mouse been pressed. */ - float accum_depth; - int accum_tot; + bool accum_start = false; /* Has mouse been pressed. */ + float accum_depth = 0.0f; + int accum_tot = 0; - ARegionType *art; - void *draw_handle_pixel; - int name_pos[2]; - char name[200]; + ARegionType *art = nullptr; + void *draw_handle_pixel = nullptr; + int name_pos[2] = {}; + char name[200] = {}; }; static void depthdropper_draw_cb(const bContext * /*C*/, ARegion * /*region*/, void *arg) diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc b/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc index 6ea725ca391..931a8458b48 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc @@ -37,10 +37,10 @@ struct DriverDropper { /* Destination property (i.e. where we'll add a driver) */ - PointerRNA ptr; - PropertyRNA *prop; - int index; - bool is_undo; + PointerRNA ptr = {}; + PropertyRNA *prop = nullptr; + int index = 0; + bool is_undo = false; /* TODO: new target? */ }; diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_grease_pencil_color.cc b/source/blender/editors/interface/eyedroppers/eyedropper_grease_pencil_color.cc index 7864f601f54..93deb10f43f 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_grease_pencil_color.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_grease_pencil_color.cc @@ -61,17 +61,17 @@ enum class MaterialMode : int8_t { }; struct EyedropperGreasePencil { - ColorManagedDisplay *display; + ColorManagedDisplay *display = nullptr; - bool accum_start; /* has mouse been pressed */ - float3 accum_col; - int accum_tot; - float3 color; + bool accum_start = false; /* has mouse been pressed */ + float3 accum_col = {}; + int accum_tot = 0; + float3 color = {}; /** Mode */ - EyeMode mode; + EyeMode mode = EyeMode::Material; /** Material Mode */ - MaterialMode mat_mode; + MaterialMode mat_mode = MaterialMode::Stroke; }; /* Helper: Draw status message while the user is running the operator */