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>2014-09-17 08:11:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-09-24 08:55:02 +0400
commit3a40aed3d52aeb24973385d3aa8e0c2234bf0435 (patch)
treea4a51efdc304420f0163ea40e1a14a4e206e3828 /source/blender/nodes/shader/nodes
parente7f495d8a076c35d2088d73fac0ed2eeb5ea1fbb (diff)
Cleanup: use float versions of functions when in/output are floats
Diffstat (limited to 'source/blender/nodes/shader/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_camera.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_math.c22
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_vectMath.c4
3 files changed, 14 insertions, 14 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];