summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_poll.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2009-06-17 11:39:37 +0000
committerCedric BAIL <cedric.bail@free.fr>2009-06-17 11:39:37 +0000
commit8e392a074257d9524fb53e7a065cd03ea218dc93 (patch)
tree43eed75d6fe478384076c03bc36f227a2f6c4725 /legacy/ecore/src/lib/ecore/ecore_poll.c
parent3ff7c2300d053f43853885ce88c1680748d0286b (diff)
* ecore: Remove user of Ecore_List2 from ecore events.
SVN revision: 41070
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_poll.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_poll.c b/legacy/ecore/src/lib/ecore/ecore_poll.c
index 20630d09d5..cf2c499130 100644
--- a/legacy/ecore/src/lib/ecore/ecore_poll.c
+++ b/legacy/ecore/src/lib/ecore/ecore_poll.c
@@ -98,8 +98,7 @@ static int
98_ecore_poller_cb_timer(void *data __UNUSED__) 98_ecore_poller_cb_timer(void *data __UNUSED__)
99{ 99{
100 int i; 100 int i;
101 Ecore_List2 *l; 101 Ecore_Poller *poller, *l;
102 Ecore_Poller *poller;
103 int changes = 0; 102 int changes = 0;
104 103
105 at_tick++; 104 at_tick++;
@@ -123,9 +122,8 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
123 * tick interval, so run all pollers hooked to that counter */ 122 * tick interval, so run all pollers hooked to that counter */
124 if (poller_counters[i] == 0) 123 if (poller_counters[i] == 0)
125 { 124 {
126 for (l = (Ecore_List2 *)pollers[i]; l; l = l->next) 125 EINA_INLIST_FOREACH(pollers[i], poller)
127 { 126 {
128 poller = (Ecore_Poller *)l;
129 if (!poller->delete_me) 127 if (!poller->delete_me)
130 { 128 {
131 if (!poller->func(poller->data)) 129 if (!poller->func(poller->data))
@@ -148,13 +146,13 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
148 /* FIXME: walk all pollers and remove deleted ones */ 146 /* FIXME: walk all pollers and remove deleted ones */
149 for (i = 0; i < 15; i++) 147 for (i = 0; i < 15; i++)
150 { 148 {
151 for (l = (Ecore_List2 *)pollers[i]; l;) 149 for (l = pollers[i]; l;)
152 { 150 {
153 poller = (Ecore_Poller *)l; 151 poller = l;
154 l = l->next; 152 l = (Ecore_Poller *) EINA_INLIST_GET(l)->next;
155 if (poller->delete_me) 153 if (poller->delete_me)
156 { 154 {
157 pollers[poller->ibit] = _ecore_list2_remove(pollers[poller->ibit], poller); 155 pollers[i] = (Ecore_Poller *) eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(poller));
158 free(poller); 156 free(poller);
159 poller_delete_count--; 157 poller_delete_count--;
160 changes++; 158 changes++;
@@ -297,7 +295,7 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, int (*func) (v
297 poller->ibit = ibit; 295 poller->ibit = ibit;
298 poller->func = func; 296 poller->func = func;
299 poller->data = (void *)data; 297 poller->data = (void *)data;
300 pollers[poller->ibit] = _ecore_list2_prepend(pollers[poller->ibit], poller); 298 pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_prepend(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
301 if (poller_walking) 299 if (poller_walking)
302 just_added_poller++; 300 just_added_poller++;
303 else 301 else
@@ -337,7 +335,7 @@ ecore_poller_del(Ecore_Poller *poller)
337 } 335 }
338 /* not in loop so safe - delete immediately */ 336 /* not in loop so safe - delete immediately */
339 data = poller->data; 337 data = poller->data;
340 pollers[poller->ibit] = _ecore_list2_remove(pollers[poller->ibit], poller); 338 pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_remove(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
341 free(poller); 339 free(poller);
342 _ecore_poller_next_tick_eval(); 340 _ecore_poller_next_tick_eval();
343 return data; 341 return data;
@@ -347,16 +345,13 @@ void
347_ecore_poller_shutdown(void) 345_ecore_poller_shutdown(void)
348{ 346{
349 int i; 347 int i;
350 Ecore_List2 *l;
351 Ecore_Poller *poller; 348 Ecore_Poller *poller;
352 349
353 for (i = 0; i < 15; i++) 350 for (i = 0; i < 15; i++)
354 { 351 {
355 for (l = (Ecore_List2 *)pollers[i]; l;) 352 while ((poller = pollers[i]))
356 { 353 {
357 poller = (Ecore_Poller *)l; 354 pollers[i] = (Ecore_Poller *) eina_inlist_remove(EINA_INLIST_GET(pollers[i]), EINA_INLIST_GET(pollers[i]));
358 l = l->next;
359 pollers[poller->ibit] = _ecore_list2_remove(pollers[poller->ibit], poller);
360 free(poller); 355 free(poller);
361 } 356 }
362 } 357 }