Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-09-07 17:12:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-09-07 17:23:25 +0300
commit0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0 (patch)
tree0283a5c819d1e709edfd0de814636aa83a9b1033 /source/blender/nodes/intern
parentab823176d31dc155645de733f1cd4fbd6ad74592 (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/intern')
-rw-r--r--source/blender/nodes/intern/node_exec.c10
-rw-r--r--source/blender/nodes/intern/node_util.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index 24376e39f3d..85c408c40bb 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -183,7 +183,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context,
/* set stack indices */
index = 0;
- for (n = 0; n < totnodes; ++n) {
+ for (n = 0; n < totnodes; n++) {
node = nodelist[n];
node->stack_index = index;
@@ -213,12 +213,12 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context,
exec->stack = MEM_callocN(exec->stacksize * sizeof(bNodeStack), "bNodeStack");
/* all non-const results are considered inputs */
- for (n = 0; n < exec->stacksize; ++n) {
+ for (n = 0; n < exec->stacksize; n++) {
exec->stack[n].hasinput = 1;
}
/* prepare all nodes for execution */
- for (n = 0, nodeexec = exec->nodeexec; n < totnodes; ++n, ++nodeexec) {
+ for (n = 0, nodeexec = exec->nodeexec; n < totnodes; n++, nodeexec++) {
node = nodeexec->node = nodelist[n];
nodeexec->freeexecfunc = node->typeinfo->freeexecfunc;
@@ -265,7 +265,7 @@ void ntree_exec_end(bNodeTreeExec *exec)
MEM_freeN(exec->stack);
}
- for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; n++, nodeexec++) {
if (nodeexec->freeexecfunc) {
nodeexec->freeexecfunc(nodeexec->data.data);
}
@@ -317,7 +317,7 @@ bool ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *call
/* nodes are presorted, so exec is in order of list */
- 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;
if (node->need_exec) {
node_get_stack(node, nts->stack, nsin, nsout);
diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c
index 0d7f19fb67a..455da4b3881 100644
--- a/source/blender/nodes/intern/node_util.c
+++ b/source/blender/nodes/intern/node_util.c
@@ -130,7 +130,7 @@ static bool node_link_socket_match(bNodeSocket *a, bNodeSocket *b)
*/
int prefix_len = 0;
char *ca = a->name, *cb = b->name;
- for (; *ca != '\0' && *cb != '\0'; ++ca, ++cb) {
+ for (; *ca != '\0' && *cb != '\0'; ca++, cb++) {
/* end of common prefix? */
if (*ca != *cb) {
/* prefix delimited by non-alphabetic char */
@@ -139,7 +139,7 @@ static bool node_link_socket_match(bNodeSocket *a, bNodeSocket *b)
}
break;
}
- ++prefix_len;
+ prefix_len++;
}
return prefix_len > 0;
}
@@ -150,10 +150,10 @@ static int node_count_links(bNodeTree *ntree, bNodeSocket *sock)
int count = 0;
for (link = ntree->links.first; link; link = link->next) {
if (link->fromsock == sock) {
- ++count;
+ count++;
}
if (link->tosock == sock) {
- ++count;
+ count++;
}
}
return count;
@@ -321,7 +321,7 @@ static bNodeSocket *select_internal_link_input(bNode *node, bNodeSocket *output)
int sel_priority = -1;
bool sel_is_linked = false;
- for (input = node->inputs.first, i = 0; input; input = input->next, ++i) {
+ for (input = node->inputs.first, i = 0; input; input = input->next, i++) {
int priority = node_datatype_priority(input->type, output->type);
bool is_linked = (input->link != NULL);
bool preferred;