From 77a7d6d9e51be600e48a4c04c49636f37dde43ed Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Mon, 19 Dec 2016 16:33:19 -0800 Subject: [PATCH] ecore: remove float comparison warning from Ecore_Animator code. --- src/lib/ecore/ecore_anim.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c index c4197fa..a60c159 100644 --- a/src/lib/ecore/ecore_anim.c +++ b/src/lib/ecore/ecore_anim.c @@ -196,7 +196,7 @@ _timer_tick_core(void *data EINA_UNUSED, Ecore_Thread *thread) d = fmod(t0, ft); if (tick) { - if (pframetime != ft) + if (!EINA_FLT_CMP(pframetime, ft)) { t = (ft - d) * 1000000000.0; t_ft = ft * 1000000000.0; @@ -661,7 +661,7 @@ _cubic_bezier_t_get(double a, for (int i = 0; i < LIMIT; i++) { current_slope = _cubic_bezier_slope_get(guess_t, x1, x2); - if (current_slope == 0.0) return guess_t; + if (EINA_FLT_CMP(current_slope, 0.0)) return guess_t; current_x = _cubic_bezier_calc(guess_t, x1, x2) - a; change = current_x / current_slope; guess_t -= change; @@ -677,8 +677,10 @@ _pos_map_cubic_bezier(double pos, double x2, double y2) { - if (x1 == y1 && x2 == y2) return pos; - return _cubic_bezier_calc(_cubic_bezier_t_get(pos, x1, x2), y1, y2); + if (EINA_FLT_CMP(x1, y1) && + EINA_FLT_CMP(x2, y2)) + return pos; + return _cubic_bezier_calc(_cubic_bezier_t_get(pos, x1, x2), y1, y2); } #define DBL_TO(Fp) eina_f32p32_double_to(Fp) @@ -817,7 +819,7 @@ ecore_animator_frametime_set(double frametime) { EINA_MAIN_LOOP_CHECK_RETURN; if (frametime < 0.0) frametime = 0.0; - if (animators_frametime == frametime) return ; + if (EINA_FLT_CMP(animators_frametime, frametime)) return ; animators_frametime = frametime; _end_tick(); if (_have_animators()) _begin_tick(); -- 2.7.4