seoz pushed a commit to branch master.

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

commit f45116c4f78303b9798aa9b4bdc91199532be410
Author: Daniel Juyung Seo <seojuyu...@gmail.com>
Date:   Wed Nov 20 10:44:07 2013 +0900

    genlist_example_04/05.c: initialize pointer variables and check null.
    
    This removes build warnings.
---
 src/examples/genlist_example_04.c | 2 +-
 src/examples/genlist_example_05.c | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/examples/genlist_example_04.c 
b/src/examples/genlist_example_04.c
index 090c9d0..e62dde2 100644
--- a/src/examples/genlist_example_04.c
+++ b/src/examples/genlist_example_04.c
@@ -300,7 +300,7 @@ elm_main(int argc, char **argv)
 
    for (i = 0; i < N_ITEMS; i++)
      {
-        Elm_Object_Item *gli, *glg;
+        Elm_Object_Item *gli = NULL, *glg = NULL;
 
         if (i % 7 == 0)
           {
diff --git a/src/examples/genlist_example_05.c 
b/src/examples/genlist_example_05.c
index 7f1b095..03ac142 100644
--- a/src/examples/genlist_example_05.c
+++ b/src/examples/genlist_example_05.c
@@ -370,14 +370,14 @@ elm_main(int argc, char **argv)
 
    for (i = 0; i < N_ITEMS; i++)
      {
-        Elm_Object_Item *gli, *glg;
+        Elm_Object_Item *gli = NULL, *glg = NULL;
         Node_Data *data = malloc(sizeof(*data)); // data for this item
         data->children = NULL;
         data->value = i;
         data->favorite = EINA_FALSE;
         nitems++;
 
-        Node_Data *pdata; // data for the parent of the group
+        Node_Data *pdata = NULL; // data for the parent of the group
 
         printf("creating item: #%d\n", data->value);
         if (i % 3 == 0)
@@ -394,7 +394,8 @@ elm_main(int argc, char **argv)
              gli = elm_genlist_item_append(list, _itc, data, glg,
                                            ELM_GENLIST_ITEM_NONE,
                                            _item_sel_cb, NULL);
-             pdata->children = eina_list_append(pdata->children, data);
+             if (pdata)
+               pdata->children = eina_list_append(pdata->children, data);
              data->level = 1;
           }
      }

-- 


Reply via email to