summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_poll.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2010-06-24 16:15:56 +0000
committerCedric BAIL <cedric.bail@free.fr>2010-06-24 16:15:56 +0000
commitfbe90643103da8df6d452eed3c3b49cf1e11b7c1 (patch)
tree7a6444cb418881166f783a4552694bd2bd5911aa /legacy/ecore/src/lib/ecore/ecore_poll.c
parent75d6f4ce18376d5e493279e2feecbd8046491ec0 (diff)
* ecore: Ecore callback really should return Eina_Bool.
SVN revision: 49829
Diffstat (limited to 'legacy/ecore/src/lib/ecore/ecore_poll.c')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_poll.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_poll.c b/legacy/ecore/src/lib/ecore/ecore_poll.c
index dd1528aeb0..078388b2be 100644
--- a/legacy/ecore/src/lib/ecore/ecore_poll.c
+++ b/legacy/ecore/src/lib/ecore/ecore_poll.c
@@ -18,7 +18,7 @@ struct _Ecore_Poller
18 ECORE_MAGIC; 18 ECORE_MAGIC;
19 int ibit; 19 int ibit;
20 unsigned char delete_me : 1; 20 unsigned char delete_me : 1;
21 int (*func) (void *data); 21 Eina_Bool (*func) (void *data);
22 void *data; 22 void *data;
23}; 23};
24 24
@@ -45,7 +45,7 @@ static unsigned short poller_counters[16] =
45}; 45};
46 46
47static void _ecore_poller_next_tick_eval(void); 47static void _ecore_poller_next_tick_eval(void);
48static int _ecore_poller_cb_timer(void *data); 48static Eina_Bool _ecore_poller_cb_timer(void *data);
49 49
50static void 50static void
51_ecore_poller_next_tick_eval(void) 51_ecore_poller_next_tick_eval(void)
@@ -106,7 +106,7 @@ _ecore_poller_next_tick_eval(void)
106 poll_cur_interval = interval; 106 poll_cur_interval = interval;
107} 107}
108 108
109static int 109static Eina_Bool
110_ecore_poller_cb_timer(void *data __UNUSED__) 110_ecore_poller_cb_timer(void *data __UNUSED__)
111{ 111{
112 int i; 112 int i;
@@ -187,11 +187,11 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
187 /* if the timer was deleted then there is no point returning 1 - ambiguous 187 /* if the timer was deleted then there is no point returning 1 - ambiguous
188 * if we do as it im plies "keep running me" but we have been deleted 188 * if we do as it im plies "keep running me" but we have been deleted
189 * anyway */ 189 * anyway */
190 if (!timer) return 0; 190 if (!timer) return ECORE_CALLBACK_CANCEL;
191 191
192 /* adjust interval */ 192 /* adjust interval */
193 ecore_timer_interval_set(timer, poll_cur_interval); 193 ecore_timer_interval_set(timer, poll_cur_interval);
194 return 1; 194 return ECORE_CALLBACK_RENEW;
195} 195}
196 196
197/** 197/**
@@ -282,7 +282,7 @@ ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
282 * invalid. 282 * invalid.
283 */ 283 */
284EAPI Ecore_Poller * 284EAPI Ecore_Poller *
285ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, int (*func) (void *data), const void *data) 285ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, Eina_Bool (*func) (void *data), const void *data)
286{ 286{
287 Ecore_Poller *poller; 287 Ecore_Poller *poller;
288 int ibit; 288 int ibit;
@@ -326,7 +326,7 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, int (*func) (v
326 * a poll rate without deleting and re-creating a poller. 326 * a poll rate without deleting and re-creating a poller.
327 * @ingroup Ecore_Poller_Group 327 * @ingroup Ecore_Poller_Group
328 */ 328 */
329EAPI Eina_Bool 329EAPI Eina_Bool
330ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval) 330ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval)
331{ 331{
332 int ibit; 332 int ibit;
@@ -335,7 +335,7 @@ ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval)
335 { 335 {
336 ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER, 336 ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER,
337 "ecore_poller_poller_interval_set"); 337 "ecore_poller_poller_interval_set");
338 return 0; 338 return EINA_FALSE;
339 } 339 }
340 340
341 /* interval MUST be a power of 2, so enforce it */ 341 /* interval MUST be a power of 2, so enforce it */
@@ -350,7 +350,7 @@ ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval)
350 if (ibit > 15) ibit = 15; 350 if (ibit > 15) ibit = 15;
351 /* if interval specified is the same as interval set, return true without wasting time */ 351 /* if interval specified is the same as interval set, return true without wasting time */
352 if (poller->ibit == ibit) 352 if (poller->ibit == ibit)
353 return 1; 353 return EINA_TRUE;
354 pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_remove(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller)); 354 pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_remove(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
355 poller->ibit = ibit; 355 poller->ibit = ibit;
356 pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_prepend(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller)); 356 pollers[poller->ibit] = (Ecore_Poller *) eina_inlist_prepend(EINA_INLIST_GET(pollers[poller->ibit]), EINA_INLIST_GET(poller));
@@ -358,7 +358,7 @@ ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval)
358 just_added_poller++; 358 just_added_poller++;
359 else 359 else
360 _ecore_poller_next_tick_eval(); 360 _ecore_poller_next_tick_eval();
361 return 1; 361 return EINA_TRUE;
362} 362}
363 363
364/** 364/**