[Bf-blender-cvs] [8dcdde5] master: Cleanup: warnings (double promote, string format)

Campbell Barton noreply at git.blender.org
Fri Apr 22 04:21:48 CEST 2016


Commit: 8dcdde52b17228601c95fed04f5bca03484d27ac
Author: Campbell Barton
Date:   Fri Apr 22 12:18:57 2016 +1000
Branches: master
https://developer.blender.org/rB8dcdde52b17228601c95fed04f5bca03484d27ac

Cleanup: warnings (double promote, string format)

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

M	source/blender/blenkernel/intern/particle_distribute.c
M	source/blender/editors/curve/editcurve_paint.c
M	source/blender/imbuf/intern/cineon/dpxlib.c

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

diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 9185c09..f1dfed0 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -1043,7 +1043,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, Parti
 		}
 
 		/* Avoid initial zero-weight items. */
-		for (i = 0; (element_sum[i] == 0.0) && (i < totelem - 1); i++);
+		for (i = 0; (element_sum[i] == 0.0f) && (i < totelem - 1); i++);
 
 		for (p = 0; p < totpart; p++, pos += step) {
 			for ( ; (pos > (double)element_sum[i]) && (i < totelem - 1); i++);
diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c
index 5c74a3e..5a4cd87 100644
--- a/source/blender/editors/curve/editcurve_paint.c
+++ b/source/blender/editors/curve/editcurve_paint.c
@@ -84,7 +84,7 @@ static float depth_read_zbuf(const ViewContext *vc, int x, int y)
 
 static bool depth_unproject(
         const ARegion *ar, const bglMats *mats,
-        const int mval[2], const float depth,
+        const int mval[2], const double depth,
         float r_location_world[3])
 {
 	double p[3];
@@ -115,7 +115,7 @@ static bool depth_read_normal(
 		for (int y = 0; y < 2; y++) {
 			const int mval_ofs[2] = {mval[0] + (x - 1), mval[1] + (y - 1)};
 
-			float depth = depth_read_zbuf(vc, mval_ofs[0], mval_ofs[1]);
+			const double depth = (double)depth_read_zbuf(vc, mval_ofs[0], mval_ofs[1]);
 			if ((depth > depths->depth_range[0]) && (depth < depths->depth_range[1])) {
 				if (depth_unproject(ar, mats, mval_ofs, depth, coords[i])) {
 					depths_valid[i] = true;
@@ -275,7 +275,7 @@ static bool stroke_elem_project(
 		    ((unsigned int)mval_i[0] < depths->w) &&
 		    ((unsigned int)mval_i[1] < depths->h))
 		{
-			float depth = depth_read_zbuf(&cdd->vc, mval_i[0], mval_i[1]);
+			const double depth = (double)depth_read_zbuf(&cdd->vc, mval_i[0], mval_i[1]);
 			if ((depth > depths->depth_range[0]) && (depth < depths->depth_range[1])) {
 				if (depth_unproject(ar, &cdd->mats, mval_i, depth, r_location_world)) {
 					is_location_world_set = true;
@@ -684,7 +684,7 @@ static void curve_draw_exec_precalc(wmOperator *op)
 
 	prop = RNA_struct_find_property(op->ptr, "corner_angle");
 	if (!RNA_property_is_set(op->ptr, prop)) {
-		const float corner_angle = (cps->flag & CURVE_PAINT_FLAG_CORNERS_DETECT) ? cps->corner_angle : M_PI;
+		const float corner_angle = (cps->flag & CURVE_PAINT_FLAG_CORNERS_DETECT) ? cps->corner_angle : (float)M_PI;
 		RNA_property_float_set(op->ptr, prop, corner_angle);
 	}
 
@@ -738,7 +738,7 @@ static void curve_draw_exec_precalc(wmOperator *op)
 			selem_prev = selem;
 		}
 
-		if (cps->radius_taper_start != 0.0) {
+		if (cps->radius_taper_start != 0.0f) {
 			selem_array[0]->pressure = 0.0f;
 			const float len_taper_max = cps->radius_taper_start * len_3d;
 			for (i = 1; i < stroke_len && lengths[i] < len_taper_max; i++) {
@@ -746,7 +746,7 @@ static void curve_draw_exec_precalc(wmOperator *op)
 			}
 		}
 
-		if (cps->radius_taper_end != 0.0) {
+		if (cps->radius_taper_end != 0.0f) {
 			selem_array[stroke_len - 1]->pressure = 0.0f;
 			const float len_taper_max = cps->radius_taper_end * len_3d;
 			const float len_taper_min = len_3d - len_taper_max;
@@ -787,9 +787,9 @@ static int curve_draw_exec(bContext *C, wmOperator *op)
 
 	ED_curve_deselect_all(cu->editnurb);
 
-	const double radius_min = cps->radius_min;
-	const double radius_max = cps->radius_max;
-	const double radius_range = cps->radius_max - cps->radius_min;
+	const float radius_min = cps->radius_min;
+	const float radius_max = cps->radius_max;
+	const float radius_range = cps->radius_max - cps->radius_min;
 
 	Nurb *nu = MEM_callocN(sizeof(Nurb), __func__);
 	nu->pntsv = 1;
@@ -840,7 +840,7 @@ static int curve_draw_exec(bContext *C, wmOperator *op)
 		unsigned int *corners = NULL;
 		unsigned int  corners_len = 0;
 
-		if (corner_angle < M_PI) {
+		if (corner_angle < (float)M_PI) {
 			/* this could be configurable... */
 			const float corner_radius_min = error_threshold / 8;
 			const float corner_radius_max = error_threshold * 2;
diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c
index 562bdec..8b4e95a 100644
--- a/source/blender/imbuf/intern/cineon/dpxlib.c
+++ b/source/blender/imbuf/intern/cineon/dpxlib.c
@@ -184,8 +184,8 @@ LogImageFile *dpxOpen(const unsigned char *byteStuff, int fromMemory, size_t buf
 	}
 	else {
 		if (verbose)  {
-			printf("DPX: Bad magic number %lu in \"%s\".\n",
-			       (uintptr_t)header.fileHeader.magic_num, byteStuff);
+			printf("DPX: Bad magic number %u in \"%s\".\n",
+			       header.fileHeader.magic_num, byteStuff);
 		}
 		logImageClose(dpx);
 		return NULL;




More information about the Bf-blender-cvs mailing list