Commit: 9675c3d95f8c31f39bccb608cdf854289fc201c5
Author: Jacques Lucke
Date:   Thu Feb 20 10:38:13 2020 +0100
Branches: simulation-tree
https://developer.blender.org/rB9675c3d95f8c31f39bccb608cdf854289fc201c5

remove unnecessary function parameter

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

M       source/blender/blenkernel/BKE_node.h
M       source/blender/editors/space_node/drawnode.c
M       source/blender/editors/space_node/node_draw.c
M       source/blender/makesrna/intern/rna_nodetree.c
M       source/blender/simulations/nodes/my_test_node.cc

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

diff --git a/source/blender/blenkernel/BKE_node.h 
b/source/blender/blenkernel/BKE_node.h
index 7d4fe2f6658..98a6ff743ee 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -117,7 +117,6 @@ typedef struct bNodeSocketType {
   void (*draw_color)(struct bContext *C,
                      struct PointerRNA *ptr,
                      struct PointerRNA *node_ptr,
-                     const void *userdata,
                      float *r_color);
 
   void (*interface_draw)(struct bContext *C, struct uiLayout *layout, struct 
PointerRNA *ptr);
diff --git a/source/blender/editors/space_node/drawnode.c 
b/source/blender/editors/space_node/drawnode.c
index 781c95967d1..4ea70841cf9 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3170,7 +3170,6 @@ static void node_socket_undefined_draw(bContext 
*UNUSED(C),
 static void node_socket_undefined_draw_color(bContext *UNUSED(C),
                                              PointerRNA *UNUSED(ptr),
                                              PointerRNA *UNUSED(node_ptr),
-                                             const void *UNUSED(userdata),
                                              float *r_color)
 {
   r_color[0] = 1.0f;
@@ -3276,7 +3275,6 @@ static const float std_node_socket_colors[][4] = {
 static void std_node_socket_draw_color(bContext *UNUSED(C),
                                        PointerRNA *ptr,
                                        PointerRNA *UNUSED(node_ptr),
-                                       const void *UNUSED(userdata),
                                        float *r_color)
 {
   bNodeSocket *sock = ptr->data;
@@ -3445,7 +3443,6 @@ void ED_init_standard_node_socket_type(bNodeSocketType 
*stype)
 static void node_socket_virtual_draw_color(bContext *UNUSED(C),
                                            PointerRNA *UNUSED(ptr),
                                            PointerRNA *UNUSED(node_ptr),
-                                           const void *UNUSED(userdata),
                                            float *r_color)
 {
   /* alpha = 0, empty circle */
diff --git a/source/blender/editors/space_node/node_draw.c 
b/source/blender/editors/space_node/node_draw.c
index 6bc285045d1..7c64255380b 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -737,7 +737,7 @@ static void node_socket_draw(const bContext *C,
   uint flags = 0;
 
   RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, sock, &ptr);
-  sock->typeinfo->draw_color((bContext *)C, &ptr, &node_ptr, 
sock->typeinfo->userdata, color);
+  sock->typeinfo->draw_color((bContext *)C, &ptr, &node_ptr, color);
 
   bNode *node = node_ptr.data;
   if (node->flag & NODE_MUTED) {
diff --git a/source/blender/makesrna/intern/rna_nodetree.c 
b/source/blender/makesrna/intern/rna_nodetree.c
index 0c928b8a6da..43aa7e6d347 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -2133,7 +2133,6 @@ static void rna_NodeSocket_draw(
 static void rna_NodeSocket_draw_color(bContext *C,
                                       PointerRNA *ptr,
                                       PointerRNA *node_ptr,
-                                      const void *UNUSED(userdata),
                                       float *r_color)
 {
   extern FunctionRNA rna_NodeSocket_draw_color_func;
@@ -2633,7 +2632,7 @@ static void rna_NodeSocketStandard_draw_color(
 {
   PointerRNA ptr;
   RNA_pointer_create(id, &RNA_NodeSocket, sock, &ptr);
-  sock->typeinfo->draw_color(C, &ptr, nodeptr, sock->typeinfo->userdata, 
r_color);
+  sock->typeinfo->draw_color(C, &ptr, nodeptr, r_color);
 }
 
 static void rna_NodeSocketInterfaceStandard_draw(ID *id,
diff --git a/source/blender/simulations/nodes/my_test_node.cc 
b/source/blender/simulations/nodes/my_test_node.cc
index 5e9f0947006..9c3f9185dab 100644
--- a/source/blender/simulations/nodes/my_test_node.cc
+++ b/source/blender/simulations/nodes/my_test_node.cc
@@ -389,7 +389,6 @@ class SocketTypeDefinition {
   static void get_draw_color(struct bContext *UNUSED(C),
                              struct PointerRNA *ptr,
                              struct PointerRNA *UNUSED(node_ptr),
-                             const void *UNUSED(userdata),
                              float *r_color)
   {
     bNodeSocket *socket = (bNodeSocket *)ptr->data;
@@ -658,11 +657,10 @@ static bNodeSocketType 
*register_new_simple_socket_type(StringRefNull idname, rg
   stype->free_userdata = [](void *userdata) { delete (rgba_f *)userdata; };
 
   stype->draw_color = [](struct bContext *UNUSED(C),
-                         struct PointerRNA *UNUSED(ptr),
+                         struct PointerRNA *ptr,
                          struct PointerRNA *UNUSED(node_ptr),
-                         const void *userdata,
                          float *r_color) {
-    rgba_f color = *(rgba_f *)userdata;
+    rgba_f color = *(rgba_f *)((bNodeSocket *)ptr->data)->typeinfo->userdata;
     *(rgba_f *)r_color = color;
   };
   nodeRegisterSocketType(stype);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to