diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:12:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:23:25 +0300 |
commit | 0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0 (patch) | |
tree | 0283a5c819d1e709edfd0de814636aa83a9b1033 /source/blender/nodes/shader | |
parent | ab823176d31dc155645de733f1cd4fbd6ad74592 (diff) |
Cleanup: use post increment/decrement
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
Diffstat (limited to 'source/blender/nodes/shader')
4 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index a21ed6aa4cc..9caa76377fd 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -235,7 +235,7 @@ static bNode *ntree_shader_relink_output_from_group(bNodeTree *ntree, /* Create output sockets to plug output connection to. */ i = 0; - for (bNodeSocket *sock = sh_output_node->inputs.first; sock; sock = sock->next, ++i) { + for (bNodeSocket *sock = sh_output_node->inputs.first; sock; sock = sock->next, i++) { group_surface_sockets[i] = ntreeAddSocketInterface( group_ntree, SOCK_OUT, sock->typeinfo->idname, sock->name); } @@ -264,7 +264,7 @@ static bNode *ntree_shader_relink_output_from_group(bNodeTree *ntree, new_output_node->custom1 = target; i = 0; - for (bNodeSocket *sock = sh_output_node->inputs.first; sock; sock = sock->next, ++i) { + for (bNodeSocket *sock = sh_output_node->inputs.first; sock; sock = sock->next, i++) { if (sock->link != NULL) { /* Link the shader output node incoming link to the group output sockets */ bNodeSocket *group_output_node_surface_input_sock = nodeFindSocket( diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index cf58846a051..9615c6f01e0 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -231,7 +231,7 @@ void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node stack = exec->stack; - for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) { + for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; n++, nodeexec++) { node = nodeexec->node; do_it = false; diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c index 10f6aadbc5f..257caabcabf 100644 --- a/source/blender/nodes/shader/nodes/node_shader_common.c +++ b/source/blender/nodes/shader/nodes/node_shader_common.c @@ -98,7 +98,7 @@ static void group_copy_inputs(bNode *gnode, bNodeStack **in, bNodeStack *gstack) for (node = ngroup->nodes.first; node; node = node->next) { if (node->type == NODE_GROUP_INPUT) { - for (sock = node->outputs.first, a = 0; sock; sock = sock->next, ++a) { + for (sock = node->outputs.first, a = 0; sock; sock = sock->next, a++) { ns = node_get_socket_stack(gstack, sock); if (ns) { copy_stack(ns, in[a]); @@ -120,7 +120,7 @@ static void group_move_outputs(bNode *gnode, bNodeStack **out, bNodeStack *gstac for (node = ngroup->nodes.first; node; node = node->next) { if (node->type == NODE_GROUP_OUTPUT && (node->flag & NODE_DO_OUTPUT)) { - for (sock = node->inputs.first, a = 0; sock; sock = sock->next, ++a) { + for (sock = node->inputs.first, a = 0; sock; sock = sock->next, a++) { ns = node_get_socket_stack(gstack, sock); if (ns) { move_stack(out[a], ns); @@ -174,7 +174,7 @@ static void group_gpu_copy_inputs(bNode *gnode, GPUNodeStack *in, bNodeStack *gs for (node = ngroup->nodes.first; node; node = node->next) { if (node->type == NODE_GROUP_INPUT) { - for (sock = node->outputs.first, a = 0; sock; sock = sock->next, ++a) { + for (sock = node->outputs.first, a = 0; sock; sock = sock->next, a++) { ns = node_get_socket_stack(gstack, sock); if (ns) { /* convert the external gpu stack back to internal node stack data */ @@ -197,7 +197,7 @@ static void group_gpu_move_outputs(bNode *gnode, GPUNodeStack *out, bNodeStack * for (node = ngroup->nodes.first; node; node = node->next) { if (node->type == NODE_GROUP_OUTPUT && (node->flag & NODE_DO_OUTPUT)) { - for (sock = node->inputs.first, a = 0; sock; sock = sock->next, ++a) { + for (sock = node->inputs.first, a = 0; sock; sock = sock->next, a++) { ns = node_get_socket_stack(gstack, sock); if (ns) { /* convert the node stack data result back to gpu stack */ diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.c b/source/blender/nodes/shader/nodes/node_shader_curves.c index baf86951fe0..f5c89e6ba41 100644 --- a/source/blender/nodes/shader/nodes/node_shader_curves.c +++ b/source/blender/nodes/shader/nodes/node_shader_curves.c @@ -141,7 +141,7 @@ static int gpu_shader_curve_rgb(GPUMaterial *mat, float ext_rgba[4][4]; float range_rgba[4]; - for (int a = 0; a < CM_TOT; ++a) { + for (int a = 0; a < CM_TOT; a++) { const CurveMap *cm = &cumap->cm[a]; ext_rgba[a][0] = cm->mintable; ext_rgba[a][2] = cm->maxtable; |