summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongjong Lee <yj34.lee@samsung.com>2020-02-20 09:11:02 -0500
committerMike Blumenkrantz <zmike@samsung.com>2020-02-20 09:11:02 -0500
commitb0179deda5bceb6d5c625431d5f7fb59f239253c (patch)
treefb90bf0bad5589eada5462449bc8dca3e84d6a7d
parent29844fd061adf4a2670f47b1f2a7aef2243c4048 (diff)
efl_ui_exact_model: use eina APIs to get the nth data
Summary: Also, fixes a compiler warning ``` ../src/lib/elementary/efl_ui_exact_model.c:60:17: warning: variable 'tbuf' set but not used [-Wunused-but-set-variable] ``` Test Plan: ninja Reviewers: cedric, zmike, bu5hm4n Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11380
-rw-r--r--src/lib/elementary/efl_ui_exact_model.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/lib/elementary/efl_ui_exact_model.c b/src/lib/elementary/efl_ui_exact_model.c
index b12cfba8bd..fc1b5997c7 100644
--- a/src/lib/elementary/efl_ui_exact_model.c
+++ b/src/lib/elementary/efl_ui_exact_model.c
@@ -54,20 +54,6 @@ _efl_ui_exact_model_efl_object_constructor(Eo *obj, Efl_Ui_Exact_Model_Data *pd)
54 return efl_constructor(efl_super(obj, EFL_UI_EXACT_MODEL_CLASS)); 54 return efl_constructor(efl_super(obj, EFL_UI_EXACT_MODEL_CLASS));
55} 55}
56 56
57static unsigned int
58_efl_ui_exact_model_list_find(unsigned int list_index, Eina_List *start, Eina_List **l)
59{
60 Eina_Binbuf *tbuf;
61
62 EINA_LIST_FOREACH(start, *l, tbuf)
63 {
64 if (list_index == 0) break;
65 list_index--;
66 }
67
68 return list_index;
69}
70
71static Eina_List * 57static Eina_List *
72_efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, unsigned int *buffer) 58_efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, unsigned int *buffer)
73{ 59{
@@ -78,7 +64,7 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns
78 Eina_List *l = NULL; 64 Eina_List *l = NULL;
79 unsigned int i; 65 unsigned int i;
80 66
81 _efl_ui_exact_model_list_find(list_index, compressed, &l); 67 l = eina_list_nth_list(compressed, list_index);
82 68
83 tbuf = eina_binbuf_manage_new((unsigned char *) buffer, EFL_UI_EXACT_MODEL_CONTENT_LENGTH, EINA_TRUE); 69 tbuf = eina_binbuf_manage_new((unsigned char *) buffer, EFL_UI_EXACT_MODEL_CONTENT_LENGTH, EINA_TRUE);
84 if (!tbuf) return compressed; 70 if (!tbuf) return compressed;
@@ -136,16 +122,15 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns
136static unsigned int * 122static unsigned int *
137_efl_ui_exact_model_buffer_expand(unsigned int list_index, unsigned int *buffer, Eina_List *list) 123_efl_ui_exact_model_buffer_expand(unsigned int list_index, unsigned int *buffer, Eina_List *list)
138{ 124{
139 unsigned int found;
140 Eina_Binbuf *tmp; 125 Eina_Binbuf *tmp;
141 Eina_List *l = NULL; 126 Eina_List *l = NULL;
142 127
143 if (!buffer) buffer = malloc(EFL_UI_EXACT_MODEL_CONTENT_LENGTH); 128 if (!buffer) buffer = malloc(EFL_UI_EXACT_MODEL_CONTENT_LENGTH);
144 129
145 found = _efl_ui_exact_model_list_find(list_index, list, &l); 130 l = eina_list_nth_list(list, list_index);
146 131
147 // Check if the data is in the list 132 // Check if the data is in the list
148 if (!found) 133 if (!l)
149 { 134 {
150 // Not found -> everything is assumed to be zero 135 // Not found -> everything is assumed to be zero
151 memset(buffer, 0, EFL_UI_EXACT_MODEL_CONTENT_LENGTH); 136 memset(buffer, 0, EFL_UI_EXACT_MODEL_CONTENT_LENGTH);