From 3a40aed3d52aeb24973385d3aa8e0c2234bf0435 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Sep 2014 14:11:37 +1000 Subject: Cleanup: use float versions of functions when in/output are floats --- source/blender/blenlib/intern/math_geom.c | 2 +- source/blender/blenlib/intern/math_rotation.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/blenlib/intern') diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index 17a1dcbf34d..4db9015d9e2 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -3193,7 +3193,7 @@ void map_to_tube(float *r_u, float *r_v, const float x, const float y, const flo len = sqrtf(x * x + y * y); if (len > 0.0f) { - *r_u = (float)((1.0 - (atan2(x / len, y / len) / M_PI)) / 2.0); + *r_u = (1.0f - (atan2f(x / len, y / len) / (float)M_PI)) / 2.0f; } else { *r_v = *r_u = 0.0f; /* to avoid un-initialized variables */ diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 141f9201689..9a6515daf68 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -366,7 +366,7 @@ void mat3_to_quat_is_ok(float q[4], float wmat[3][3]) mul_m3_v3(matn, mat[0]); /* and align x-axes */ - angle = (float)(0.5 * atan2(mat[0][1], mat[0][0])); + angle = 0.5f * atan2f(mat[0][1], mat[0][0]); co = cosf(angle); si = sinf(angle); @@ -765,7 +765,7 @@ void tri_to_quat_ex(float quat[4], const float v1[3], const float v2[3], const f vec[2] = 0.0f; normalize_v3(vec); - angle = (float)(0.5 * atan2(vec[1], vec[0])); + angle = 0.5f * atan2f(vec[1], vec[0]); co = cosf(angle); si = sinf(angle); q2[0] = co; -- cgit v1.2.3