[Bf-blender-cvs] [3531021d1b8] master: Cleanup: Simplify declarations in C++ header

Hans Goudey noreply at git.blender.org
Thu Nov 18 17:46:52 CET 2021


Commit: 3531021d1b8fe271b210f6b28d5058b8894da64a
Author: Hans Goudey
Date:   Thu Nov 18 11:46:44 2021 -0500
Branches: master
https://developer.blender.org/rB3531021d1b8fe271b210f6b28d5058b8894da64a

Cleanup: Simplify declarations in C++ header

Using `struct` everywhere is unnecessary in C++, and the typedefs
are also unnecessary.

===================================================================

M	source/blender/editors/space_node/node_intern.hh

===================================================================

diff --git a/source/blender/editors/space_node/node_intern.hh b/source/blender/editors/space_node/node_intern.hh
index 09c93c7935e..436df70429b 100644
--- a/source/blender/editors/space_node/node_intern.hh
+++ b/source/blender/editors/space_node/node_intern.hh
@@ -48,7 +48,7 @@ struct wmKeyConfig;
 struct wmWindow;
 
 /* temp data to pass on to modal */
-typedef struct bNodeLinkDrag {
+struct bNodeLinkDrag {
   struct bNodeLinkDrag *next, *prev;
 
   /* List of links dragged by the operator.
@@ -68,9 +68,9 @@ typedef struct bNodeLinkDrag {
 
   /* Data for edge panning */
   View2DEdgePanData pan_data;
-} bNodeLinkDrag;
+};
 
