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/editors/space_node
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/editors/space_node')
-rw-r--r--source/blender/editors/space_node/drawnode.c10
-rw-r--r--source/blender/editors/space_node/node_draw.c12
-rw-r--r--source/blender/editors/space_node/node_group.c6
-rw-r--r--source/blender/editors/space_node/node_relationships.c12
-rw-r--r--source/blender/editors/space_node/node_templates.c12
-rw-r--r--source/blender/editors/space_node/space_node.c8
6 files changed, 30 insertions, 30 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index c0980a1d2e9..23d452412ea 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3126,12 +3126,12 @@ static void node_template_properties_update(bNodeType *ntype)
bNodeSocketTemplate *stemp;
if (ntype->inputs) {
- for (stemp = ntype->inputs; stemp->type >= 0; ++stemp) {
+ for (stemp = ntype->inputs; stemp->type >= 0; stemp++) {
node_socket_template_properties_update(ntype, stemp);
}
}
if (ntype->outputs) {
- for (stemp = ntype->outputs; stemp->type >= 0; ++stemp) {
+ for (stemp = ntype->outputs; stemp->type >= 0; stemp++) {
node_socket_template_properties_update(ntype, stemp);
}
}
@@ -3752,7 +3752,7 @@ static void nodelink_batch_init(void)
GPU_vertbuf_data_alloc(vbo, vcount);
int v = 0;
- for (int k = 0; k < 2; ++k) {
+ for (int k = 0; k < 2; k++) {
unsigned char uv[2] = {0, 0};
float pos[2] = {0.0f, 0.0f};
float exp[2] = {0.0f, 1.0f};
@@ -3763,7 +3763,7 @@ static void nodelink_batch_init(void)
}
/* curve strip */
- for (int i = 0; i < LINK_RESOL; ++i) {
+ for (int i = 0; i < LINK_RESOL; i++) {
uv[0] = 255 * (i / (float)(LINK_RESOL - 1));
uv[1] = 0;
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
@@ -3779,7 +3779,7 @@ static void nodelink_batch_init(void)
copy_v2_v2(exp, arrow_expand_axis[0]);
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
/* arrow */
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
uv[1] = 0;
copy_v2_v2(pos, arrow_verts[i]);
copy_v2_v2(exp, arrow_expand_axis[i]);
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 6dc2182b684..e5cb15c1f79 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -261,7 +261,7 @@ void ED_node_sort(bNodeTree *ntree)
do {
/* setup first_b pointer */
- for (b = 0; b < k && first_b; ++b) {
+ for (b = 0; b < k && first_b; b++) {
first_b = first_b->next;
}
/* all batches merged? */
@@ -289,7 +289,7 @@ void ED_node_sort(bNodeTree *ntree)
/* setup first pointers for next batch */
first_b = node_b;
- for (; b < k; ++b) {
+ for (; b < k; b++) {
/* all nodes sorted? */
if (first_b == NULL) {
break;
@@ -970,7 +970,7 @@ void node_draw_sockets(View2D *v2d,
continue;
}
if (select_all || (sock->flag & SELECT)) {
- ++selected_input_len;
+ selected_input_len++;
continue;
}
@@ -995,7 +995,7 @@ void node_draw_sockets(View2D *v2d,
continue;
}
if (select_all || (sock->flag & SELECT)) {
- ++selected_output_len;
+ selected_output_len++;
continue;
}
@@ -1732,11 +1732,11 @@ void drawnodespace(const bContext *C, ARegion *ar)
depth = 0;
while (path->prev && depth < max_depth) {
path = path->prev;
- ++depth;
+ depth++;
}
/* parent node trees in the background */
- for (curdepth = depth; curdepth > 0; path = path->next, --curdepth) {
+ for (curdepth = depth; curdepth > 0; path = path->next, curdepth--) {
ntree = path->nodetree;
if (ntree) {
snode_setup_v2d(snode, ar, path->view_center);
diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c
index 3fd03bac874..588fc4d4307 100644
--- a/source/blender/editors/space_node/node_group.c
+++ b/source/blender/editors/space_node/node_group.c
@@ -298,7 +298,7 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode)
tlink->fromsock,
link->tonode->new_node,
link->tosock->new_sock);
- ++num_external_links;
+ num_external_links++;
}
}
@@ -331,7 +331,7 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode)
tlink->fromsock->new_sock,
link->tonode,
link->tosock);
- ++num_internal_links;
+ num_internal_links++;
}
}
}
@@ -695,7 +695,7 @@ static int node_get_selected_minmax(bNodeTree *ntree, bNode *gnode, float *min,
if (node_group_make_use_node(node, gnode)) {
nodeToView(node, 0.0f, 0.0f, &loc[0], &loc[1]);
minmax_v2v2_v2(min, max, loc);
- ++totselect;
+ totselect++;
}
}
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index cf52ca8489f..eef3f85319c 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -572,10 +572,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;
@@ -599,7 +599,7 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeLink *link)
if (from_count > from->limit) {
nodeRemLink(ntree, tlink);
tlink = NULL;
- --from_count;
+ from_count--;
}
}
@@ -607,7 +607,7 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeLink *link)
if (to_count > to->limit) {
nodeRemLink(ntree, tlink);
tlink = NULL;
- --to_count;
+ to_count--;
}
}
}
@@ -1567,7 +1567,7 @@ static bNodeSocket *socket_best_match(ListBase *sockets)
}
/* try all types, starting from 'highest' (i.e. colors, vectors, values) */
- for (type = maxtype; type >= 0; --type) {
+ for (type = maxtype; type >= 0; type--) {
for (sock = sockets->first; sock; sock = sock->next) {
if (!nodeSocketIsHidden(sock) && type == sock->type) {
return sock;
@@ -1576,7 +1576,7 @@ static bNodeSocket *socket_best_match(ListBase *sockets)
}
/* no visible sockets, unhide first of highest type */
- for (type = maxtype; type >= 0; --type) {
+ for (type = maxtype; type >= 0; type--) {
for (sock = sockets->first; sock; sock = sock->next) {
if (type == sock->type) {
sock->flag &= ~SOCK_HIDDEN;
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index 423dec13c69..c6994dab72d 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -342,7 +342,7 @@ static void ui_node_link_items(NodeLinkArg *arg,
ListBase *lb = (in_out == SOCK_IN ? &ngroup->inputs : &ngroup->outputs);
bNodeSocket *stemp;
int index;
- for (stemp = lb->first, index = 0; stemp; stemp = stemp->next, ++index, ++i) {
+ for (stemp = lb->first, index = 0; stemp; stemp = stemp->next, index++, i++) {
NodeLinkItem *item = &items[i];
item->socket_index = index;
@@ -363,15 +363,15 @@ static void ui_node_link_items(NodeLinkArg *arg,
bNodeSocketTemplate *stemp;
int i;
- for (stemp = socket_templates; stemp && stemp->type != -1; ++stemp) {
- ++totitems;
+ for (stemp = socket_templates; stemp && stemp->type != -1; stemp++) {
+ totitems++;
}
if (totitems > 0) {
items = MEM_callocN(sizeof(NodeLinkItem) * totitems, "ui node link items");
i = 0;
- for (stemp = socket_templates; stemp && stemp->type != -1; ++stemp, ++i) {
+ for (stemp = socket_templates; stemp && stemp->type != -1; stemp++, i++) {
NodeLinkItem *item = &items[i];
item->socket_index = i;
@@ -506,13 +506,13 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
ui_node_link_items(arg, SOCK_OUT, &items, &totitems);
- for (i = 0; i < totitems; ++i) {
+ for (i = 0; i < totitems; i++) {
if (ui_compatible_sockets(items[i].socket_type, sock->type)) {
num++;
}
}
- for (i = 0; i < totitems; ++i) {
+ for (i = 0; i < totitems; i++) {
if (!ui_compatible_sockets(items[i].socket_type, sock->type)) {
continue;
}
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 7183512a5bc..e114c3dbc05 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -158,7 +158,7 @@ bNodeTree *ED_node_tree_get(SpaceNode *snode, int level)
{
bNodeTreePath *path;
int i;
- for (path = snode->treepath.last, i = 0; path; path = path->prev, ++i) {
+ for (path = snode->treepath.last, i = 0; path; path = path->prev, i++) {
if (i == level) {
return path->nodetree;
}
@@ -171,7 +171,7 @@ int ED_node_tree_path_length(SpaceNode *snode)
bNodeTreePath *path;
int length = 0;
int i;
- for (path = snode->treepath.first, i = 0; path; path = path->next, ++i) {
+ for (path = snode->treepath.first, i = 0; path; path = path->next, i++) {
length += strlen(path->node_name);
if (i > 0) {
length += 1; /* for separator char */
@@ -186,7 +186,7 @@ void ED_node_tree_path_get(SpaceNode *snode, char *value)
int i;
value[0] = '\0';
- for (path = snode->treepath.first, i = 0; path; path = path->next, ++i) {
+ for (path = snode->treepath.first, i = 0; path; path = path->next, i++) {
if (i == 0) {
strcpy(value, path->node_name);
value += strlen(path->node_name);
@@ -204,7 +204,7 @@ void ED_node_tree_path_get_fixedbuf(SpaceNode *snode, char *value, int max_lengt
int size, i;
value[0] = '\0';
- for (path = snode->treepath.first, i = 0; path; path = path->next, ++i) {
+ for (path = snode->treepath.first, i = 0; path; path = path->next, i++) {
if (i == 0) {
size = BLI_strncpy_rlen(value, path->node_name, max_length);
}