diff options
author | Hans Goudey <h.goudey@me.com> | 2021-12-10 23:54:32 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-12-10 23:54:32 +0300 |
commit | a8b730e04c658ec72ad22974eb1c3d2493308f44 (patch) | |
tree | fd32e7707e3a034ee60307f630b77da5b3ce8870 /source/blender/makesrna/intern/rna_nodetree.c | |
parent | 7c2fb00e661e080f0d0c85df60f1dff481c91d5e (diff) |
Cleanup: Use const argument, rename variables
The const argument makes sense because these are the "source"
sockets, even though a const cast is necessary at one point.
The name "interface_socket" is an improvement over "stemp"
because the latter sounds like "temporary", or it confuses
the old socket template system with a node group's interface.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 640a1439a57..e1c1ba16165 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3164,8 +3164,11 @@ static void rna_NodeSocketInterface_register_properties(bNodeTree *ntree, RNA_parameter_list_free(&list); } -static void rna_NodeSocketInterface_init_socket( - bNodeTree *ntree, bNodeSocket *stemp, bNode *node, bNodeSocket *sock, const char *data_path) +static void rna_NodeSocketInterface_init_socket(bNodeTree *ntree, + const bNodeSocket *interface_socket, + bNode *node, + bNodeSocket *sock, + const char *data_path) { extern FunctionRNA rna_NodeSocketInterface_init_socket_func; @@ -3173,11 +3176,11 @@ static void rna_NodeSocketInterface_init_socket( ParameterList list; FunctionRNA *func; - if (!stemp->typeinfo) { + if (!interface_socket->typeinfo) { return; } - RNA_pointer_create((ID *)ntree, &RNA_NodeSocketInterface, stemp, &ptr); + RNA_pointer_create((ID *)ntree, &RNA_NodeSocketInterface, (bNodeSocket *)interface_socket, &ptr); RNA_pointer_create((ID *)ntree, &RNA_Node, node, &node_ptr); RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, sock, &sock_ptr); // RNA_struct_find_function(&ptr, "init_socket"); @@ -3187,13 +3190,13 @@ static void rna_NodeSocketInterface_init_socket( RNA_parameter_set_lookup(&list, "node", &node_ptr); RNA_parameter_set_lookup(&list, "socket", &sock_ptr); RNA_parameter_set_lookup(&list, "data_path", &data_path); - stemp->typeinfo->ext_interface.call(NULL, &ptr, func, &list); + interface_socket->typeinfo->ext_interface.call(NULL, &ptr, func, &list); RNA_parameter_list_free(&list); } static void rna_NodeSocketInterface_from_socket(bNodeTree *ntree, - bNodeSocket *stemp, + bNodeSocket *interface_socket, bNode *node, bNodeSocket *sock) { @@ -3203,11 +3206,11 @@ static void rna_NodeSocketInterface_from_socket(bNodeTree *ntree, ParameterList list; FunctionRNA *func; - if (!stemp->typeinfo) { + if (!interface_socket->typeinfo) { return; } - RNA_pointer_create((ID *)ntree, &RNA_NodeSocketInterface, stemp, &ptr); + RNA_pointer_create((ID *)ntree, &RNA_NodeSocketInterface, interface_socket, &ptr); RNA_pointer_create((ID *)ntree, &RNA_Node, node, &node_ptr); RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, sock, &sock_ptr); // RNA_struct_find_function(&ptr, "from_socket"); @@ -3216,7 +3219,7 @@ static void rna_NodeSocketInterface_from_socket(bNodeTree *ntree, RNA_parameter_list_create(&list, &ptr, func); RNA_parameter_set_lookup(&list, "node", &node_ptr); RNA_parameter_set_lookup(&list, "socket", &sock_ptr); - stemp->typeinfo->ext_interface.call(NULL, &ptr, func, &list); + interface_socket->typeinfo->ext_interface.call(NULL, &ptr, func, &list); RNA_parameter_list_free(&list); } |