-typedef struct SpaceNode_Runtime {
+struct SpaceNode_Runtime {
   float aspect;
 
   /** Mouse position for drawing socket-less links and adding nodes. */
@@ -85,12 +85,12 @@ typedef struct SpaceNode_Runtime {
   /* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */
   /** Temporary data for node insert offset (in UI called Auto-offset). */
   struct NodeInsertOfsData *iofsd;
-} SpaceNode_Runtime;
+};
 
 /* space_node.c */
 
 /* transform between View2Ds in the tree path */
-void space_node_group_offset(struct SpaceNode *snode, float *x, float *y);
+void space_node_group_offset(SpaceNode *snode, float *x, float *y);
 
 /* node_draw.cc */
 float node_socket_calculate_height(const bNodeSocket *socket);
@@ -100,229 +100,219 @@ void node_link_calculate_multi_input_position(const float socket_x,
                                               const int total_inputs,
                                               float r[2]);
 
-int node_get_colorid(struct bNode *node);
+int node_get_colorid(bNode *node);
 int node_get_resize_cursor(int directions);
-void node_draw_shadow(const struct SpaceNode *snode,
-                      const struct bNode *node,
-                      float radius,
-                      float alpha);
-void node_draw_default(const struct bContext *C,
-                       struct ARegion *region,
-                       struct SpaceNode *snode,
-                       struct bNodeTree *ntree,
-                       struct bNode *node,
+void node_draw_shadow(const SpaceNode *snode, const bNode *node, float radius, float alpha);
+void node_draw_default(const bContext *C,
+                       ARegion *region,
+                       SpaceNode *snode,
+                       bNodeTree *ntree,
+                       bNode *node,
                        bNodeInstanceKey key);
-void node_draw_sockets(const struct View2D *v2d,
-                       const struct bContext *C,
-                       struct bNodeTree *ntree,
-                       struct bNode *node,
+void node_draw_sockets(const View2D *v2d,
+                       const bContext *C,
+                       bNodeTree *ntree,
+                       bNode *node,
                        bool draw_outputs,
                        bool select_all);
-void node_update_default(const struct bContext *C, struct bNodeTree *ntree, struct bNode *node);
-int node_select_area_default(struct bNode *node, int x, int y);
-int node_tweak_area_default(struct bNode *node, int x, int y);
-void node_socket_color_get(const struct bContext *C,
-                           struct bNodeTree *ntree,
-                           struct PointerRNA *node_ptr,
-                           struct bNodeSocket *sock,
+void node_update_default(const bContext *C, bNodeTree *ntree, bNode *node);
+int node_select_area_default(bNode *node, int x, int y);
+int node_tweak_area_default(bNode *node, int x, int y);
+void node_socket_color_get(const bContext *C,
+                           bNodeTree *ntree,
+                           PointerRNA *node_ptr,
+                           bNodeSocket *sock,
                            float r_color[4]);
-void node_update_nodetree(const struct bContext *C, struct bNodeTree *ntree);
-void node_draw_nodetree(const struct bContext *C,
-                        struct ARegion *region,
-                        struct SpaceNode *snode,
-                        struct bNodeTree *ntree,
+void node_update_nodetree(const bContext *C, bNodeTree *ntree);
+void node_draw_nodetree(const bContext *C,
+                        ARegion *region,
+                        SpaceNode *snode,
+                        bNodeTree *ntree,
                         bNodeInstanceKey parent_key);
 void node_draw_space(const bContext *C, ARegion *region);
 
-void node_set_cursor(struct wmWindow *win, struct SpaceNode *snode, float cursor[2]);
+void node_set_cursor(wmWindow *win, SpaceNode *snode, float cursor[2]);
 /* DPI scaled coords */
-void node_to_view(const struct bNode *node, float x, float y, float *rx, float *ry);
-void node_to_updated_rect(const struct bNode *node, rctf *r_rect);
-void node_from_view(const struct bNode *node, float x, float y, float *rx, float *ry);
+void node_to_view(const bNode *node, float x, float y, float *rx, float *ry);
+void node_to_updated_rect(const bNode *node, rctf *r_rect);
+void node_from_view(const bNode *node, float x, float y, float *rx, float *ry);
 
 /* node_toolbar.c */
-void node_toolbar_register(struct ARegionType *art);
+void node_toolbar_register(ARegionType *art);
 
 /* node_ops.c */
 void node_operatortypes(void);
-void node_keymap(struct wmKeyConfig *keyconf);
+void node_keymap(wmKeyConfig *keyconf);
 
 /* node_select.c */
-void node_deselect_all(struct SpaceNode *snode);
-void node_socket_select(struct bNode *node, struct bNodeSocket *sock);
-void node_socket_deselect(struct bNode *node, struct bNodeSocket *sock, const bool deselect_node);
-void node_deselect_all_input_sockets(struct SpaceNode *snode, const bool deselect_nodes);
-void node_deselect_all_output_sockets(struct SpaceNode *snode, const bool deselect_nodes);
-void node_select_single(struct bContext *C, struct bNode *node);
-
-void NODE_OT_select(struct wmOperatorType *ot);
-void NODE_OT_select_all(struct wmOperatorType *ot);
-void NODE_OT_select_linked_to(struct wmOperatorType *ot);
-void NODE_OT_select_linked_from(struct wmOperatorType *ot);
-void NODE_OT_select_box(struct wmOperatorType *ot);
-void NODE_OT_select_circle(struct wmOperatorType *ot);
-void NODE_OT_select_lasso(struct wmOperatorType *ot);
-void NODE_OT_select_grouped(struct wmOperatorType *ot);
-void NODE_OT_select_same_type_step(struct wmOperatorType *ot);
-void NODE_OT_find_node(struct wmOperatorType *ot);
+void node_deselect_all(SpaceNode *snode);
+void node_socket_select(bNode *node, bNodeSocket *sock);
+void node_socket_deselect(bNode *node, bNodeSocket *sock, const bool deselect_node);
+void node_deselect_all_input_sockets(SpaceNode *snode, const bool deselect_nodes);
+void node_deselect_all_output_sockets(SpaceNode *snode, const bool deselect_nodes);
+void node_select_single(bContext *C, bNode *node);
+
+void NODE_OT_select(wmOperatorType *ot);
+void NODE_OT_select_all(wmOperatorType *ot);
+void NODE_OT_select_linked_to(wmOperatorType *ot);
+void NODE_OT_select_linked_from(wmOperatorType *ot);
+void NODE_OT_select_box(wmOperatorType *ot);
+void NODE_OT_select_circle(wmOperatorType *ot);
+void NODE_OT_select_lasso(wmOperatorType *ot);
+void NODE_OT_select_grouped(wmOperatorType *ot);
+void NODE_OT_select_same_type_step(wmOperatorType *ot);
+void NODE_OT_find_node(wmOperatorType *ot);
 
 /* node_view.c */
-int space_node_view_flag(struct bContext *C,
-                         struct SpaceNode *snode,
-                         ARegion *region,
-                         const int node_flag,
-                         const int smooth_viewtx);
+int space_node_view_flag(
+    bContext *C, SpaceNode *snode, ARegion *region, const int node_flag, const int smooth_viewtx);
 
-void NODE_OT_view_all(struct wmOperatorType *ot);
-void NODE_OT_view_selected(struct wmOperatorType *ot);
-void NODE_OT_geometry_node_view_legacy(struct wmOperatorType *ot);
+void NODE_OT_view_all(wmOperatorType *ot);
+void NODE_OT_view_selected(wmOperatorType *ot);
+void NODE_OT_geometry_node_view_legacy(wmOperatorType *ot);
 
-void NODE_OT_backimage_move(struct wmOperatorType *ot);
-void NODE_OT_backimage_zoom(struct wmOperatorType *ot);
-void NODE_OT_backimage_fit(struct wmOperatorType *ot);
-void NODE_OT_backimage_sample(struct wmOperatorType *ot);
+void NODE_OT_backimage_move(wmOperatorType *ot);
+void NODE_OT_backimage_zoom(wmOperatorType *ot);
+void NODE_OT_backimage_fit(wmOperatorType *ot);
+void NODE_OT_backimage_sample(wmOperatorType *ot);
 
 /* drawnode.c */
-void nodelink_batch_start(struct SpaceNode *snode);
-void nodelink_batch_end(struct SpaceNode *snode);
-
-void node_draw_link(const struct bContext *C,
-                    const struct View2D *v2d,
-                    const struct SpaceNode *snode,
-                    const struct bNodeLink *link);
-void node_draw_link_bezier(const struct bContext *C,
-                           const struct View2D *v2d,
-                           const struct SpaceNode *snode,
-                           const struct bNodeLink *link,
+void nodelink_batch_start(SpaceNode *snode);
+void nodelink_batch_end(SpaceNode *snode);
+
+void node_draw_link(const bContext *C,
+                    const View2D *v2d,
+                    const SpaceNode *snode,
+                    const bNodeLink *link);
+void node_draw_link_bezier(const bContext *C,
+                           const View2D *v2d,
+                           const SpaceNode *snode,
+                           const bNodeLink *link,
                            int th_col1,
                            int th_col2,
                            int th_col3);
-bool node_link_bezier_points(const struct View2D *v2d,
-                             const struct SpaceNode *snode,
-                             const struct bNodeLink *link,
+bool node_link_bezier_points(const View2D *v2d,
+                             const SpaceNode *snode,
+                             const bNodeLink *link,
                              float coord_array[][2],
                              const int resol);
-bool node_link_bezier_handles(const struct View2D *v2d,
-                              const struct SpaceNode *snode,
-                              const struct bNodeLink *link,
+bool node_link_bezier_han

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list