Cleanup: warnings (double promote, string format)
authorCampbell Barton <ideasman42@gmail.com>
Fri, 22 Apr 2016 02:18:57 +0000 (12:18 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 22 Apr 2016 02:22:58 +0000 (12:22 +1000)
source/blender/blenkernel/intern/particle_distribute.c
source/blender/editors/curve/editcurve_paint.c
source/blender/imbuf/intern/cineon/dpxlib.c

index 9185c0964b9b224e6498e3f54b3c2a53c4b95ac0..f1dfed0f0e663328dbcd8e50dd533d05d05eca4c 100644 (file)
@@ -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++);
index 5c74a3e43c24af7ae31f5b68d6a7ae929b7711ea..5a4cd871feb8c8518fb654258ca3c95e717f6a2c 100644 (file)
@@ -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;
index 562bdecb8427928776b1a283d0e570abc04bda65..8b4e95ac4522d0e7c35c1752c589deb4ebefaf9c 100644 (file)
@@ -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;