diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-09-17 08:11:37 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-09-24 08:55:02 +0400 |
commit | 3a40aed3d52aeb24973385d3aa8e0c2234bf0435 (patch) | |
tree | a4a51efdc304420f0163ea40e1a14a4e206e3828 /source/blender/nodes | |
parent | e7f495d8a076c35d2088d73fac0ed2eeb5ea1fbb (diff) |
Cleanup: use float versions of functions when in/output are floats
Diffstat (limited to 'source/blender/nodes')
4 files changed, 20 insertions, 20 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_camera.c b/source/blender/nodes/shader/nodes/node_shader_camera.c index 231af7e7d37..49ebb15d7a4 100644 --- a/source/blender/nodes/shader/nodes/node_shader_camera.c +++ b/source/blender/nodes/shader/nodes/node_shader_camera.c @@ -47,7 +47,7 @@ static void node_shader_exec_camera(void *data, int UNUSED(thread), bNode *UNUSE ShadeInput *shi = ((ShaderCallData *)data)->shi; /* Data we need for shading. */ copy_v3_v3(out[0]->vec, shi->co); /* get view vector */ - out[1]->vec[0] = fabs(shi->co[2]); /* get view z-depth */ + out[1]->vec[0] = fabsf(shi->co[2]); /* get view z-depth */ out[2]->vec[0] = normalize_v3(out[0]->vec); /* get view distance */ } } diff --git a/source/blender/nodes/shader/nodes/node_shader_math.c b/source/blender/nodes/shader/nodes/node_shader_math.c index d5ba8231cce..dc5971909d2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.c +++ b/source/blender/nodes/shader/nodes/node_shader_math.c @@ -74,25 +74,25 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode case 4: /* Sine */ { if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */ - r = sin(a); + r = sinf(a); else - r = sin(b); + r = sinf(b); break; } case 5: /* Cosine */ { if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */ - r = cos(a); + r = cosf(a); else - r = cos(b); + r = cosf(b); break; } case 6: /* Tangent */ { if (in[0]->hasinput || !in[1]->hasinput) /* This one only takes one input, so we've got to choose. */ - r = tan(a); + r = tanf(a); else - r = tan(b); + r = tanf(b); break; } case 7: /* Arc-Sine */ @@ -100,14 +100,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 (a <= 1 && a >= -1) - r = asin(a); + r = asinf(a); else r = 0.0; } else { /* Can't do the impossible... */ if (b <= 1 && b >= -1) - r = asin(b); + r = asinf(b); else r = 0.0; } @@ -118,14 +118,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 (a <= 1 && a >= -1) - r = acos(a); + r = acosf(a); else r = 0.0; } else { /* Can't do the impossible... */ if (b <= 1 && b >= -1) - r = acos(b); + r = acosf(b); else r = 0.0; } @@ -218,7 +218,7 @@ static void node_shader_exec_math(void *UNUSED(data), int UNUSED(thread), bNode } case 18: /* Absolute */ { - r = fabs(a); + r = fabsf(a); break; } } diff --git a/source/blender/nodes/shader/nodes/node_shader_vectMath.c b/source/blender/nodes/shader/nodes/node_shader_vectMath.c index b40bf6bc71a..f2ea2faa5a7 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vectMath.c +++ b/source/blender/nodes/shader/nodes/node_shader_vectMath.c @@ -59,14 +59,14 @@ static void node_shader_exec_vect_math(void *UNUSED(data), int UNUSED(thread), b out[0]->vec[1] = vec1[1] + vec2[1]; out[0]->vec[2] = vec1[2] + vec2[2]; - out[1]->vec[0] = (fabs(out[0]->vec[0]) + fabs(out[0]->vec[0]) + fabs(out[0]->vec[0])) / 3; + out[1]->vec[0] = (fabsf(out[0]->vec[0]) + fabsf(out[0]->vec[0]) + fabsf(out[0]->vec[0])) / 3; } else if (node->custom1 == 1) { /* Subtract */ out[0]->vec[0] = vec1[0] - vec2[0]; out[0]->vec[1] = vec1[1] - vec2[1]; out[0]->vec[2] = vec1[2] - vec2[2]; - out[1]->vec[0] = (fabs(out[0]->vec[0]) + fabs(out[0]->vec[0]) + fabs(out[0]->vec[0])) / 3; + out[1]->vec[0] = (fabsf(out[0]->vec[0]) + fabsf(out[0]->vec[0]) + fabsf(out[0]->vec[0])) / 3; } else if (node->custom1 == 2) { /* Average */ out[0]->vec[0] = vec1[0] + vec2[0]; diff --git a/source/blender/nodes/texture/nodes/node_texture_math.c b/source/blender/nodes/texture/nodes/node_texture_math.c index 9bd2532b4b8..94e778e10fb 100644 --- a/source/blender/nodes/texture/nodes/node_texture_math.c +++ b/source/blender/nodes/texture/nodes/node_texture_math.c @@ -72,24 +72,24 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor } case 4: /* Sine */ { - *out = sin(in0); + *out = sinf(in0); break; } case 5: /* Cosine */ { - *out = cos(in0); + *out = cosf(in0); break; } case 6: /* Tangent */ { - *out = tan(in0); + *out = tanf(in0); break; } case 7: /* Arc-Sine */ { /* Can't do the impossible... */ if (in0 <= 1 && in0 >= -1) - *out = asin(in0); + *out = asinf(in0); else *out = 0.0; break; @@ -98,7 +98,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor { /* Can't do the impossible... */ if (in0 <= 1 && in0 >= -1) - *out = acos(in0); + *out = acosf(in0); else *out = 0.0; break; @@ -185,7 +185,7 @@ static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor case 18: /* Absolute */ { - *out = fabs(in0); + *out = fabsf(in0); break; } |