genlist: remove all compilation warnings of wearable profile. 27/103127/6
authorHermet Park <hermet@hermet.pe.kr>
Wed, 7 Dec 2016 09:38:59 +0000 (18:38 +0900)
committerHermet Park <chuneon.park@samsung.com>
Thu, 8 Dec 2016 05:58:34 +0000 (21:58 -0800)
Change-Id: Ieb753a820f224326926a6f7da5e1ce45083db277

src/mobile_lib/elm_genlist.c

index a65a140..2ba130a 100644 (file)
@@ -576,7 +576,7 @@ _adjust_item_align(Elm_Gen_Item *it)
    adjust_item = it;
    while (adjust_item && loop_count < 10)
      {
-        char *align = NULL;
+        const char *align = NULL;
         if (!VIEW(adjust_item))
           {
              _item_realize(adjust_item, EINA_TRUE);
@@ -1533,8 +1533,6 @@ _item_position(Elm_Gen_Item *it,
         int resize_hight = 0;
         float ratio = 0.0;
         double scale = 0.0;
-        char *vi_effect = NULL;
-        char *dim = NULL;
         double move_v[4] = {0.49, 0.99, 0.45, 1.0};
         double scale_v[4] = {0.49, 0.14, 1, 0.63};
 
@@ -1542,11 +1540,11 @@ _item_position(Elm_Gen_Item *it,
         int g_center = oy + oh / 2;
         int i_center = GL_IT(target)->scrl_y + GL_IT(target)->h / 2;
 
-        if (it->item->proxy && !ELM_RECTS_INTERSECT(ix, iy, iw, ih, ox, oy, ow, oh))
-          evas_object_hide(it->item->proxy);
+        if (target->item->proxy && !ELM_RECTS_INTERSECT(ix, iy, iw, ih, ox, oy, ow, oh))
+          evas_object_hide(target->item->proxy);
         else
           {
-             vi_effect = edje_object_data_get(VIEW(target), "vi_effect");
+             const char *vi_effect = edje_object_data_get(VIEW(target), "vi_effect");
              if (vi_effect && !strcmp(vi_effect, "on"))
                {
                   ratio = (float)abs(g_center - i_center) / (float)((oh / 2) + ih / 2);
@@ -1575,7 +1573,7 @@ _item_position(Elm_Gen_Item *it,
                   else
                     iy = GL_IT(target)->scrl_y;
 
-                  dim = edje_object_data_get(view, "dim");
+                  const char *dim = edje_object_data_get(view, "dim");
                   if (!dim || (dim && !strcmp(dim, "on")))
                     {
                        pre_multiplied_color = 255 * color >> 8;
@@ -1584,17 +1582,10 @@ _item_position(Elm_Gen_Item *it,
                        else
                          evas_object_color_set(target->item->proxy, 255, 255, 255, 255);
                     }
-
-                  evas_object_move(target->item->proxy, ix, iy);
-                  evas_object_resize(target->item->proxy, iw, ih);
-                  evas_object_show(target->item->proxy);
-               }
-             else
-               {
-                  evas_object_move(target->item->proxy, ix, iy);
-                  evas_object_resize(target->item->proxy, iw, ih);
-                  evas_object_show(target->item->proxy);
                }
+             evas_object_move(target->item->proxy, ix, iy);
+             evas_object_resize(target->item->proxy, iw, ih);
+             evas_object_show(target->item->proxy);
 
              if (!sd->on_hold &&
                  ELM_RECTS_INTERSECT(GL_IT(target)->scrl_x, GL_IT(target)->scrl_y,
@@ -1833,7 +1824,7 @@ _item_realize(Elm_Gen_Item *it,
    _view_inflate(VIEW(it), it, &it->content_objs);
    if (wd->scroll_item_align_enable && !calc)
      {
-        char *vi_effect = edje_object_data_get(VIEW(it), "vi_effect");
+        const char *vi_effect = edje_object_data_get(VIEW(it), "vi_effect");
         if (vi_effect && !strcmp(vi_effect, "on"))
           {
              Evas_Object *clip = evas_object_clip_get(VIEW(it));
@@ -2993,7 +2984,7 @@ _item_highlight(Elm_Gen_Item *it)
 }
 
 static void
-_item_unhighlight(Elm_Gen_Item *it, Eina_Bool effect)
+_item_unhighlight(Elm_Gen_Item *it, Eina_Bool effect EINA_UNUSED)
 {
    ELM_WIDGET_DATA_GET_OR_RETURN(WIDGET(it), wsd);
    if (!it->highlighted) return;
@@ -5252,7 +5243,7 @@ _item_mouse_up_cb(void *data,
           {
              if (wd->scroll_item_align_enable)
                {
-                  char *align = edje_object_data_get(VIEW(it), "align");
+                  const char *align = edje_object_data_get(VIEW(it), "align");
                   if (!align || strcmp(align, "off"))
                     {
                        if (it != sd->aligned_item)
@@ -6278,8 +6269,7 @@ _item_free(Elm_Gen_Item *it)
    if (sd->filter_queue && !it->filtered)
      {
         l = eina_list_data_find_list(sd->filter_queue, it);
-        if (l)
-          sd->filter_queue = eina_list_remove_list(sd->filter_queue, l);
+        if (l) sd->filter_queue = eina_list_remove_list(sd->filter_queue, l);
      }
    if (GL_IT(it)->type == ELM_GENLIST_ITEM_GROUP)
       sd->group_items = eina_list_remove(sd->group_items, it);
@@ -6392,9 +6382,9 @@ end:
 
    if (it->itc->refcount <= 1)
      {
-        Eina_Inlist *l;
+        Eina_Inlist *l2;
         Item_Cache *ic;
-        EINA_INLIST_FOREACH_SAFE(sd->item_cache, l, ic)
+        EINA_INLIST_FOREACH_SAFE(sd->item_cache, l2, ic)
           {
              if (it->itc == ic->item_class)
                _item_cache_free(sd, ic);
@@ -8703,9 +8693,10 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
         Evas_Coord wy, wh, y, h;
         evas_object_geometry_get(WIDGET(it), NULL, &wy, NULL, &wh);
         evas_object_geometry_get(VIEW(it), NULL, &y, NULL, &h);
-        int res = _is_item_in_viewport(wy, wh, y, h);
         //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
 #ifndef TIZEN_PROFILE_WEARABLE
+        int res = _is_item_in_viewport(wy, wh, y, h);
+
         if (res > 0)
           {
              // new item is above current
@@ -8725,19 +8716,18 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
       }
    else // if item is not realized we should search if we are over or below viewport
      {
-        Eina_List *realized;
-        int idx, top, bottom;
-        realized = elm_genlist_realized_items_get(WIDGET(it));
+        Eina_List *realized = elm_genlist_realized_items_get(WIDGET(it));
         if (realized)
           {
+#ifndef TIZEN_PROFILE_WEARABLE
+             int idx, top, bottom;
+
              // index of realized element on top of viewport
              eo_do(eina_list_nth(realized, 0), top = elm_obj_genlist_item_index_get());
              // index of realized element on bottom of viewport
              eo_do(eina_list_last_data_get(realized), bottom = elm_obj_genlist_item_index_get());
              eo_do(eo_it, idx = elm_obj_genlist_item_index_get());
-             eina_list_free(realized);
              //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile
-#ifndef TIZEN_PROFILE_WEARABLE
              if (idx < top)
                elm_genlist_item_show(eo_it, ELM_GENLIST_ITEM_SCROLLTO_BOTTOM);
              else if (idx > bottom)
@@ -8747,7 +8737,7 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
 #else
              elm_genlist_item_bring_in(eo_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
 #endif
-             //
+             eina_list_free(realized);
           }
      }
 
@@ -8772,7 +8762,7 @@ _elm_genlist_item_elm_interface_atspi_component_highlight_grab(Eo *eo_it, Elm_Ge
 }
 
 EOLIAN static Eina_Bool
-_elm_genlist_item_elm_interface_atspi_component_highlight_clear(Eo *eo_it, Elm_Gen_Item *it)
+_elm_genlist_item_elm_interface_atspi_component_highlight_clear(Eo *eo_it EINA_UNUSED, Elm_Gen_Item *it)
 {
    ELM_GENLIST_DATA_GET(WIDGET(it), sd);
    //TIZEN_ONLY(20161104) : Accessibility : synchronized highlight of atspi and item align feature for wearable profile