diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-04 00:25:17 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-04 00:25:17 +0300 |
commit | 2d8606b36071dd14290aa8852451535a49d3096d (patch) | |
tree | 66674726756a859fa1a1e66e9b8eac84387ba2b8 /source/blender/editors/space_node/node_geometry_attribute_search.cc | |
parent | ca0dbf8c26fb637ad06bd170e4e25d200d7ca0f0 (diff) |
Cleanup: Use references in node editor, other improvements
This helps to tell when a pointer is expected to be null, and avoid
overly verbose code when dereferencing. This commit also includes
a few other cleanups in this area:
- Use const in a few places
- Use `float2` instead of `float[2]`
- Remove some unnecessary includes and old code
The change can be continued further in the future.
Diffstat (limited to 'source/blender/editors/space_node/node_geometry_attribute_search.cc')
-rw-r--r-- | source/blender/editors/space_node/node_geometry_attribute_search.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/space_node/node_geometry_attribute_search.cc b/source/blender/editors/space_node/node_geometry_attribute_search.cc index 79ba9b8d2d9..4890c3e39cf 100644 --- a/source/blender/editors/space_node/node_geometry_attribute_search.cc +++ b/source/blender/editors/space_node/node_geometry_attribute_search.cc @@ -100,13 +100,13 @@ static void attribute_search_exec_fn(bContext *C, void *data_v, void *item_v) ED_undo_push(C, "Assign Attribute Name"); } -void node_geometry_add_attribute_search_button(const bContext *UNUSED(C), - const bNodeTree *node_tree, - const bNode *node, - PointerRNA *socket_ptr, - uiLayout *layout) +void node_geometry_add_attribute_search_button(const bContext &UNUSED(C), + const bNodeTree &node_tree, + const bNode &node, + PointerRNA &socket_ptr, + uiLayout &layout) { - uiBlock *block = uiLayoutGetBlock(layout); + uiBlock *block = uiLayoutGetBlock(&layout); uiBut *but = uiDefIconTextButR(block, UI_BTYPE_SEARCH_MENU, 0, @@ -116,7 +116,7 @@ void node_geometry_add_attribute_search_button(const bContext *UNUSED(C), 0, 10 * UI_UNIT_X, /* Dummy value, replaced by layout system. */ UI_UNIT_Y, - socket_ptr, + &socket_ptr, "default_value", 0, 0.0f, @@ -126,7 +126,7 @@ void node_geometry_add_attribute_search_button(const bContext *UNUSED(C), ""); AttributeSearchData *data = OBJECT_GUARDED_NEW( - AttributeSearchData, {node_tree, node, (bNodeSocket *)socket_ptr->data}); + AttributeSearchData, {&node_tree, &node, (bNodeSocket *)socket_ptr.data}); UI_but_func_search_set_results_are_suggestions(but, true); UI_but_func_search_set_sep_string(but, UI_MENU_ARROW_SEP); |