From e8d532f1dde96c40c1407d39260724fcfee0b606 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 31 Mar 2013 03:28:46 +0000 Subject: style cleanup --- source/blender/nodes/intern/node_common.c | 2 +- .../blender/nodes/shader/nodes/node_shader_geom.c | 2 +- .../blender/nodes/shader/nodes/node_shader_math.c | 24 +++++++++++----------- .../nodes/texture/nodes/node_texture_math.c | 18 ++++++++-------- 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'source/blender/nodes') diff --git a/source/blender/nodes/intern/node_common.c b/source/blender/nodes/intern/node_common.c index 3280672d5c2..4e4443f7c3f 100644 --- a/source/blender/nodes/intern/node_common.c +++ b/source/blender/nodes/intern/node_common.c @@ -84,7 +84,7 @@ bNodeSocket *node_group_find_output_socket(bNode *groupnode, const char *identif /* groups display their internal tree name as label */ const char *node_group_label(bNode *node) { - return (node->id)? node->id->name + 2: IFACE_("Missing Datablock"); + return (node->id) ? node->id->name + 2 : IFACE_("Missing Datablock"); } int node_group_poll_instance(bNode *node, bNodeTree *nodetree) diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c index 40ba2cca4e5..a99d9b0cf56 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geom.c +++ b/source/blender/nodes/shader/nodes/node_shader_geom.c @@ -116,7 +116,7 @@ static void node_shader_exec_geom(void *data, int UNUSED(thread), bNode *node, b } /* front/back, normal flipping was stored */ - out[GEOM_OUT_FRONTBACK]->vec[0] = (shi->flippednor)? 0.0f: 1.0f; + out[GEOM_OUT_FRONTBACK]->vec[0] = (shi->flippednor) ? 0.0f : 1.0f; } } diff --git a/source/blender/nodes/shader/nodes/node_shader_math.c b/source/blender/nodes/shader/nodes/node_shader_math.c index 31a1501bc3f..c3e2fc54c78 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.c +++ b/source/blender/nodes/shader/nodes/node_shader_math.c @@ -94,14 +94,14 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode { if (in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */ /* Can't do the impossible... */ - if ( in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1 ) + if (in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1) out[0]->vec[0] = asin(in[0]->vec[0]); else out[0]->vec[0] = 0.0; } else { /* Can't do the impossible... */ - if ( in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1 ) + if (in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1) out[0]->vec[0] = asin(in[1]->vec[0]); else out[0]->vec[0] = 0.0; @@ -112,14 +112,14 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode { if (in[0]->hasinput || !in[1]->hasinput) { /* This one only takes one input, so we've got to choose. */ /* Can't do the impossible... */ - if ( in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1 ) + if (in[0]->vec[0] <= 1 && in[0]->vec[0] >= -1) out[0]->vec[0] = acos(in[0]->vec[0]); else out[0]->vec[0] = 0.0; } else { /* Can't do the impossible... */ - if ( in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1 ) + if (in[1]->vec[0] <= 1 && in[1]->vec[0] >= -1) out[0]->vec[0] = acos(in[1]->vec[0]); else out[0]->vec[0] = 0.0; @@ -137,7 +137,7 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode case 10: /* Power */ { /* Only raise negative numbers by full integers */ - if ( in[0]->vec[0] >= 0 ) { + if (in[0]->vec[0] >= 0) { out[0]->vec[0] = pow(in[0]->vec[0], in[1]->vec[0]); } else { @@ -157,7 +157,7 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode case 11: /* Logarithm */ { /* Don't want any imaginary numbers... */ - if ( in[0]->vec[0] > 0 && in[1]->vec[0] > 0 ) + if (in[0]->vec[0] > 0 && in[1]->vec[0] > 0) out[0]->vec[0] = log(in[0]->vec[0]) / log(in[1]->vec[0]); else out[0]->vec[0] = 0.0; @@ -165,7 +165,7 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode break; case 12: /* Minimum */ { - if ( in[0]->vec[0] < in[1]->vec[0] ) + if (in[0]->vec[0] < in[1]->vec[0]) out[0]->vec[0] = in[0]->vec[0]; else out[0]->vec[0] = in[1]->vec[0]; @@ -173,7 +173,7 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode break; case 13: /* Maximum */ { - if ( in[0]->vec[0] > in[1]->vec[0] ) + if (in[0]->vec[0] > in[1]->vec[0]) out[0]->vec[0] = in[0]->vec[0]; else out[0]->vec[0] = in[1]->vec[0]; @@ -182,14 +182,14 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode case 14: /* Round */ { if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */ - out[0]->vec[0] = (in[0]->vec[0]<0)?(int)(in[0]->vec[0] - 0.5f):(int)(in[0]->vec[0] + 0.5f); + out[0]->vec[0] = (in[0]->vec[0] < 0) ? (int)(in[0]->vec[0] - 0.5f) : (int)(in[0]->vec[0] + 0.5f); else - out[0]->vec[0] = (in[1]->vec[0]<0)?(int)(in[1]->vec[0] - 0.5f):(int)(in[1]->vec[0] + 0.5f); + out[0]->vec[0] = (in[1]->vec[0] < 0) ? (int)(in[1]->vec[0] - 0.5f) : (int)(in[1]->vec[0] + 0.5f); } break; case 15: /* Less Than */ { - if ( in[0]->vec[0] < in[1]->vec[0] ) + if (in[0]->vec[0] < in[1]->vec[0]) out[0]->vec[0] = 1.0f; else out[0]->vec[0] = 0.0f; @@ -197,7 +197,7 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode break; case 16: /* Greater Than */ { - if ( in[0]->vec[0] > in[1]->vec[0] ) + if (in[0]->vec[0] > in[1]->vec[0]) out[0]->vec[0] = 1.0f; else out[0]->vec[0] = 0.0f; diff --git a/source/blender/nodes/texture/nodes/node_texture_math.c b/source/blender/nodes/texture/nodes/node_texture_math.c index 499412e750d..03349a57832 100644 --- a/source/blender/nodes/texture/nodes/node_texture_math.c +++ b/source/blender/nodes/texture/nodes/node_texture_math.c @@ -88,7 +88,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor case 7: /* Arc-Sine */ { /* Can't do the impossible... */ - if ( in0 <= 1 && in0 >= -1 ) + if (in0 <= 1 && in0 >= -1) *out= asin(in0); else *out= 0.0; @@ -97,7 +97,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor case 8: /* Arc-Cosine */ { /* Can't do the impossible... */ - if ( in0 <= 1 && in0 >= -1 ) + if (in0 <= 1 && in0 >= -1) *out= acos(in0); else *out= 0.0; @@ -111,7 +111,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor case 10: /* Power */ { /* Only raise negative numbers by full integers */ - if ( in0 >= 0 ) { + if (in0 >= 0) { out[0] = pow(in0, in1); } else { @@ -128,7 +128,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor case 11: /* Logarithm */ { /* Don't want any imaginary numbers... */ - if ( in0 > 0 && in1 > 0 ) + if (in0 > 0 && in1 > 0) *out= log(in0) / log(in1); else *out= 0.0; @@ -136,7 +136,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor break; case 12: /* Minimum */ { - if ( in0 < in1 ) + if (in0 < in1) *out= in0; else *out= in1; @@ -144,7 +144,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor break; case 13: /* Maximum */ { - if ( in0 > in1 ) + if (in0 > in1) *out= in0; else *out= in1; @@ -152,13 +152,13 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor break; case 14: /* Round */ { - *out= (in0<0)?(int)(in0 - 0.5f):(int)(in0 + 0.5f); + *out= (in0 < 0) ? (int)(in0 - 0.5f) : (int)(in0 + 0.5f); } break; case 15: /* Less Than */ { - if ( in0 < in1 ) + if (in0 < in1) *out= 1.0f; else *out= 0.0f; @@ -167,7 +167,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor case 16: /* Greater Than */ { - if ( in0 > in1 ) + if (in0 > in1) *out= 1.0f; else *out= 0.0f; -- cgit v1.2.3