sanghyeonlee pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=ae863aa43ff7d712417b8fe6f2e190e06e982864

commit ae863aa43ff7d712417b8fe6f2e190e06e982864
Author: Shashank Pandey <shashan...@samsung.com>
Date:   Thu Sep 24 16:42:37 2015 +0900

    [Genlist] Added correct container_get callback for filter iterator.
    
    Summary: Warning fixed: Container_get mechanism was wrong. Fixed it.
    
    Test Plan: elementary_test => Genlist => Genlist filter
    
    Reviewers: singh.amitesh, cedric, shilpasingh, SanghyeonLee
    
    Subscribers: shilpasingh
    
    Differential Revision: https://phab.enlightenment.org/D3105
---
 AUTHORS                      |  1 +
 src/lib/elm_genlist.c        | 16 ++++++++++++----
 src/lib/elm_widget_genlist.h |  2 +-
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 404439a..eefcd81 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -165,3 +165,4 @@ Ji-In Moon <jiin.m...@samsung.com>
 Subodh Kumar <s7158.ku...@samsung.com>
 Kumar Navneet <k.navn...@samsung.com>
 Godly T Alias <godly.tal...@samsung.com>
+Shashank Pandey <shashan...@samsung.com> <shashank0...@gmail.com>
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 95cb440..92e4705 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -7535,7 +7535,7 @@ _filter_iterator_next(Elm_Genlist_Filter *iter, void 
**data)
    Elm_Gen_Item *item;
    while (iter->current)
      {
-        item = ELM_GENLIST_FILTER_CONTAINER_GET(iter->current, Elm_Gen_Item);
+        item = ELM_GENLIST_FILTER_ITERATOR_ITEM_GET(iter->current, 
Elm_Gen_Item);
         iter->current = iter->current->next;
         if (_item_filtered_get(item))
           {
@@ -7549,9 +7549,16 @@ _filter_iterator_next(Elm_Genlist_Filter *iter, void 
**data)
 }
 
 static void
-_filter_iterator_free(Elm_Genlist_Filter *it)
+_filter_iterator_free(Elm_Genlist_Filter *iter)
 {
-   free(it);
+   free(iter);
+}
+
+static Evas_Object *
+_filter_iterator_get_container(Elm_Genlist_Filter *iter)
+{
+   Elm_Gen_Item *it = ELM_GENLIST_FILTER_ITERATOR_ITEM_GET(iter->head, 
Elm_Gen_Item);
+   return WIDGET(it);
 }
 
 EOLIAN Eina_Iterator *
@@ -7566,7 +7573,8 @@ _elm_genlist_filter_iterator_new(Eo *obj EINA_UNUSED, 
Elm_Genlist_Data *sd)
 
    iter->iterator.version = EINA_ITERATOR_VERSION;
    iter->iterator.next = FUNC_ITERATOR_NEXT(_filter_iterator_next);
-   iter->iterator.get_container = sd->obj;
+   iter->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(
+                                    _filter_iterator_get_container);
    iter->iterator.free = FUNC_ITERATOR_FREE(_filter_iterator_free);
 
    EINA_MAGIC_SET(&iter->iterator, EINA_MAGIC_ITERATOR);
diff --git a/src/lib/elm_widget_genlist.h b/src/lib/elm_widget_genlist.h
index 92c384a..dbd392e 100644
--- a/src/lib/elm_widget_genlist.h
+++ b/src/lib/elm_widget_genlist.h
@@ -299,7 +299,7 @@ struct _Elm_Genlist_Filter
    const Eina_Inlist *current;
 };
 
-#define ELM_GENLIST_FILTER_CONTAINER_GET(ptr,                          \
+#define ELM_GENLIST_FILTER_ITERATOR_ITEM_GET(ptr,                 \
                                   type) ((type *)((char *)ptr - \
                                                   offsetof(type, __in_list)))
 

-- 


Reply via email to