summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChinmaya Panigrahi <chinmaya061@gmail.com>2014-01-01 14:11:50 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-01-02 08:38:43 +0900
commit815e7db3a53d674d6712fd84f1b674c406592f53 (patch)
treead55c4d95b401aec634f0fdef437f727f251af90 /src
parentbc2a5d828583ea96044514cf58bcc22b0173f04d (diff)
[Genlist]: Added NULL check
Summary: Added NULL check Test Plan: elementary_test -to genlist Reviewers: seoz, singh.amitesh, raster Reviewed By: raster Differential Revision: https://phab.enlightenment.org/D432
Diffstat (limited to 'src')
-rw-r--r--src/lib/elm_genlist.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index c43241953..3d7214bcb 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -2683,14 +2683,14 @@ static void
2683_elm_genlist_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list) 2683_elm_genlist_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
2684{ 2684{
2685 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 2685 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
2686 *ret = _elm_genlist_smart_focus_next_enable; 2686 if (ret) *ret = _elm_genlist_smart_focus_next_enable;
2687} 2687}
2688 2688
2689static void 2689static void
2690_elm_genlist_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list) 2690_elm_genlist_smart_focus_direction_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list)
2691{ 2691{
2692 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 2692 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
2693 *ret = EINA_FALSE; 2693 if (ret) *ret = EINA_FALSE;
2694} 2694}
2695 2695
2696static void 2696static void
@@ -5414,7 +5414,7 @@ _items_count(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5414 unsigned int *ret = va_arg(*list, unsigned int *); 5414 unsigned int *ret = va_arg(*list, unsigned int *);
5415 Elm_Genlist_Smart_Data *sd = _pd; 5415 Elm_Genlist_Smart_Data *sd = _pd;
5416 5416
5417 *ret = sd->item_count; 5417 if (ret) *ret = sd->item_count;
5418} 5418}
5419 5419
5420EAPI Elm_Object_Item * 5420EAPI Elm_Object_Item *
@@ -5445,7 +5445,7 @@ _item_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5445 const void *func_data = va_arg(*list, const void *); 5445 const void *func_data = va_arg(*list, const void *);
5446 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **); 5446 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
5447 Elm_Genlist_Smart_Data *sd = _pd; 5447 Elm_Genlist_Smart_Data *sd = _pd;
5448 *ret = NULL; 5448 if (ret) *ret = NULL;
5449 5449
5450 it = _elm_genlist_item_new 5450 it = _elm_genlist_item_new
5451 (sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data); 5451 (sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
@@ -5475,7 +5475,7 @@ _item_append(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5475 it->item->before = EINA_FALSE; 5475 it->item->before = EINA_FALSE;
5476 _item_queue(sd, it, NULL); 5476 _item_queue(sd, it, NULL);
5477 5477
5478 *ret = (Elm_Object_Item *)it; 5478 if (ret) *ret = (Elm_Object_Item *)it;
5479} 5479}
5480 5480
5481EAPI Elm_Object_Item * 5481EAPI Elm_Object_Item *
@@ -5506,7 +5506,7 @@ _item_prepend(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5506 const void *func_data = va_arg(*list, const void *); 5506 const void *func_data = va_arg(*list, const void *);
5507 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **); 5507 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
5508 Elm_Genlist_Smart_Data *sd = _pd; 5508 Elm_Genlist_Smart_Data *sd = _pd;
5509 *ret = NULL; 5509 if (ret) *ret = NULL;
5510 5510
5511 it = _elm_genlist_item_new 5511 it = _elm_genlist_item_new
5512 (sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data); 5512 (sd, itc, data, (Elm_Gen_Item *)parent, type, func, func_data);
@@ -5536,7 +5536,7 @@ _item_prepend(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5536 it->item->before = EINA_TRUE; 5536 it->item->before = EINA_TRUE;
5537 _item_queue(sd, it, NULL); 5537 _item_queue(sd, it, NULL);
5538 5538
5539 *ret = (Elm_Object_Item *)it; 5539 if (ret) *ret = (Elm_Object_Item *)it;
5540} 5540}
5541 5541
5542EAPI Elm_Object_Item * 5542EAPI Elm_Object_Item *
@@ -5570,7 +5570,7 @@ _item_insert_after(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5570 Elm_Gen_Item *after = (Elm_Gen_Item *)after_it; 5570 Elm_Gen_Item *after = (Elm_Gen_Item *)after_it;
5571 Elm_Gen_Item *it; 5571 Elm_Gen_Item *it;
5572 5572
5573 *ret = NULL; 5573 if (ret) *ret = NULL;
5574 5574
5575 ELM_GENLIST_ITEM_CHECK(after_it); 5575 ELM_GENLIST_ITEM_CHECK(after_it);
5576 Elm_Genlist_Smart_Data *sd = _pd; 5576 Elm_Genlist_Smart_Data *sd = _pd;
@@ -5602,7 +5602,7 @@ _item_insert_after(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5602 it->item->before = EINA_FALSE; 5602 it->item->before = EINA_FALSE;
5603 _item_queue(sd, it, NULL); 5603 _item_queue(sd, it, NULL);
5604 5604
5605 *ret = (Elm_Object_Item *)it; 5605 if (ret) *ret = (Elm_Object_Item *)it;
5606} 5606}
5607 5607
5608EAPI Elm_Object_Item * 5608EAPI Elm_Object_Item *
@@ -5635,7 +5635,7 @@ _item_insert_before(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5635 Elm_Gen_Item *before = (Elm_Gen_Item *)before_it; 5635 Elm_Gen_Item *before = (Elm_Gen_Item *)before_it;
5636 Elm_Gen_Item *it; 5636 Elm_Gen_Item *it;
5637 5637
5638 *ret = NULL; 5638 if (ret) *ret = NULL;
5639 5639
5640 ELM_GENLIST_ITEM_CHECK(before_it); 5640 ELM_GENLIST_ITEM_CHECK(before_it);
5641 Elm_Genlist_Smart_Data *sd = _pd; 5641 Elm_Genlist_Smart_Data *sd = _pd;
@@ -5666,7 +5666,7 @@ _item_insert_before(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5666 it->item->before = EINA_TRUE; 5666 it->item->before = EINA_TRUE;
5667 _item_queue(sd, it, NULL); 5667 _item_queue(sd, it, NULL);
5668 5668
5669 *ret = (Elm_Object_Item *)it; 5669 if (ret) *ret = (Elm_Object_Item *)it;
5670} 5670}
5671 5671
5672EAPI Elm_Object_Item * 5672EAPI Elm_Object_Item *
@@ -5699,7 +5699,7 @@ _item_sorted_insert(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5699 Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb); 5699 Evas_Smart_Cb func = va_arg(*list, Evas_Smart_Cb);
5700 const void *func_data = va_arg(*list, const void *); 5700 const void *func_data = va_arg(*list, const void *);
5701 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **); 5701 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
5702 *ret = NULL; 5702 if (ret) *ret = NULL;
5703 5703
5704 Elm_Genlist_Smart_Data *sd = _pd; 5704 Elm_Genlist_Smart_Data *sd = _pd;
5705 5705
@@ -5776,7 +5776,7 @@ _item_sorted_insert(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5776 5776
5777 _item_queue(sd, it, _elm_genlist_item_list_compare); 5777 _item_queue(sd, it, _elm_genlist_item_list_compare);
5778 5778
5779 *ret = (Elm_Object_Item *)it; 5779 if (ret) *ret = (Elm_Object_Item *)it;
5780} 5780}
5781 5781
5782EAPI void 5782EAPI void
@@ -5824,7 +5824,7 @@ _multi_select_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5824 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 5824 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
5825 Elm_Genlist_Smart_Data *sd = _pd; 5825 Elm_Genlist_Smart_Data *sd = _pd;
5826 5826
5827 *ret = sd->multi; 5827 if (ret) *ret = sd->multi;
5828} 5828}
5829 5829
5830EAPI void 5830EAPI void
@@ -5863,7 +5863,7 @@ _multi_select_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5863 Elm_Object_Multi_Select_Mode *ret = va_arg(*list, Elm_Object_Multi_Select_Mode *); 5863 Elm_Object_Multi_Select_Mode *ret = va_arg(*list, Elm_Object_Multi_Select_Mode *);
5864 Elm_Genlist_Smart_Data *sd = _pd; 5864 Elm_Genlist_Smart_Data *sd = _pd;
5865 5865
5866 *ret = sd->multi_select_mode; 5866 if (ret) *ret = sd->multi_select_mode;
5867} 5867}
5868 5868
5869EAPI Elm_Object_Item * 5869EAPI Elm_Object_Item *
@@ -5902,7 +5902,7 @@ _selected_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5902 const Eina_List **ret = va_arg(*list, const Eina_List **); 5902 const Eina_List **ret = va_arg(*list, const Eina_List **);
5903 Elm_Genlist_Smart_Data *sd = _pd; 5903 Elm_Genlist_Smart_Data *sd = _pd;
5904 5904
5905 *ret = sd->selected; 5905 if (ret) *ret = sd->selected;
5906} 5906}
5907 5907
5908EAPI Eina_List * 5908EAPI Eina_List *
@@ -5922,7 +5922,7 @@ _realized_items_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
5922 5922
5923 Eina_List **ret = va_arg(*list, Eina_List **); 5923 Eina_List **ret = va_arg(*list, Eina_List **);
5924 Elm_Genlist_Smart_Data *sd = _pd; 5924 Elm_Genlist_Smart_Data *sd = _pd;
5925 *ret = NULL; 5925 if (ret) *ret = NULL;
5926 5926
5927 EINA_INLIST_FOREACH(sd->blocks, itb) 5927 EINA_INLIST_FOREACH(sd->blocks, itb)
5928 { 5928 {
@@ -6009,7 +6009,7 @@ _at_xy_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
6009 else *posret = -1; 6009 else *posret = -1;
6010 } 6010 }
6011 6011
6012 *ret = NULL; 6012 if (ret) *ret = NULL;
6013} 6013}
6014 6014
6015EAPI Elm_Object_Item * 6015EAPI Elm_Object_Item *
@@ -6028,7 +6028,7 @@ _first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
6028 6028
6029 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **); 6029 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
6030 Elm_Genlist_Smart_Data *sd = _pd; 6030 Elm_Genlist_Smart_Data *sd = _pd;
6031 *ret = NULL; 6031 if (ret) *ret = NULL;
6032 6032
6033 if (!sd->items) return; 6033 if (!sd->items) return;
6034 6034
@@ -6036,7 +6036,7 @@ _first_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
6036 while ((it) && (it->generation < sd->generation)) 6036 while ((it) && (it->generation < sd->generation))
6037 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next); 6037 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->next);
6038 6038
6039 *ret = (Elm_Object_Item *)it; 6039 if (ret) *ret = (Elm_Object_Item *)it;
6040} 6040}
6041 6041
6042EAPI Elm_Object_Item * 6042EAPI Elm_Object_Item *
@@ -6054,7 +6054,7 @@ _last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
6054 Elm_Gen_Item *it; 6054 Elm_Gen_Item *it;
6055 6055
6056 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **); 6056 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
6057 *ret = NULL; 6057 if (ret) *ret = NULL;
6058 6058
6059 Elm_Genlist_Smart_Data *sd = _pd; 6059 Elm_Genlist_Smart_Data *sd = _pd;
6060 6060
@@ -6064,7 +6064,7 @@ _last_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
6064 while ((it) && (it->generation < sd->generation)) 6064 while ((it) && (it->generation < sd->generation))
6065 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev); 6065 it = ELM_GEN_ITEM_FROM_INLIST(EINA_INLIST_GET(it)->prev);
6066 6066
6067 *ret = (Elm_Object_Item *)it; 6067 if (ret) *ret = (Elm_Object_Item *)it;
6068} 6068}
6069 6069
6070EAPI Elm_Object_Item * 6070EAPI Elm_Object_Item *
@@ -6811,7 +6811,7 @@ _mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
6811 Elm_List_Mode *ret = va_arg(*list, Elm_List_Mode *); 6811 Elm_List_Mode *ret = va_arg(*list, Elm_List_Mode *);
6812 Elm_Genlist_Smart_Data *sd = _pd; 6812 Elm_Genlist_Smart_Data *sd = _pd;
6813 6813
6814 *ret = sd->mode; 6814 if (ret) *ret = sd->mode;
6815} 6815}
6816 6816
6817EAPI void 6817EAPI void
@@ -6889,7 +6889,7 @@ _homogeneous_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
6889 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 6889 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
6890 Elm_Genlist_Smart_Data *sd = _pd; 6890 Elm_Genlist_Smart_Data *sd = _pd;
6891 6891
6892 *ret = sd->homogeneous; 6892 if (ret) *ret = sd->homogeneous;
6893} 6893}
6894 6894
6895EAPI void 6895EAPI void
@@ -6927,7 +6927,7 @@ _block_count_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
6927 int *ret = va_arg(*list, int *); 6927 int *ret = va_arg(*list, int *);
6928 Elm_Genlist_Smart_Data *sd = _pd; 6928 Elm_Genlist_Smart_Data *sd = _pd;
6929 6929
6930 *ret = sd->max_items_per_block; 6930 if (ret) *ret = sd->max_items_per_block;
6931} 6931}
6932 6932
6933EAPI void 6933EAPI void
@@ -6962,7 +6962,7 @@ _longpress_timeout_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
6962 double *ret = va_arg(*list, double *); 6962 double *ret = va_arg(*list, double *);
6963 Elm_Genlist_Smart_Data *sd = _pd; 6963 Elm_Genlist_Smart_Data *sd = _pd;
6964 6964
6965 *ret = sd->longpress_timeout; 6965 if (ret) *ret = sd->longpress_timeout;
6966} 6966}
6967 6967
6968EAPI void 6968EAPI void
@@ -7099,7 +7099,7 @@ _decorated_item_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
7099 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **); 7099 Elm_Object_Item **ret = va_arg(*list, Elm_Object_Item **);
7100 Elm_Genlist_Smart_Data *sd = _pd; 7100 Elm_Genlist_Smart_Data *sd = _pd;
7101 7101
7102 *ret = (Elm_Object_Item *)sd->mode_item; 7102 if (ret) *ret = (Elm_Object_Item *)sd->mode_item;
7103} 7103}
7104 7104
7105EAPI Eina_Bool 7105EAPI Eina_Bool
@@ -7117,7 +7117,7 @@ _decorate_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
7117 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 7117 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
7118 Elm_Genlist_Smart_Data *sd = _pd; 7118 Elm_Genlist_Smart_Data *sd = _pd;
7119 7119
7120 *ret = sd->decorate_all_mode; 7120 if (ret) *ret = sd->decorate_all_mode;
7121} 7121}
7122 7122
7123EAPI void 7123EAPI void
@@ -7233,7 +7233,7 @@ _reorder_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
7233 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 7233 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
7234 Elm_Genlist_Smart_Data *sd = _pd; 7234 Elm_Genlist_Smart_Data *sd = _pd;
7235 7235
7236 *ret = sd->reorder_mode; 7236 if (ret) *ret = sd->reorder_mode;
7237} 7237}
7238 7238
7239EAPI Elm_Genlist_Item_Type 7239EAPI Elm_Genlist_Item_Type
@@ -7383,7 +7383,7 @@ _select_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
7383 Elm_Object_Select_Mode *ret = va_arg(*list, Elm_Object_Select_Mode *); 7383 Elm_Object_Select_Mode *ret = va_arg(*list, Elm_Object_Select_Mode *);
7384 Elm_Genlist_Smart_Data *sd = _pd; 7384 Elm_Genlist_Smart_Data *sd = _pd;
7385 7385
7386 *ret = sd->select_mode; 7386 if (ret) *ret = sd->select_mode;
7387} 7387}
7388 7388
7389EAPI void 7389EAPI void
@@ -7418,7 +7418,7 @@ _highlight_mode_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
7418 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 7418 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
7419 Elm_Genlist_Smart_Data *sd = _pd; 7419 Elm_Genlist_Smart_Data *sd = _pd;
7420 7420
7421 *ret = sd->highlight; 7421 if (ret) *ret = sd->highlight;
7422} 7422}
7423 7423
7424EAPI void 7424EAPI void
@@ -7496,7 +7496,7 @@ _tree_effect_enabled_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
7496 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 7496 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
7497 Elm_Genlist_Smart_Data *sd = _pd; 7497 Elm_Genlist_Smart_Data *sd = _pd;
7498 7498
7499 *ret = sd->tree_effect_enabled; 7499 if (ret) *ret = sd->tree_effect_enabled;
7500} 7500}
7501 7501
7502EAPI void 7502EAPI void
@@ -7529,7 +7529,7 @@ _focus_on_selection_get(Eo *obj EINA_UNUSED, void *_pd, va_list *list)
7529{ 7529{
7530 Eina_Bool *ret = va_arg(*list, Eina_Bool *); 7530 Eina_Bool *ret = va_arg(*list, Eina_Bool *);
7531 Elm_Genlist_Smart_Data *sd = _pd; 7531 Elm_Genlist_Smart_Data *sd = _pd;
7532 *ret = sd->focus_on_selection_enabled; 7532 if (ret) *ret = sd->focus_on_selection_enabled;
7533} 7533}
7534 7534
7535EAPI Elm_Object_Item * 7535EAPI Elm_Object_Item *