From c242029cf774812df225a0915a82b6b7362658d8 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 6 Jan 2017 12:56:22 -0500 Subject: [PATCH] resolve widget-related float-equal warnings Reviewed-by: Derek Foreman --- src/bin/e_flowlayout.c | 2 +- src/bin/e_focus.c | 2 +- src/bin/e_slider.c | 6 +++--- src/bin/e_widget_filepreview.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/e_flowlayout.c b/src/bin/e_flowlayout.c index 535c2fbdd..3e76cf631 100644 --- a/src/bin/e_flowlayout.c +++ b/src/bin/e_flowlayout.c @@ -451,7 +451,7 @@ e_flowlayout_align_set(Evas_Object *obj, double ax, double ay) if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR(); sd = evas_object_smart_data_get(obj); if (!sd) return; - if ((sd->align.x == ax) && (sd->align.y == ay)) return; + if (EINA_DBL_CMP(sd->align.x, ax) && EINA_DBL_CMP(sd->align.y, ay)) return; sd->align.x = ax; sd->align.y = ay; sd->changed = 1; diff --git a/src/bin/e_focus.c b/src/bin/e_focus.c index 04f8bed04..fd39ad551 100644 --- a/src/bin/e_focus.c +++ b/src/bin/e_focus.c @@ -18,7 +18,7 @@ e_focus_event_mouse_in(E_Client *ec) E_FREE_FUNC(ec->raise_timer, ecore_timer_del); if (e_config->use_auto_raise) { - if (e_config->auto_raise_delay == 0.0) + if (eina_dbleq(e_config->auto_raise_delay, 0.0)) { if (!ec->lock_user_stacking) evas_object_raise(ec->frame); diff --git a/src/bin/e_slider.c b/src/bin/e_slider.c index c96dff897..ed560574e 100644 --- a/src/bin/e_slider.c +++ b/src/bin/e_slider.c @@ -374,7 +374,7 @@ _e_smart_signal_cb_drag(void *data, Evas_Object *obj EINA_UNUSED, const char *em _e_smart_value_limit(sd); _e_smart_format_update(sd); if (sd->changing) return; - if (sd->val != pval) + if (!EINA_DBL_CMP(sd->val, pval)) evas_object_smart_callback_call(sd->smart_obj, "changed", NULL); } @@ -388,7 +388,7 @@ _e_smart_signal_cb_drag_start(void *data, Evas_Object *obj EINA_UNUSED, const ch _e_smart_value_limit(sd); _e_smart_format_update(sd); if (sd->changing) return; - if (sd->val != pval) + if (!EINA_DBL_CMP(sd->val, pval)) evas_object_smart_callback_call(sd->smart_obj, "changed", NULL); } @@ -403,7 +403,7 @@ _e_smart_signal_cb_drag_stop(void *data, Evas_Object *obj EINA_UNUSED, const cha _e_smart_format_update(sd); _e_smart_value_update(sd); if (sd->changing) return; - if (sd->val != pval) + if (!EINA_DBL_CMP(sd->val, pval)) evas_object_smart_callback_call(sd->smart_obj, "changed", NULL); } diff --git a/src/bin/e_widget_filepreview.c b/src/bin/e_widget_filepreview.c index 26028952f..eff647ab5 100644 --- a/src/bin/e_widget_filepreview.c +++ b/src/bin/e_widget_filepreview.c @@ -232,7 +232,7 @@ _e_wid_fprev_preview_video_position(E_Widget_Data *wd, Evas_Object *obj, void *e if (!wd->o_preview_time) return; tot = emotion_object_play_length_get(obj); - if (!tot) return; + if (!EINA_DBL_NONZERO(tot)) return; wd->vid_pct = t = (emotion_object_position_get(obj) * 100.0) / emotion_object_play_length_get(obj); e_widget_slider_value_double_set(wd->o_preview_time, t); }