Cleanup: double-promotion warnings
authorCampbell Barton <ideasman42@gmail.com>
Sat, 25 Jul 2015 03:26:20 +0000 (13:26 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 25 Jul 2015 03:26:20 +0000 (13:26 +1000)
source/blender/bmesh/operators/bmo_join_triangles.c
source/blender/bmesh/operators/bmo_subdivide.c
source/blender/bmesh/tools/bmesh_bevel.c
source/blender/bmesh/tools/bmesh_decimate_collapse.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/curve/editcurve_select.c
source/blender/editors/interface/interface_panel.c
source/blender/windowmanager/intern/wm_operators.c

index b873e6bacb360d5a614c2bc8fc0b7ec13fbf6006..3718f14276c3a3c42596c21155a099a5054a01fa 100644 (file)
@@ -105,7 +105,7 @@ static float quad_calc_error(
                area_min = min_ff(area_a, area_b);
                area_max = max_ff(area_a, area_b);
 
-               diff = area_max ? (1.0 - (area_min / area_max)) : 1.0f;
+               diff = area_max ? (1.0f - (area_min / area_max)) : 1.0f;
 
                error += diff;
        }
index e3304298647f30cbbdbb4fd5f8c25a94c6e5c298..45e3c8d193d1128d1739ee8cde92fc607b3c0c5f 100644 (file)
@@ -184,7 +184,7 @@ static void alter_co(
                float fac, len, val;
 
                sub_v3_v3v3(dir, v_a->co, v_b->co);
-               len = M_SQRT1_2 * normalize_v3(dir);
+               len = (float)M_SQRT1_2 * normalize_v3(dir);
 
                /* cosine angle */
                fac = dot_v3v3(dir, v_a->no);
index 308c187048a03c8c867fc23681037e830caf97c7..b47f56d1cb421f4ed39f2943ca3b8f2bb4f6148b 100644 (file)
@@ -758,7 +758,7 @@ static void offset_meet(EdgeHalf *e1, EdgeHalf *e2, BMVert *v, BMFace *f, bool e
                                copy_v3_v3(meetco, closer_v->co);
                                e1->offset_r = len_v3v3(meetco, v->co);
                        }
-                       if (edges_between && e1->offset_r > 0.0 && e2->offset_l > 0.0) {
+                       if (edges_between && e1->offset_r > 0.0f && e2->offset_l > 0.0f) {
                                /* Try to drop meetco to a face between e1 and e2 */
                                if (isect_kind == 2) {
                                        /* lines didn't meet in 3d: get average of meetco and isect2 */
index c3533245d9bf2e82f7b6c3a80ad8bd4cf4b90e1d..43a34331fc230f670ad4b1409fda67b6869fdcf2 100644 (file)
@@ -111,7 +111,7 @@ static void bm_decim_build_quadrics(BMesh *bm, Quadric *vquadrics)
                        cross_v3_v3v3(edge_plane, edge_vector, f->no);
                        copy_v3db_v3fl(edge_plane_db, edge_plane);
 
-                       if (normalize_v3_d(edge_plane_db) > FLT_EPSILON) {
+                       if (normalize_v3_d(edge_plane_db) > (double)FLT_EPSILON) {
                                Quadric q;
                                float center[3];
 
index 498086047adb4f241d6b9fe165fa9e55603fa910..33a5447698a03900d0be8a0111f4c420c51148a5 100644 (file)
@@ -494,11 +494,14 @@ void ANIM_center_frame(struct bContext *C, int smooth_viewtx)
 
        switch (U.view_frame_type) {
                case ZOOM_FRAME_MODE_SECONDS:
-                       newrct.xmax = scene->r.cfra + U.view_frame_seconds * FPS + 1;
-                       newrct.xmin = scene->r.cfra - U.view_frame_seconds * FPS - 1;
+               {
+                       const float fps = FPS;
+                       newrct.xmax = scene->r.cfra + U.view_frame_seconds * fps + 1;
+                       newrct.xmin = scene->r.cfra - U.view_frame_seconds * fps - 1;
                        newrct.ymax = ar->v2d.cur.ymax;
                        newrct.ymin = ar->v2d.cur.ymin;
                        break;
+               }
 
                /* hardest case of all, look for all keyframes around frame and display those */
                case ZOOM_FRAME_MODE_KEYFRAMES:
index ef7097deb4c599c91856c42860f02da82d06bd87..55d8d10856b3f37dcf2f86b2514eb9a223ce48eb 100644 (file)
@@ -1285,7 +1285,7 @@ static bool curve_select_similar_direction(ListBase *editnurb, Curve *cu, float
        }
 
        /* map 0-1 to radians, 'cos' for comparison */
-       angle_cos = cosf(thresh * M_PI_2);
+       angle_cos = cosf(thresh * (float)M_PI_2);
 
        for (nu = editnurb->first; nu; nu = nu->next) {
                if (nu->type == CU_BEZIER) {
index 665266edb9fdf95b8176c9066f51e15cc408c7c1..c69aed76b22c6b1c41deb4151b44f40ebf2cd589 100644 (file)
@@ -1061,7 +1061,6 @@ void UI_panels_scale(ARegion *ar, float new_width)
        for (block = ar->uiblocks.first; block; block = block->next) {
                if (block->panel) {
                        float fac = new_width / (float)block->panel->sizex;
-                       printf("scaled %f\n", fac);
                        block->panel->sizex = new_width;
                        
                        for (but = block->buttons.first; but; but = but->next) {
index 514fafca71f64e605d830e9960ff49b0e33c9b20..cab9b02d83005d7a70832d02e4e57145c13e551e 100644 (file)
@@ -4486,7 +4486,7 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even
                                                        break;
                                                case PROP_PERCENTAGE:
                                                        new_value = ((dist - WM_RADIAL_CONTROL_DISPLAY_MIN_SIZE) / WM_RADIAL_CONTROL_DISPLAY_WIDTH) * 100.0f;
-                                                       if (snap) new_value = ((int)(new_value + 2.5)) / 5 * 5;
+                                                       if (snap) new_value = ((int)(new_value + 2.5f)) / 5 * 5;
                                                        break;
                                                case PROP_FACTOR:
                                                        new_value = (WM_RADIAL_CONTROL_DISPLAY_SIZE - dist) / WM_RADIAL_CONTROL_DISPLAY_WIDTH;
@@ -4734,7 +4734,7 @@ static int redraw_timer_exec(bContext *C, wmOperator *op)
                redraw_timer_step(C, bmain, scene, win, sa, ar, type, cfra);
                iter_steps += 1;
 
-               if (time_limit != 0.0f) {
+               if (time_limit != 0.0) {
                        if ((PIL_check_seconds_timer() - time_start) > time_limit) {
                                break;
                        }