summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorDerek Foreman <derek.foreman.samsung@gmail.com>2019-01-16 16:44:36 -0600
committerDerek Foreman <derek.foreman.samsung@gmail.com>2019-01-18 14:11:05 -0600
commita9d9ccefe42a3ac9999a55daa7a0fe6e3ee2a4ca (patch)
tree54eff4a2cbe4e671243b83703d24d869cce43eca /src/lib/edje
parent529abe2de559f357186a2f718eb0fe26436545bd (diff)
edje: convert var timer list to inlist
Since these are only ever on one list, inlist is better. Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D7697
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/edje_private.h3
-rw-r--r--src/lib/edje/edje_var.c16
2 files changed, 12 insertions, 7 deletions
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 2781ce4c4c..7c61d59bc1 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -2148,6 +2148,7 @@ struct _Edje_Var_Hash
2148 2148
2149struct _Edje_Var_Timer 2149struct _Edje_Var_Timer
2150{ 2150{
2151 EINA_INLIST;
2151 Edje *edje; 2152 Edje *edje;
2152 int id; 2153 int id;
2153 Embryo_Function func; 2154 Embryo_Function func;
@@ -2168,7 +2169,7 @@ struct _Edje_Var_Animator
2168struct _Edje_Var_Pool 2169struct _Edje_Var_Pool
2169{ 2170{
2170 int id_count; 2171 int id_count;
2171 Eina_List *timers; 2172 Eina_Inlist *timers;
2172 Eina_List *animators; 2173 Eina_List *animators;
2173 int size; 2174 int size;
2174 Edje_Var *vars; 2175 Edje_Var *vars;
diff --git a/src/lib/edje/edje_var.c b/src/lib/edje/edje_var.c
index 0d66c3d17a..40f32ff363 100644
--- a/src/lib/edje/edje_var.c
+++ b/src/lib/edje/edje_var.c
@@ -20,7 +20,8 @@ _edje_var_timer_cb(void *data)
20 embryo_program_vm_push(ed->collection->script); 20 embryo_program_vm_push(ed->collection->script);
21 _edje_embryo_globals_init(ed); 21 _edje_embryo_globals_init(ed);
22 embryo_parameter_cell_push(ed->collection->script, (Embryo_Cell)et->val); 22 embryo_parameter_cell_push(ed->collection->script, (Embryo_Cell)et->val);
23 ed->var_pool->timers = eina_list_remove(ed->var_pool->timers, et); 23 ed->var_pool->timers = eina_inlist_remove(ed->var_pool->timers,
24 EINA_INLIST_GET(et));
24 fn = et->func; 25 fn = et->func;
25 free(et); 26 free(et);
26 { 27 {
@@ -239,8 +240,10 @@ _edje_var_shutdown(Edje *ed)
239 } 240 }
240 free(ed->var_pool->vars); 241 free(ed->var_pool->vars);
241 } 242 }
242 EINA_LIST_FREE(ed->var_pool->timers, et) 243 EINA_INLIST_FREE(ed->var_pool->timers, et)
243 { 244 {
245 ed->var_pool->timers = eina_inlist_remove(ed->var_pool->timers,
246 EINA_INLIST_GET(et));
244 ecore_timer_del(et->timer); 247 ecore_timer_del(et->timer);
245 free(et); 248 free(et);
246 } 249 }
@@ -1006,19 +1009,19 @@ _edje_var_timer_add(Edje *ed, double in, const char *fname, int val)
1006 free(et); 1009 free(et);
1007 return 0; 1010 return 0;
1008 } 1011 }
1009 ed->var_pool->timers = eina_list_prepend(ed->var_pool->timers, et); 1012 ed->var_pool->timers = eina_inlist_prepend(ed->var_pool->timers,
1013 EINA_INLIST_GET(et));
1010 return et->id; 1014 return et->id;
1011} 1015}
1012 1016
1013static Edje_Var_Timer * 1017static Edje_Var_Timer *
1014_edje_var_timer_find(Edje *ed, int id) 1018_edje_var_timer_find(Edje *ed, int id)
1015{ 1019{
1016 Eina_List *l;
1017 Edje_Var_Timer *et; 1020 Edje_Var_Timer *et;
1018 1021
1019 if (!ed->var_pool) return NULL; 1022 if (!ed->var_pool) return NULL;
1020 1023
1021 EINA_LIST_FOREACH(ed->var_pool->timers, l, et) 1024 EINA_INLIST_FOREACH(ed->var_pool->timers, et)
1022 if (et->id == id) return et; 1025 if (et->id == id) return et;
1023 1026
1024 return NULL; 1027 return NULL;
@@ -1032,7 +1035,8 @@ _edje_var_timer_del(Edje *ed, int id)
1032 et = _edje_var_timer_find(ed, id); 1035 et = _edje_var_timer_find(ed, id);
1033 if (!et) return; 1036 if (!et) return;
1034 1037
1035 ed->var_pool->timers = eina_list_remove(ed->var_pool->timers, et); 1038 ed->var_pool->timers = eina_inlist_remove(ed->var_pool->timers,
1039 EINA_INLIST_GET(et));
1036 ecore_timer_del(et->timer); 1040 ecore_timer_del(et->timer);
1037 free(et); 1041 free(et);
1038} 1042}