[Bf-blender-cvs] [a00b6d1] master: Cleanup: (float)floor -> floorf

Campbell Barton noreply at git.blender.org
Fri Oct 10 00:23:47 CEST 2014


Commit: a00b6d1271dfdcec7bad62bfd1e8d6e66fb6a49e
Author: Campbell Barton
Date:   Fri Oct 10 00:23:06 2014 +0200
Branches: master
https://developer.blender.org/rBa00b6d1271dfdcec7bad62bfd1e8d6e66fb6a49e

Cleanup: (float)floor -> floorf

===================================================================

M	source/blender/blenfont/intern/blf_glyph.c
M	source/blender/editors/animation/keyframes_edit.c
M	source/blender/editors/transform/transform_conversions.c
M	source/blender/editors/transform/transform_snap.c

===================================================================

diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c
index a2462f3..7978d28 100644
--- a/source/blender/blenfont/intern/blf_glyph.c
+++ b/source/blender/blenfont/intern/blf_glyph.c
@@ -379,7 +379,7 @@ static void blf_texture3_draw(const float shadow_col[4], float uv[2][2], float x
 
 static void blf_glyph_calc_rect(rctf *rect, GlyphBLF *g, float x, float y)
 {
-	rect->xmin = (float)floor(x + g->pos_x);
+	rect->xmin = floorf(x + g->pos_x);
 	rect->xmax = rect->xmin + (float)g->width;
 	rect->ymin = y + g->pos_y;
 	rect->ymax = y + g->pos_y - (float)g->height;
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index 83593fa..7f612de 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -643,7 +643,7 @@ static short snap_bezier_nearestsec(KeyframeEditData *ked, BezTriple *bezt)
 	const float secf = (float)FPS;
 	
 	if (bezt->f2 & SELECT)
-		bezt->vec[1][0] = ((float)floor(bezt->vec[1][0] / secf + 0.5f) * secf);
+		bezt->vec[1][0] = (floorf(bezt->vec[1][0] / secf + 0.5f) * secf);
 	return 0;
 }
 
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 47adbb6..86e6e61 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -2773,8 +2773,8 @@ void flushTransUVs(TransInfo *t)
 		td->loc2d[1] = td->loc[1] * invy;
 
 		if ((sima->flag & SI_PIXELSNAP) && (t->state != TRANS_CANCEL)) {
-			td->loc2d[0] = (float)floor(width * td->loc2d[0] + 0.5f) / width;
-			td->loc2d[1] = (float)floor(height * td->loc2d[1] + 0.5f) / height;
+			td->loc2d[0] = floorf(width * td->loc2d[0] + 0.5f) / width;
+			td->loc2d[1] = floorf(height * td->loc2d[1] + 0.5f) / height;
 		}
 	}
 }
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index af563f7..8a3e8f1 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -2396,7 +2396,7 @@ bool snapNodesContext(bContext *C, const int mval[2], float *r_dist_px, float r_
 
 /*================================================================*/
 
-static void applyGridIncrement(TransInfo *t, float *val, int max_index, float fac[3], GearsType action);
+static void applyGridIncrement(TransInfo *t, float *val, int max_index, const float fac[3], GearsType action);
 
 
 void snapGridIncrementAction(TransInfo *t, float *val, GearsType action)
@@ -2429,7 +2429,7 @@ void snapGridIncrement(TransInfo *t, float *val)
 }
 
 
-static void applyGridIncrement(TransInfo *t, float *val, int max_index, float fac[3], GearsType action)
+static void applyGridIncrement(TransInfo *t, float *val, int max_index, const float fac[3], GearsType action)
 {
 	int i;
 	float asp[3] = {1.0f, 1.0f, 1.0f}; // TODO: Remove hard coded limit here (3)
@@ -2457,6 +2457,6 @@ static void applyGridIncrement(TransInfo *t, float *val, int max_index, float fa
 	}
 
 	for (i = 0; i <= max_index; i++) {
-		val[i] = fac[action] * asp[i] * (float)floor(val[i] / (fac[action] * asp[i]) + 0.5f);
+		val[i] = fac[action] * asp[i] * floorf(val[i] / (fac[action] * asp[i]) + 0.5f);
 	}
 }




More information about the Bf-blender-cvs mailing list