emotion: remove float comparison warnings
authorChris Michael <cp.michael@samsung.com>
Tue, 20 Dec 2016 16:13:40 +0000 (11:13 -0500)
committerChris Michael <cp.michael@samsung.com>
Tue, 20 Dec 2016 16:13:40 +0000 (11:13 -0500)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/emotion/emotion_smart.c
src/modules/emotion/gstreamer1/emotion_sink.c
src/modules/emotion/xine/emotion_xine.c

index 5ea48bb..8add122 100644 (file)
@@ -1540,8 +1540,8 @@ _emotion_video_pos_update(Evas_Object *obj, double pos, double len)
    int npos = 0, nlen = 0;
 
    E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
-   if (pos != sd->pos) npos = 1;
-   if (len != sd->len) nlen = 1;
+   if (!EINA_DBL_CMP(pos, sd->pos)) npos = 1;
+   if (!EINA_DBL_CMP(len, sd->len)) nlen = 1;
    sd->pos = pos;
    sd->len = len;
    if (npos)
@@ -1573,8 +1573,8 @@ _emotion_frame_resize(Evas_Object *obj, int w, int h, double ratio)
      }
    if (h > 0) tmp  = (double)w / (double)h;
    else tmp = 1.0;
-   if (ratio != tmp) tmp = ratio;
-   if (tmp != sd->ratio)
+   if (!EINA_DBL_CMP(ratio, tmp)) tmp = ratio;
+   if (!EINA_DBL_CMP(tmp, sd->ratio))
      {
         sd->ratio = tmp;
         changed = 1;
@@ -1619,7 +1619,7 @@ _emotion_open_done(Evas_Object *obj)
    E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
    sd->open = 1;
 
-   if (sd->remember_jump)
+   if (!EINA_DBL_CMP(sd->remember_jump, 0.0))
      emotion_object_position_set(obj, sd->remember_jump);
    if (sd->remember_play != sd->play)
      emotion_object_play_set(obj, sd->remember_play);
@@ -1737,7 +1737,8 @@ _emotion_frame_refill(Evas_Object *obj, double w, double h)
    Efl_Canvas_Video_Data *sd;
 
    E_SMART_OBJ_GET(sd, obj, E_OBJ_NAME);
-   if ((sd->fill.w != w) || (sd->fill.h != h))
+   if ((!EINA_DBL_CMP(sd->fill.w, w)) ||
+       (!EINA_DBL_CMP(sd->fill.h, h)))
      {
         Evas_Coord ow, oh;
 
index f897d37..c31f365 100644 (file)
@@ -345,7 +345,7 @@ _update_emotion_fps(EmotionVideoSinkPrivate *priv)
    tim = ecore_time_get();
    priv->frames++;
 
-   if (priv->rlapse == 0.0)
+   if (EINA_DBL_CMP(priv->rlapse, 0.0))
      {
         priv->rlapse = tim;
         priv->flapse = priv->frames;
index 4a9ac91..d7bf569 100644 (file)
@@ -196,7 +196,7 @@ _em_slave(void *par)
                       
                       pos = *((double *)eev->xine_event);
                       if ((xine_get_param(ev->stream, XINE_PARAM_SPEED) == XINE_SPEED_PAUSE) &&
-                          (pos == ev->pos) &&
+                          (EINA_DBL_CMP(pos, ev->pos)) &&
                           (!ev->just_loaded))
                         {
                            xine_set_param(ev->stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL);
@@ -1324,7 +1324,7 @@ _em_fd_ev_active(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh)
                       ev->play_ok = 1;
                       break;
                      case 15: /* get pos done */
-                       if (ev->last_pos != ev->pos)
+                       if (!EINA_DBL_CMP(ev->last_pos, ev->pos))
                          {
                             ev->last_pos = ev->pos;
                             _emotion_video_pos_update(ev->obj, ev->pos, ev->len);