Cleanup: Remove unnecessary struct keyword usage in node editor

This commit is contained in:
Hans Goudey 2022-09-02 14:21:35 -05:00
parent 0fb699b212
commit 4068880ffc
9 changed files with 23 additions and 27 deletions

View File

@ -124,8 +124,8 @@ static bool add_reroute_intersect_check(const bNodeLink &link,
struct bNodeSocketLink {
struct bNodeSocketLink *next, *prev;
struct bNodeSocket *sock;
struct bNodeLink *link;
bNodeSocket *sock;
bNodeLink *link;
float2 point;
};

View File

@ -1308,7 +1308,7 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv)
}
/* Common handle function for operator buttons that need to select the node first. */
static void node_toggle_button_cb(struct bContext *C, void *node_argv, void *op_argv)
static void node_toggle_button_cb(bContext *C, void *node_argv, void *op_argv)
{
bNode *node = (bNode *)node_argv;
const char *opname = (const char *)op_argv;
@ -2768,7 +2768,7 @@ static void frame_node_draw_label(const bNodeTree &ntree,
BLF_wordwrap(fontid, line_width);
LISTBASE_FOREACH (const TextLine *, line, &text->lines) {
struct ResultBLF info;
ResultBLF info;
if (line->line[0]) {
BLF_position(fontid, x, y, 0);
BLF_draw_ex(fontid, line->line, line->len, &info);

View File

@ -320,7 +320,7 @@ static void compo_completejob(void *cjv)
/** \name Composite Job C API
* \{ */
void ED_node_composite_job(const bContext *C, struct bNodeTree *nodetree, Scene *scene_owner)
void ED_node_composite_job(const bContext *C, bNodeTree *nodetree, Scene *scene_owner)
{
using namespace blender::ed::space_node;
@ -464,22 +464,22 @@ void ED_node_set_tree_type(SpaceNode *snode, bNodeTreeType *typeinfo)
}
}
bool ED_node_is_compositor(struct SpaceNode *snode)
bool ED_node_is_compositor(SpaceNode *snode)
{
return STREQ(snode->tree_idname, ntreeType_Composite->idname);
}
bool ED_node_is_shader(struct SpaceNode *snode)
bool ED_node_is_shader(SpaceNode *snode)
{
return STREQ(snode->tree_idname, ntreeType_Shader->idname);
}
bool ED_node_is_texture(struct SpaceNode *snode)
bool ED_node_is_texture(SpaceNode *snode)
{
return STREQ(snode->tree_idname, ntreeType_Texture->idname);
}
bool ED_node_is_geometry(struct SpaceNode *snode)
bool ED_node_is_geometry(SpaceNode *snode)
{
return STREQ(snode->tree_idname, ntreeType_Geometry->idname);
}
@ -550,7 +550,7 @@ void ED_node_shader_default(const bContext *C, ID *id)
}
}
void ED_node_composit_default(const bContext *C, struct Scene *sce)
void ED_node_composit_default(const bContext *C, Scene *sce)
{
/* but lets check it anyway */
if (sce->nodetree) {

View File

@ -318,9 +318,7 @@ static bool WIDGETGROUP_node_crop_poll(const bContext *C, wmGizmoGroupType *UNUS
static void WIDGETGROUP_node_crop_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
{
struct NodeCropWidgetGroup *crop_group = (NodeCropWidgetGroup *)MEM_mallocN(
sizeof(struct NodeCropWidgetGroup), __func__);
NodeCropWidgetGroup *crop_group = MEM_new<NodeCropWidgetGroup>(__func__);
crop_group->border = WM_gizmo_new("GIZMO_GT_cage_2d", gzgroup, nullptr);
RNA_enum_set(crop_group->border->ptr,

View File

@ -653,7 +653,7 @@ static bool node_group_make_use_node(bNode &node, bNode *gnode)
static bool node_group_make_test_selected(bNodeTree &ntree,
bNode *gnode,
const char *ntree_idname,
struct ReportList &reports)
ReportList &reports)
{
int ok = true;

View File

@ -111,7 +111,7 @@ void node_operatortypes()
WM_operatortype_append(NODE_OT_cryptomatte_layer_remove);
}
void node_keymap(struct wmKeyConfig *keyconf)
void node_keymap( wmKeyConfig *keyconf)
{
/* Entire Editor only ----------------- */
WM_keymap_ensure(keyconf, "Node Generic", SPACE_NODE, 0);

View File

@ -515,7 +515,7 @@ void node_select_single(bContext &C, bNode &node)
static bool node_mouse_select(bContext *C,
wmOperator *op,
const int2 mval,
struct SelectPick_Params *params)
SelectPick_Params *params)
{
Main &bmain = *CTX_data_main(C);
SpaceNode &snode = *CTX_wm_space_node(C);
@ -670,7 +670,7 @@ static int node_select_exec(bContext *C, wmOperator *op)
int2 mval;
RNA_int_get_array(op->ptr, "location", mval);
struct SelectPick_Params params = {};
SelectPick_Params params = {};
ED_select_pick_params_from_operator(op->ptr, &params);
/* perform the select */
@ -1298,7 +1298,7 @@ static void node_find_create_label(const bNode *node, char *str, int maxlen)
}
/* Generic search invoke. */
static void node_find_update_fn(const struct bContext *C,
static void node_find_update_fn(const bContext *C,
void *UNUSED(arg),
const char *str,
uiSearchItems *items,
@ -1330,7 +1330,7 @@ static void node_find_update_fn(const struct bContext *C,
BLI_string_search_free(search);
}
static void node_find_exec_fn(struct bContext *C, void *UNUSED(arg1), void *arg2)
static void node_find_exec_fn(bContext *C, void *UNUSED(arg1), void *arg2)
{
SpaceNode *snode = CTX_wm_space_node(C);
bNode *active = (bNode *)arg2;

View File

@ -252,7 +252,7 @@ static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *
return OPERATOR_CANCELLED;
}
nvm = MEM_cnew<NodeViewMove>("NodeViewMove struct");
nvm = MEM_cnew<NodeViewMove>(__func__);
op->customdata = nvm;
nvm->mvalo.x = event->mval[0];
nvm->mvalo.y = event->mval[1];
@ -447,7 +447,7 @@ static void sample_draw(const bContext *C, ARegion *region, void *arg_info)
} // namespace blender::ed::space_node
bool ED_space_node_get_position(
Main *bmain, SpaceNode *snode, struct ARegion *region, const int mval[2], float fpos[2])
Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float fpos[2])
{
if (!ED_node_is_compositor(snode) || (snode->flag & SNODE_BACKDRAW) == 0) {
return false;

View File

@ -302,7 +302,7 @@ static void node_free(SpaceLink *sl)
}
/* spacetype; init callback */
static void node_init(struct wmWindowManager *UNUSED(wm), ScrArea *area)
static void node_init(wmWindowManager *UNUSED(wm), ScrArea *area)
{
SpaceNode *snode = (SpaceNode *)area->spacedata.first;
@ -511,7 +511,7 @@ static void node_area_listener(const wmSpaceTypeListenerParams *params)
}
}
static void node_area_refresh(const struct bContext *C, ScrArea *area)
static void node_area_refresh(const bContext *C, ScrArea *area)
{
/* default now: refresh node is starting preview */
SpaceNode *snode = (SpaceNode *)area->spacedata.first;
@ -526,7 +526,7 @@ static void node_area_refresh(const struct bContext *C, ScrArea *area)
if (snode->runtime->recalc_auto_compositing) {
snode->runtime->recalc_auto_compositing = false;
snode->runtime->recalc_regular_compositing = false;
node_render_changed_exec((struct bContext *)C, nullptr);
node_render_changed_exec((bContext *)C, nullptr);
}
else if (snode->runtime->recalc_regular_compositing) {
snode->runtime->recalc_regular_compositing = false;
@ -973,9 +973,7 @@ static void node_id_remap_cb(ID *old_id, ID *new_id, void *user_data)
}
}
static void node_id_remap(ScrArea *UNUSED(area),
SpaceLink *slink,
const struct IDRemapper *mappings)
static void node_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, const IDRemapper *mappings)
{
/* Although we should be able to perform all the mappings in a single go this lead to issues when
* running the python test cases. Somehow the nodetree/edittree weren't updated to the new