From 4bf5a2f5cb435ba8530f0758fe23ba23f2e39f97 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 25 Nov 2024 18:35:27 +0100 Subject: [PATCH] Cleanup: PointerRNA: Remove 'C-style' zero-initializations. These are useless now that PointerRNA has explicit default values, and become a problem when real constructors are added to this struct. Simply use the default empty value initialization instead. Pull Request: https://projects.blender.org/blender/blender/pulls/130927 --- .../editors/animation/anim_channels_defines.cc | 2 +- .../editors/animation/anim_channels_edit.cc | 2 +- source/blender/editors/animation/drivers.cc | 16 ++++++++-------- source/blender/editors/animation/keyframing.cc | 6 +++--- source/blender/editors/animation/keyingsets.cc | 4 ++-- .../editors/gpencil_legacy/gpencil_data.cc | 4 ++-- .../blender/editors/space_action/action_data.cc | 4 ++-- .../blender/editors/space_action/space_action.cc | 2 +- .../editors/space_buttons/buttons_texture.cc | 2 +- .../blender/editors/space_graph/graph_buttons.cc | 2 +- .../blender/editors/space_graph/space_graph.cc | 2 +- source/blender/editors/space_nla/nla_tracks.cc | 2 +- source/blender/editors/space_nla/space_nla.cc | 2 +- .../editors/space_outliner/outliner_select.cc | 2 +- .../editors/space_sequencer/space_sequencer.cc | 2 +- .../blender/editors/space_view3d/view3d_edit.cc | 2 +- source/blender/editors/transform/transform.cc | 2 +- source/blender/makesrna/intern/rna_access.cc | 2 +- .../makesrna/intern/rna_internal_types.hh | 12 ++++++------ source/blender/makesrna/intern/rna_rna.cc | 6 +++--- source/blender/modifiers/intern/MOD_subsurf.cc | 4 ++-- source/blender/python/intern/bpy_msgbus.cc | 4 ++-- .../windowmanager/intern/wm_event_system.cc | 2 +- .../blender/windowmanager/intern/wm_operators.cc | 2 +- .../message_bus/intern/wm_message_bus_rna.cc | 4 ++-- .../windowmanager/message_bus/wm_message_bus.hh | 14 ++++++++------ 26 files changed, 55 insertions(+), 53 deletions(-) diff --git a/source/blender/editors/animation/anim_channels_defines.cc b/source/blender/editors/animation/anim_channels_defines.cc index 4a27d0ad918..9bacb94c577 100644 --- a/source/blender/editors/animation/anim_channels_defines.cc +++ b/source/blender/editors/animation/anim_channels_defines.cc @@ -5894,7 +5894,7 @@ void ANIM_channel_draw_widgets(const bContext *C, /* step 4) draw text - check if renaming widget is in use... */ if (is_being_renamed) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; /* draw renaming widget if we can get RNA pointer for it diff --git a/source/blender/editors/animation/anim_channels_edit.cc b/source/blender/editors/animation/anim_channels_edit.cc index 24ae18628af..5eee74df684 100644 --- a/source/blender/editors/animation/anim_channels_edit.cc +++ b/source/blender/editors/animation/anim_channels_edit.cc @@ -5558,7 +5558,7 @@ static rctf calculate_selection_fcurve_bounds(bAnimContext *ac, static int view_curve_in_graph_editor_exec(bContext *C, wmOperator *op) { - PointerRNA button_ptr = {nullptr}; + PointerRNA button_ptr = {}; PropertyRNA *button_prop = nullptr; uiBut *but; int index; diff --git a/source/blender/editors/animation/drivers.cc b/source/blender/editors/animation/drivers.cc index 3dfad561719..6c34a528edb 100644 --- a/source/blender/editors/animation/drivers.cc +++ b/source/blender/editors/animation/drivers.cc @@ -866,7 +866,7 @@ static const EnumPropertyItem *driver_mapping_type_itemf(bContext *C, const EnumPropertyItem *input = prop_driver_create_mapping_types; EnumPropertyItem *item = nullptr; - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; int index; @@ -903,7 +903,7 @@ static const EnumPropertyItem *driver_mapping_type_itemf(bContext *C, static bool add_driver_button_poll(bContext *C) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; int index; bool driven, special; @@ -928,7 +928,7 @@ static bool add_driver_button_poll(bContext *C) * (i.e. "manual/add later"). */ static int add_driver_button_none(bContext *C, wmOperator *op, short mapping_type) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; int index; int success = 0; @@ -1024,7 +1024,7 @@ static void UNUSED_FUNCTION(ANIM_OT_driver_button_add_menu)(wmOperatorType *ot) static int add_driver_button_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; int index; @@ -1077,7 +1077,7 @@ void ANIM_OT_driver_button_add(wmOperatorType *ot) static int remove_driver_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; bool changed = false; int index; @@ -1128,7 +1128,7 @@ void ANIM_OT_driver_button_remove(wmOperatorType *ot) static int edit_driver_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; int index; @@ -1161,7 +1161,7 @@ void ANIM_OT_driver_button_edit(wmOperatorType *ot) static int copy_driver_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; bool changed = false; int index; @@ -1200,7 +1200,7 @@ void ANIM_OT_copy_driver_button(wmOperatorType *ot) static int paste_driver_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; bool changed = false; int index; diff --git a/source/blender/editors/animation/keyframing.cc b/source/blender/editors/animation/keyframing.cc index c7257f66a95..4ad1134cf5f 100644 --- a/source/blender/editors/animation/keyframing.cc +++ b/source/blender/editors/animation/keyframing.cc @@ -1038,7 +1038,7 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); ToolSettings *ts = scene->toolsettings; - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; uiBut *but; const AnimationEvalContext anim_eval_context = BKE_animsys_eval_context_construct( @@ -1193,7 +1193,7 @@ void ANIM_OT_keyframe_insert_button(wmOperatorType *ot) static int delete_key_button_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; Main *bmain = CTX_data_main(C); const float cfra = BKE_scene_frame_get(scene); @@ -1299,7 +1299,7 @@ void ANIM_OT_keyframe_delete_button(wmOperatorType *ot) static int clear_key_button_exec(bContext *C, wmOperator *op) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; Main *bmain = CTX_data_main(C); bool changed = false; diff --git a/source/blender/editors/animation/keyingsets.cc b/source/blender/editors/animation/keyingsets.cc index 613b2858313..9c82bff67bc 100644 --- a/source/blender/editors/animation/keyingsets.cc +++ b/source/blender/editors/animation/keyingsets.cc @@ -267,7 +267,7 @@ void ANIM_OT_keying_set_path_remove(wmOperatorType *ot) static int add_keyingset_button_exec(bContext *C, wmOperator *op) { PropertyRNA *prop = nullptr; - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; int index = 0, pflag = 0; if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { @@ -360,7 +360,7 @@ void ANIM_OT_keyingset_button_add(wmOperatorType *ot) static int remove_keyingset_button_exec(bContext *C, wmOperator *op) { PropertyRNA *prop = nullptr; - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; int index = 0; if (!UI_context_active_but_prop_get(C, &ptr, &prop, &index)) { diff --git a/source/blender/editors/gpencil_legacy/gpencil_data.cc b/source/blender/editors/gpencil_legacy/gpencil_data.cc index ae350225c5d..b915b5f166c 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_data.cc +++ b/source/blender/editors/gpencil_legacy/gpencil_data.cc @@ -82,7 +82,7 @@ static bool gpencil_data_add_poll(bContext *C) /* add new datablock - wrapper around API */ static int gpencil_data_add_exec(bContext *C, wmOperator *op) { - PointerRNA gpd_owner = {nullptr}; + PointerRNA gpd_owner = {}; bGPdata **gpd_ptr = ED_annotation_data_get_pointers(C, &gpd_owner); if (gpd_ptr == nullptr) { @@ -193,7 +193,7 @@ static int gpencil_layer_add_exec(bContext *C, wmOperator *op) { const bool is_annotation = STREQ(op->idname, "GPENCIL_OT_layer_annotation_add"); - PointerRNA gpd_owner = {nullptr}; + PointerRNA gpd_owner = {}; Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); bGPdata *gpd = nullptr; diff --git a/source/blender/editors/space_action/action_data.cc b/source/blender/editors/space_action/action_data.cc index 3eeae5ca262..2cb1a793b9a 100644 --- a/source/blender/editors/space_action/action_data.cc +++ b/source/blender/editors/space_action/action_data.cc @@ -54,7 +54,7 @@ AnimData *ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owner) { { /* Support use from the layout.template_action() UI template. */ - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; UI_context_active_but_prop_get_templateID(C, &ptr, &prop); /* template_action() sets a RNA_AnimData pointer, whereas other code may set @@ -184,7 +184,7 @@ static void actedit_change_action(bContext *C, bAction *act) static bool action_new_poll(bContext *C) { { /* Support use from the layout.template_action() UI template. */ - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; UI_context_active_but_prop_get_templateID(C, &ptr, &prop); if (prop) { diff --git a/source/blender/editors/space_action/space_action.cc b/source/blender/editors/space_action/space_action.cc index 7ce94d88554..b9beaf3b07c 100644 --- a/source/blender/editors/space_action/space_action.cc +++ b/source/blender/editors/space_action/space_action.cc @@ -415,7 +415,7 @@ static void saction_channel_region_message_subscribe(const wmRegionMessageSubscr * so just whitelist the entire structs for updates */ { - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; StructRNA *type_array[] = { &RNA_DopeSheet, /* dopesheet filters */ diff --git a/source/blender/editors/space_buttons/buttons_texture.cc b/source/blender/editors/space_buttons/buttons_texture.cc index d1f58b9092e..3bbe24266c2 100644 --- a/source/blender/editors/space_buttons/buttons_texture.cc +++ b/source/blender/editors/space_buttons/buttons_texture.cc @@ -151,7 +151,7 @@ static void buttons_texture_users_find_nodetree(ListBase *users, id, ntree, node, - {nullptr}, + {}, nullptr, category, RNA_struct_ui_icon(ptr.type), diff --git a/source/blender/editors/space_graph/graph_buttons.cc b/source/blender/editors/space_graph/graph_buttons.cc index d0ab724b2f1..db96b76845f 100644 --- a/source/blender/editors/space_graph/graph_buttons.cc +++ b/source/blender/editors/space_graph/graph_buttons.cc @@ -1335,7 +1335,7 @@ static void graph_panel_drivers_popover(const bContext *C, Panel *panel) { uiLayout *layout = panel->layout; - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; PropertyRNA *prop = nullptr; int index = -1; uiBut *but = nullptr; diff --git a/source/blender/editors/space_graph/space_graph.cc b/source/blender/editors/space_graph/space_graph.cc index 9eb319c6a14..89ba5697ab5 100644 --- a/source/blender/editors/space_graph/space_graph.cc +++ b/source/blender/editors/space_graph/space_graph.cc @@ -539,7 +539,7 @@ static void graph_region_message_subscribe(const wmRegionMessageSubscribeParams * so just whitelist the entire structs for updates */ { - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; StructRNA *type_array[] = { &RNA_DopeSheet, /* dopesheet filters */ diff --git a/source/blender/editors/space_nla/nla_tracks.cc b/source/blender/editors/space_nla/nla_tracks.cc index bf4c6ec388a..4bb06c87006 100644 --- a/source/blender/editors/space_nla/nla_tracks.cc +++ b/source/blender/editors/space_nla/nla_tracks.cc @@ -373,7 +373,7 @@ static int nlatracks_pushdown_exec(bContext *C, wmOperator *op) /* get anim-channel to use (or more specifically, the animdata block behind it) */ if (track_index == -1) { - PointerRNA adt_ptr = {nullptr}; + PointerRNA adt_ptr = {}; /* active animdata block */ if (nla_panel_context(C, &adt_ptr, nullptr, nullptr) == 0 || (adt_ptr.data == nullptr)) { diff --git a/source/blender/editors/space_nla/space_nla.cc b/source/blender/editors/space_nla/space_nla.cc index b20b5b7a2ff..cd6d84e7685 100644 --- a/source/blender/editors/space_nla/space_nla.cc +++ b/source/blender/editors/space_nla/space_nla.cc @@ -510,7 +510,7 @@ static void nla_track_region_message_subscribe(const wmRegionMessageSubscribePar * so just whitelist the entire struct for updates */ { - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; StructRNA *type_array[] = { &RNA_DopeSheet, }; diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index 0976a20c20e..80e2237bca3 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -1250,7 +1250,7 @@ static void outliner_sync_to_properties_editors(const bContext *C, static void outliner_set_properties_tab(bContext *C, TreeElement *te, TreeStoreElem *tselem) { - PointerRNA ptr = {nullptr}; + PointerRNA ptr = {}; int context = 0; /* ID Types */ diff --git a/source/blender/editors/space_sequencer/space_sequencer.cc b/source/blender/editors/space_sequencer/space_sequencer.cc index 4c24f95b7d0..41ddd174ad1 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.cc +++ b/source/blender/editors/space_sequencer/space_sequencer.cc @@ -631,7 +631,7 @@ static void sequencer_main_region_message_subscribe(const wmRegionMessageSubscri &RNA_SequenceModifier, &RNA_SequenceColorBalanceData, }; - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; for (int i = 0; i < ARRAY_SIZE(type_array); i++) { msg_key_params.ptr.type = type_array[i]; WM_msg_subscribe_rna_params( diff --git a/source/blender/editors/space_view3d/view3d_edit.cc b/source/blender/editors/space_view3d/view3d_edit.cc index 0d7fff6cf84..48e4324e5f7 100644 --- a/source/blender/editors/space_view3d/view3d_edit.cc +++ b/source/blender/editors/space_view3d/view3d_edit.cc @@ -1054,7 +1054,7 @@ void ED_view3d_cursor3d_update(bContext *C, { wmMsgBus *mbus = CTX_wm_message_bus(C); - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; msg_key_params.ptr = RNA_pointer_create(&scene->id, &RNA_View3DCursor, &scene->cursor); WM_msg_publish_rna_params(mbus, &msg_key_params); } diff --git a/source/blender/editors/transform/transform.cc b/source/blender/editors/transform/transform.cc index 6496b6c2afc..58a7516c012 100644 --- a/source/blender/editors/transform/transform.cc +++ b/source/blender/editors/transform/transform.cc @@ -1727,7 +1727,7 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) /* Type is #eSnapFlag, but type must match various snap attributes in #ToolSettings. */ short *snap_flag_ptr; - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; msg_key_params.ptr = RNA_pointer_create(&t->scene->id, &RNA_ToolSettings, ts); if ((snap_flag_ptr = transform_snap_flag_from_spacetype_ptr(t, &msg_key_params.prop)) && (is_snap_enabled != bool(*snap_flag_ptr & SCE_SNAP))) diff --git a/source/blender/makesrna/intern/rna_access.cc b/source/blender/makesrna/intern/rna_access.cc index 0916dc0d0bd..b5b9c57bd70 100644 --- a/source/blender/makesrna/intern/rna_access.cc +++ b/source/blender/makesrna/intern/rna_access.cc @@ -151,7 +151,7 @@ PointerRNA RNA_id_pointer_create(ID *id) StructRNA *type, *idtype = nullptr; if (id) { - PointerRNA tmp = {nullptr}; + PointerRNA tmp = {}; tmp.data = id; idtype = rna_ID_refine(&tmp); diff --git a/source/blender/makesrna/intern/rna_internal_types.hh b/source/blender/makesrna/intern/rna_internal_types.hh index 369becf150d..556981b988e 100644 --- a/source/blender/makesrna/intern/rna_internal_types.hh +++ b/source/blender/makesrna/intern/rna_internal_types.hh @@ -261,9 +261,9 @@ struct RNAPropertyOverrideApplyContext { bool do_insert = false; /** Main RNA data and property pointers. */ - PointerRNA ptr_dst = {0}; - PointerRNA ptr_src = {0}; - PointerRNA ptr_storage = {0}; + PointerRNA ptr_dst = {}; + PointerRNA ptr_src = {}; + PointerRNA ptr_storage = {}; PropertyRNA *prop_dst = nullptr; PropertyRNA *prop_src = nullptr; PropertyRNA *prop_storage = nullptr; @@ -274,9 +274,9 @@ struct RNAPropertyOverrideApplyContext { int len_storage = 0; /** Items, for RNA collections. */ - PointerRNA ptr_item_dst = {0}; - PointerRNA ptr_item_src = {0}; - PointerRNA ptr_item_storage = {0}; + PointerRNA ptr_item_dst = {}; + PointerRNA ptr_item_src = {}; + PointerRNA ptr_item_storage = {}; /** LibOverride data. */ IDOverrideLibrary *liboverride = nullptr; diff --git a/source/blender/makesrna/intern/rna_rna.cc b/source/blender/makesrna/intern/rna_rna.cc index 028fa5539b9..93c105d1f1b 100644 --- a/source/blender/makesrna/intern/rna_rna.cc +++ b/source/blender/makesrna/intern/rna_rna.cc @@ -557,7 +557,7 @@ bool rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key, Poin { StructRNA *srna; PropertyRNA *prop; - PointerRNA propptr = {nullptr}; + PointerRNA propptr = {}; srna = ptr->type; @@ -1293,8 +1293,8 @@ struct RNACompareOverrideDiffPropPtrContext { /** RNA pointer specific diffing parameters. */ ID *owner_id_a = nullptr; ID *owner_id_b = nullptr; - PointerRNA propptr_a = {0}; - PointerRNA propptr_b = {0}; + PointerRNA propptr_a = {}; + PointerRNA propptr_b = {}; PropertyType property_type = PROP_BOOLEAN; /** diff --git a/source/blender/modifiers/intern/MOD_subsurf.cc b/source/blender/modifiers/intern/MOD_subsurf.cc index 87854ee3f64..b4128de42b5 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.cc +++ b/source/blender/modifiers/intern/MOD_subsurf.cc @@ -345,8 +345,8 @@ static void panel_draw(const bContext *C, Panel *panel) /* Only test for adaptive subdivision if built with cycles. */ bool show_adaptive_options = false; bool ob_use_adaptive_subdivision = false; - PointerRNA cycles_ptr = {nullptr}; - PointerRNA ob_cycles_ptr = {nullptr}; + PointerRNA cycles_ptr = {}; + PointerRNA ob_cycles_ptr = {}; #ifdef WITH_CYCLES Scene *scene = CTX_data_scene(C); PointerRNA scene_ptr = RNA_id_pointer_create(&scene->id); diff --git a/source/blender/python/intern/bpy_msgbus.cc b/source/blender/python/intern/bpy_msgbus.cc index 68b375b52c5..e48354d178b 100644 --- a/source/blender/python/intern/bpy_msgbus.cc +++ b/source/blender/python/intern/bpy_msgbus.cc @@ -276,7 +276,7 @@ static PyObject *bpy_msgbus_subscribe_rna(PyObject * /*self*/, PyObject *args, P /* NOTE: we may want to have a way to pass this in. */ bContext *C = BPY_context_get(); wmMsgBus *mbus = CTX_wm_message_bus(C); - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; wmMsgSubscribeValue msg_val_params = {nullptr}; @@ -358,7 +358,7 @@ static PyObject *bpy_msgbus_publish_rna(PyObject * /*self*/, PyObject *args, PyO /* NOTE: we may want to have a way to pass this in. */ bContext *C = BPY_context_get(); wmMsgBus *mbus = CTX_wm_message_bus(C); - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; if (py_msgbus_rna_key_from_py(py_sub, &msg_key_params, error_prefix) == -1) { return nullptr; diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index 2621139f30d..c07766f17f4 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -2656,7 +2656,7 @@ static eHandlerActionFlag wm_handler_operator_call(bContext *C, if (ot && wm_operator_check_locked_interface(C, ot)) { bool use_last_properties = true; - PointerRNA tool_properties = {nullptr}; + PointerRNA tool_properties = {}; bToolRef *keymap_tool = nullptr; if (handler_base->type == WM_HANDLER_TYPE_KEYMAP) { diff --git a/source/blender/windowmanager/intern/wm_operators.cc b/source/blender/windowmanager/intern/wm_operators.cc index fd8ed4539e9..92d682a97b8 100644 --- a/source/blender/windowmanager/intern/wm_operators.cc +++ b/source/blender/windowmanager/intern/wm_operators.cc @@ -384,7 +384,7 @@ static const char *wm_context_member_from_ptr(bContext *C, const PointerRNA *ptr for (link = lb.first; link; link = link->next) { const char *identifier = link->data; - PointerRNA ctx_item_ptr = {{0}}; + PointerRNA ctx_item_ptr = {}; // CTX_data_pointer_get(C, identifier); /* XXX, this isn't working. */ if (ctx_item_ptr.type == nullptr) { diff --git a/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.cc b/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.cc index 64a814da979..44032a03973 100644 --- a/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.cc +++ b/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.cc @@ -350,14 +350,14 @@ void WM_msg_subscribe_ID(wmMsgBus *mbus, const wmMsgSubscribeValue *msg_val_params, const char *id_repr) { - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; msg_key_params.ptr = RNA_id_pointer_create(id); WM_msg_subscribe_rna_params(mbus, &msg_key_params, msg_val_params, id_repr); } void WM_msg_publish_ID(wmMsgBus *mbus, ID *id) { - wmMsgParams_RNA msg_key_params = {{nullptr}}; + wmMsgParams_RNA msg_key_params = {{}}; msg_key_params.ptr = RNA_id_pointer_create(id); WM_msg_publish_rna_params(mbus, &msg_key_params); } diff --git a/source/blender/windowmanager/message_bus/wm_message_bus.hh b/source/blender/windowmanager/message_bus/wm_message_bus.hh index c7e33203185..6a60cd106c8 100644 --- a/source/blender/windowmanager/message_bus/wm_message_bus.hh +++ b/source/blender/windowmanager/message_bus/wm_message_bus.hh @@ -216,7 +216,7 @@ void WM_msg_publish_ID(wmMsgBus *mbus, ID *id); #define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_) \ { \ - wmMsgParams_RNA msg_key_params_ = {{0}}; \ + wmMsgParams_RNA msg_key_params_ = {{}}; \ msg_key_params_.ptr = RNA_pointer_create(id_, &RNA_##type_, data_); \ msg_key_params_.prop = &rna_##type_##_##prop_; \ WM_msg_publish_rna_params(mbus, &msg_key_params_); \ @@ -224,7 +224,7 @@ void WM_msg_publish_ID(wmMsgBus *mbus, ID *id); ((void)0) #define WM_msg_subscribe_rna_prop(mbus, id_, data_, type_, prop_, value) \ { \ - wmMsgParams_RNA msg_key_params_ = {{0}}; \ + wmMsgParams_RNA msg_key_params_ = {{}}; \ msg_key_params_.ptr = RNA_pointer_create(id_, &RNA_##type_, data_); \ msg_key_params_.prop = &rna_##type_##_##prop_; \ WM_msg_subscribe_rna_params(mbus, &msg_key_params_, value, __func__); \ @@ -234,8 +234,9 @@ void WM_msg_publish_ID(wmMsgBus *mbus, ID *id); /* Anonymous variants (for convenience). */ #define WM_msg_subscribe_rna_anon_type(mbus, type_, value) \ { \ - PointerRNA msg_ptr_ = {0, &RNA_##type_}; \ - wmMsgParams_RNA msg_key_params_ = {{0}}; \ + PointerRNA msg_ptr_ = {}; \ + msg_ptr_.type = &RNA_##type_; \ + wmMsgParams_RNA msg_key_params_ = {{}}; \ msg_key_params_.ptr = msg_ptr_; \ \ WM_msg_subscribe_rna_params(mbus, &msg_key_params_, value, __func__); \ @@ -243,8 +244,9 @@ void WM_msg_publish_ID(wmMsgBus *mbus, ID *id); ((void)0) #define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value) \ { \ - PointerRNA msg_ptr_ = {0, &RNA_##type_}; \ - wmMsgParams_RNA msg_key_params_ = {{0}}; \ + PointerRNA msg_ptr_ = {}; \ + msg_ptr_.type = &RNA_##type_; \ + wmMsgParams_RNA msg_key_params_ = {{}}; \ msg_key_params_.ptr = msg_ptr_; \ msg_key_params_.prop = &rna_##type_##_##prop_; \ \