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/editors/uvedit/uvedit_parametrizer.c | |
parent | e7f495d8a076c35d2088d73fac0ed2eeb5ea1fbb (diff) |
Cleanup: use float versions of functions when in/output are floats
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_parametrizer.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_parametrizer.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 5f22a201600..79f53e1d971 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -372,7 +372,7 @@ static float p_vec_angle(float *v1, float *v2, float *v3) else if (dot >= 1.0f) return 0.0f; else - return (float)acos(dot); + return acosf(dot); } static float p_vec2_angle(float *v1, float *v2, float *v3) @@ -433,7 +433,7 @@ static float p_edge_length(PEdge *e) d[1] = v2->co[1] - v1->co[1]; d[2] = v2->co[2] - v1->co[2]; - return sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); + return sqrtf(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]); } static float p_edge_uv_length(PEdge *e) @@ -444,7 +444,7 @@ static float p_edge_uv_length(PEdge *e) d[0] = v2->uv[0] - v1->uv[0]; d[1] = v2->uv[1] - v1->uv[1]; - return sqrt(d[0] * d[0] + d[1] * d[1]); + return sqrtf(d[0] * d[0] + d[1] * d[1]); } static void p_chart_uv_bbox(PChart *chart, float minv[2], float maxv[2]) @@ -2353,8 +2353,8 @@ static void p_abf_compute_sines(PAbfSystem *sys) float *sine = sys->sine, *cosine = sys->cosine, *alpha = sys->alpha; for (i = 0; i < sys->nangles; i++, sine++, cosine++, alpha++) { - *sine = sin(*alpha); - *cosine = cos(*alpha); + *sine = sinf(*alpha); + *cosine = cosf(*alpha); } } @@ -3163,9 +3163,9 @@ static PBool p_chart_lscm_solve(PHandle *handle, PChart *chart) SWAP(PVert *, v2, v3); } - sina1 = sin(a1); - sina2 = sin(a2); - sina3 = sin(a3); + sina1 = sinf(a1); + sina2 = sinf(a2); + sina3 = sinf(a3); sinmax = max_fff(sina1, sina2, sina3); @@ -3314,7 +3314,7 @@ static float p_face_stretch(PFace *f) a = dot_v3v3(Ps, Ps); c = dot_v3v3(Pt, Pt); - T = sqrt(0.5f * (a + c)); + T = sqrtf(0.5f * (a + c)); if (f->flag & PFACE_FILLED) T *= 0.2f; @@ -3630,8 +3630,8 @@ static float p_chart_minimum_area_angle(PChart *chart) static void p_chart_rotate_minimum_area(PChart *chart) { float angle = p_chart_minimum_area_angle(chart); - float sine = sin(angle); - float cosine = cos(angle); + float sine = sinf(angle); + float cosine = cosf(angle); PVert *v; for (v = chart->verts; v; v = v->nextlink) { @@ -4045,7 +4045,7 @@ static void p_smooth(PChart *chart) diff[0] = p[0] - oldp[0]; diff[1] = p[1] - oldp[1]; - length = sqrt(diff[0] * diff[0] + diff[1] * diff[1]); + length = len_v2(diff); d = max_ff(d, length); moved += length; } @@ -4559,7 +4559,7 @@ void param_pack(ParamHandle *handle, float margin, bool do_rotate) box->index = i; /* warning this index skips PCHART_NOPACK boxes */ if (margin > 0.0f) - area += sqrt(box->w * box->h); + area += sqrtf(box->w * box->h); } if (margin > 0.0f) { @@ -4661,7 +4661,7 @@ void param_average(ParamHandle *handle) /* Move center to 0,0 */ p_chart_uv_translate(chart, trans); - p_chart_uv_scale(chart, sqrt(fac / tot_fac)); + p_chart_uv_scale(chart, sqrtf(fac / tot_fac)); /* Move to original center */ trans[0] = -trans[0]; |