Code Cleanup: replace ABS() with fabsf() when used with float expressions.

This commit is contained in:
Campbell Barton 2013-12-01 13:11:12 +11:00
parent dbd7025fae
commit ac38f2584f
7 changed files with 9 additions and 9 deletions

View File

@ -1265,7 +1265,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
k = clmd->sim_parms->structural;
scaling = k + s->stiffness * ABS(clmd->sim_parms->max_struct-k);
scaling = k + s->stiffness * fabsf(clmd->sim_parms->max_struct - k);
k = scaling / (clmd->sim_parms->avg_spring_len + FLT_EPSILON);
@ -1305,7 +1305,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
k = clmd->sim_parms->goalspring;
scaling = k + s->stiffness * ABS(clmd->sim_parms->max_struct-k);
scaling = k + s->stiffness * fabsf(clmd->sim_parms->max_struct - k);
k = verts [s->ij].goal * scaling / (clmd->sim_parms->avg_spring_len + FLT_EPSILON);
@ -1324,7 +1324,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
k = clmd->sim_parms->bending;
scaling = k + s->stiffness * ABS(clmd->sim_parms->max_bend-k);
scaling = k + s->stiffness * fabsf(clmd->sim_parms->max_bend - k);
cb = k = scaling / (20.0f * (clmd->sim_parms->avg_spring_len + FLT_EPSILON));
mul_fvector_S(bending_force, dir, fbstar(length, L, k, cb));

View File

@ -251,7 +251,7 @@ static int customdata_compare(CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2
for (k = 0; k < dv1->totweight; k++, dw1++, dw2++) {
if (dw1->def_nr != dw2->def_nr)
return MESHCMP_DVERT_GROUPMISMATCH;
if (ABS(dw1->weight - dw2->weight) > thresh)
if (fabsf(dw1->weight - dw2->weight) > thresh)
return MESHCMP_DVERT_WEIGHTMISMATCH;
}
}

View File

@ -173,7 +173,7 @@ TimeMarker *ED_markers_find_nearest_marker(ListBase *markers, float x)
if (markers) {
for (marker = markers->first; marker; marker = marker->next) {
dist = ABS((float)marker->frame - x);
dist = fabsf((float)marker->frame - x);
if (dist < min_dist) {
min_dist = dist;

View File

@ -2335,7 +2335,7 @@ int ui_link_bezier_points(const rcti *rect, float coord_array[][2], int resol)
vec[3][0] = rect->xmax;
vec[3][1] = rect->ymax;
dist = 0.5f * ABS(vec[0][0] - vec[3][0]);
dist = 0.5f * fabsf(vec[0][0] - vec[3][0]);
vec[1][0] = vec[0][0] + dist;
vec[1][1] = vec[0][1];

View File

@ -143,7 +143,7 @@ void fdrawbezier(float vec[4][3])
float dist;
float curve_res = 24, spline_step = 0.0f;
dist = 0.5f * ABS(vec[0][0] - vec[3][0]);
dist = 0.5f * fabsf(vec[0][0] - vec[3][0]);
/* check direction later, for top sockets */
vec[1][0] = vec[0][0] + dist;

View File

@ -3123,7 +3123,7 @@ int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, floa
toreroute = 0;
}
dist = UI_GetThemeValue(TH_NODE_CURVING) * 0.10f * ABS(vec[0][0] - vec[3][0]);
dist = UI_GetThemeValue(TH_NODE_CURVING) * 0.10f * fabsf(vec[0][0] - vec[3][0]);
deltax = vec[3][0] - vec[0][0];
deltay = vec[3][1] - vec[0][1];
/* check direction later, for top sockets */

View File

@ -1972,7 +1972,7 @@ static void removeDoublesPeel(ListBase *depth_peels)
for (peel = depth_peels->first; peel; peel = peel->next) {
DepthPeel *next_peel = peel->next;
if (next_peel && ABS(peel->depth - next_peel->depth) < 0.0015f) {
if (next_peel && fabsf(peel->depth - next_peel->depth) < 0.0015f) {
peel->next = next_peel->next;
if (next_peel->next) {