resolve efx float-equal warnings

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
Mike Blumenkrantz 2017-01-06 12:56:22 -05:00
parent aeb8851c9d
commit 5268ac6500
8 changed files with 15 additions and 13 deletions

View File

@ -164,7 +164,7 @@ e_efx_fade(Evas_Object *obj, E_Efx_Effect_Speed speed, E_Efx_Color *ec, unsigned
INF("fade: %p || %d/%d/%d/%d => %d/%d/%d/%d %s over %gs", obj, efd->start.r, efd->start.g, efd->start.b, efd->alpha[0], efd->color.r, efd->color.g, efd->color.b, efd->alpha[1], e_efx_speed_str[speed], total_time);
if (efd->anim) ecore_animator_del(efd->anim);
efd->anim = NULL;
if (total_time)
if (!eina_dbleq(total_time, 0))
efd->anim = ecore_animator_timeline_add(total_time, (Ecore_Timeline_Cb)_fade_cb, efd);
else
_fade_cb(efd, 1.0);

View File

@ -147,7 +147,7 @@ e_efx_move(Evas_Object *obj, E_Efx_Effect_Speed speed, const Evas_Point *end_poi
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
INF("move: %p - (%d,%d) -> (%d,%d) over %gs: %s", obj, x, y, end_point->x, end_point->y, total_time, e_efx_speed_str[speed]);
if (!total_time)
if (eina_dbleq(total_time, 0))
{
evas_object_move(obj, end_point->x, end_point->y);
return EINA_TRUE;
@ -193,7 +193,7 @@ e_efx_move_circle(Evas_Object *obj, E_Efx_Effect_Speed speed, const Evas_Point *
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
INF("move: %p - (%d,%d) %d over %gs: %s", obj, x, y, degrees, total_time, e_efx_speed_str[speed]);
if (!total_time)
if (eina_dbleq(total_time, 0))
{
// evas_object_move(obj, end_point->x, end_point->y);
return EINA_TRUE;

View File

@ -372,7 +372,7 @@ e_efx_pan(Evas_Object *obj, E_Efx_Effect_Speed speed, const Evas_Point *distance
epd->e = e;
_smart_pan_get(epd->pan, &x, &y);
INF("pan: %p - (%d,%d) += (%d,%d) over %gs: %s", obj, x, y, distance->x, distance->y, total_time, e_efx_speed_str[speed]);
if (!total_time)
if (eina_dbleq(total_time, 0))
{
_smart_pan_set(epd->pan, x + distance->x, y + distance->y);
return EINA_TRUE;

View File

@ -225,7 +225,7 @@ e_efx_resize(Evas_Object *obj, E_Efx_Effect_Speed speed, const Evas_Point *posit
else
evas_object_move(obj, position->x, position->y);
}
if (total_time)
if (!eina_dbleq(total_time, 0))
erd->anim = ecore_animator_timeline_add(total_time, (Ecore_Timeline_Cb)_resize_cb, erd);
else
_resize_cb(erd, 1.0);

View File

@ -86,7 +86,7 @@ e_efx_rotate(Evas_Object *obj, E_Efx_Effect_Speed speed, double degrees, const E
E_Efx_Rotate_Data *erd;
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE);
if (!degrees) return EINA_FALSE;
if (eina_dbleq(degrees, 0)) return EINA_FALSE;
if (total_time < 0.0) return EINA_FALSE;
if (speed > E_EFX_EFFECT_SPEED_SINUSOIDAL) return EINA_FALSE;
/* can't rotate a spinning object, so we stop it first */
@ -121,7 +121,7 @@ e_efx_rotate(Evas_Object *obj, E_Efx_Effect_Speed speed, double degrees, const E
erd->start_degrees = e->map_data.rotation;
erd->cb = cb;
erd->data = (void*)data;
if (!total_time)
if (eina_dbleq(total_time, 0))
{
e->map_data.rotation += degrees;
_rotate_cb(erd, 1.0);

View File

@ -47,7 +47,7 @@ _spin_cb(E_Efx_Spin_Data *esd)
if (esd->frame % (int)fps == 0)
DBG("frame: %u || rotate: %g", esd->frame, esd->e->map_data.rotation);
*/
if (!fmod(esd->e->map_data.rotation, 360.0)) esd->frame = 0;
if (eina_dbleq(fmod(esd->e->map_data.rotation, 360.0), 0)) esd->frame = 0;
esd->frame++; /* FIXME: this may overflow */
return EINA_TRUE;

View File

@ -32,7 +32,7 @@ e_efx_realize(Evas_Object *obj)
evas_map_point_coord_get(map, 2, &p2.x, &p2.y, NULL);
x = lround((double)(p1.x + p2.x) / 2.);
y = lround((double)(p1.y + p2.y) / 2.);
if (e->map_data.zoom)
if (!eina_dbleq(e->map_data.zoom, 0))
zw = e->map_data.zoom * w, zh = e->map_data.zoom * h;
else
zw = w, zh = h;

View File

@ -132,7 +132,9 @@ e_efx_zoom(Evas_Object *obj, E_Efx_Effect_Speed speed, double starting_zoom, dou
if (!e) e = e_efx_new(obj);
EINA_SAFETY_ON_NULL_RETURN_VAL(e, EINA_FALSE);
if (!e_efx_zoom_center_init(e, zoom_point)) return EINA_FALSE;
INF("zoom: %p - %g%%->%g%% over %gs: %s", obj, (starting_zoom ?: e->map_data.zoom) * 100.0, ending_zoom * 100.0, total_time, e_efx_speed_str[speed]);
INF("zoom: %p - %g%%->%g%% over %gs: %s", obj,
((!eina_dbleq(starting_zoom, 0)) ? starting_zoom : e->map_data.zoom) * 100.0,
ending_zoom * 100.0, total_time, e_efx_speed_str[speed]);
if (!e->zoom_data)
{
e->zoom_data = calloc(1, sizeof(E_Efx_Zoom_Data));
@ -143,15 +145,15 @@ e_efx_zoom(Evas_Object *obj, E_Efx_Effect_Speed speed, double starting_zoom, dou
ezd->e = e;
ezd->speed = speed;
ezd->ending_zoom = ending_zoom;
ezd->starting_zoom = starting_zoom ?: ezd->e->map_data.zoom;
ezd->starting_zoom = (!eina_dbleq(starting_zoom, 0)) ? starting_zoom : ezd->e->map_data.zoom;
ezd->cb = cb;
ezd->data = (void*)data;
if (!total_time)
if (!eina_dbleq(total_time, 0))
{
_zoom_cb(ezd, 1.0);
return EINA_TRUE;
}
if (!ezd->starting_zoom) ezd->starting_zoom = 1.0;
if (!eina_dbleq(ezd->starting_zoom, 0)) ezd->starting_zoom = 1.0;
_zoom_cb(ezd, 0);
if (ezd->anim) ecore_animator_del(ezd->anim);
ezd->anim = ecore_animator_timeline_add(total_time, (Ecore_Timeline_Cb)_zoom_cb, ezd);