Cleanup: double-promotion warnings

This commit is contained in:
2015-07-25 13:26:20 +10:00
parent 2a286829f7
commit e301cf3ec2
8 changed files with 12 additions and 10 deletions

View 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;
}

View 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);

View 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 */

View 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];

View 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:

View 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) {

View 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) {

View 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;
}