summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_poll.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2008-11-29 11:23:17 +0000
committerVincent Torri <vincent.torri@gmail.com>2008-11-29 11:23:17 +0000
commitb1f46fb7e87510ce84b2f2de88f55d85bb540b57 (patch)
treea797c21c243f293819d288631d29d27a61bf4730 /legacy/ecore/src/lib/ecore/ecore_poll.c
parente12623ee468964ee20cff1886f6854be48faf46d (diff)
remove trailing spaces
SVN revision: 37851
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_poll.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_poll.c b/legacy/ecore/src/lib/ecore/ecore_poll.c
index ed12365483..bb4565372c 100644
--- a/legacy/ecore/src/lib/ecore/ecore_poll.c
+++ b/legacy/ecore/src/lib/ecore/ecore_poll.c
@@ -11,12 +11,12 @@ static int poller_walking = 0;
11static double poll_interval = 0.125; 11static double poll_interval = 0.125;
12static double poll_cur_interval = 0.0; 12static double poll_cur_interval = 0.0;
13static double last_tick = 0.0; 13static double last_tick = 0.0;
14static Ecore_Poller *pollers[16] = 14static Ecore_Poller *pollers[16] =
15{ 15{
16 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, 16 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
17 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL 17 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
18}; 18};
19static unsigned short poller_counters[16] = 19static unsigned short poller_counters[16] =
20{ 20{
21 0,0,0,0,0,0,0,0, 21 0,0,0,0,0,0,0,0,
22 0,0,0,0,0,0,0,0 22 0,0,0,0,0,0,0,0
@@ -30,7 +30,7 @@ _ecore_poller_next_tick_eval(void)
30{ 30{
31 int i; 31 int i;
32 double interval; 32 double interval;
33 33
34 min_interval = -1; 34 min_interval = -1;
35 for (i = 0; i < 15; i++) 35 for (i = 0; i < 15; i++)
36 { 36 {
@@ -64,7 +64,7 @@ _ecore_poller_next_tick_eval(void)
64 else 64 else
65 { 65 {
66 double t; 66 double t;
67 67
68 if (!timer) 68 if (!timer)
69 timer = ecore_timer_add(interval, _ecore_poller_cb_timer, NULL); 69 timer = ecore_timer_add(interval, _ecore_poller_cb_timer, NULL);
70 else 70 else
@@ -76,7 +76,7 @@ _ecore_poller_next_tick_eval(void)
76 /* delete the timer and reset it to tick off in the new 76 /* delete the timer and reset it to tick off in the new
77 * time interval. at the tick this will be adjusted */ 77 * time interval. at the tick this will be adjusted */
78 ecore_timer_del(timer); 78 ecore_timer_del(timer);
79 timer = ecore_timer_add(interval - t, 79 timer = ecore_timer_add(interval - t,
80 _ecore_poller_cb_timer, NULL); 80 _ecore_poller_cb_timer, NULL);
81 } 81 }
82 } 82 }
@@ -103,7 +103,7 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
103 /* wrap back to 0 if we exceed out loop count for the counter */ 103 /* wrap back to 0 if we exceed out loop count for the counter */
104 if (poller_counters[i] >= (1 << i)) poller_counters[i] = 0; 104 if (poller_counters[i] >= (1 << i)) poller_counters[i] = 0;
105 } 105 }
106 106
107 just_added_poller = 0; 107 just_added_poller = 0;
108 /* walk the pollers now */ 108 /* walk the pollers now */
109 poller_walking++; 109 poller_walking++;
@@ -131,7 +131,7 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
131 } 131 }
132 } 132 }
133 poller_walking--; 133 poller_walking--;
134 134
135 /* handle deletes afterwards */ 135 /* handle deletes afterwards */
136 if (poller_delete_count > 0) 136 if (poller_delete_count > 0)
137 { 137 {
@@ -161,11 +161,11 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
161 161
162 just_added_poller = 0; 162 just_added_poller = 0;
163 poller_delete_count = 0; 163 poller_delete_count = 0;
164 164
165 at_tick--; 165 at_tick--;
166 166
167 /* if the timer was deleted then there is no point returning 1 - ambiguous 167 /* if the timer was deleted then there is no point returning 1 - ambiguous
168 * if we do as it im plies "keep running me" but we have been deleted 168 * if we do as it im plies "keep running me" but we have been deleted
169 * anyway */ 169 * anyway */
170 if (!timer) return 0; 170 if (!timer) return 0;
171 171
@@ -189,7 +189,7 @@ _ecore_poller_cb_timer(void *data __UNUSED__)
189 * @param type The ticker type to adjust 189 * @param type The ticker type to adjust
190 * @param poll_time The time (in seconds) between ticks of the clock 190 * @param poll_time The time (in seconds) between ticks of the clock
191 * @ingroup Ecore_Poller_Group 191 * @ingroup Ecore_Poller_Group
192 * 192 *
193 * This will adjust the time between ticks of the given ticker type defined 193 * This will adjust the time between ticks of the given ticker type defined
194 * by @p type to the time period defined by @p poll_time. 194 * by @p type to the time period defined by @p poll_time.
195 */ 195 */
@@ -205,7 +205,7 @@ ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__, double poll_ti
205 * @param type The ticker type to query 205 * @param type The ticker type to query
206 * @return The time in seconds between ticks of the ticker clock 206 * @return The time in seconds between ticks of the ticker clock
207 * @ingroup Ecore_Poller_Group 207 * @ingroup Ecore_Poller_Group
208 * 208 *
209 * This will get the time between ticks of the specifider ticker clock. 209 * This will get the time between ticks of the specifider ticker clock.
210 */ 210 */
211EAPI double 211EAPI double
@@ -233,7 +233,7 @@ ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
233 * save power as the CPU has more of a chance to go into a low power state 233 * save power as the CPU has more of a chance to go into a low power state
234 * the longer it is asleep for, so this should be used if you are at all 234 * the longer it is asleep for, so this should be used if you are at all
235 * power conscious. 235 * power conscious.
236 * 236 *
237 * The @p type parameter defines the poller tick type (there is a virtual 237 * The @p type parameter defines the poller tick type (there is a virtual
238 * clock ticking all the time - though ecore avoids making it tick when 238 * clock ticking all the time - though ecore avoids making it tick when
239 * there will not be any work to do at that tick point). There is only one 239 * there will not be any work to do at that tick point). There is only one
@@ -241,7 +241,7 @@ ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
241 * expansion if multiple clocks with different frequencies are really required. 241 * expansion if multiple clocks with different frequencies are really required.
242 * The default time between ticks for the ECORE_POLLER_CORE ticker is 0.125 242 * The default time between ticks for the ECORE_POLLER_CORE ticker is 0.125
243 * seconds. 243 * seconds.
244 * 244 *
245 * The @p interval is the number of ticker ticks that will pass by in between 245 * The @p interval is the number of ticker ticks that will pass by in between
246 * invocations of the @p func callback. This must be between 1 and 32768 246 * invocations of the @p func callback. This must be between 1 and 32768
247 * inclusive, and must be a power of 2 (i.e. 1, 2, 4, 8, 16, ... 16384, 32768). 247 * inclusive, and must be a power of 2 (i.e. 1, 2, 4, 8, 16, ... 16384, 32768).
@@ -250,13 +250,13 @@ ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
250 * which tick is undefined, as only the interval between calls can be defined. 250 * which tick is undefined, as only the interval between calls can be defined.
251 * Ecore will endeavour to keep pollers synchronised and to call as many in 251 * Ecore will endeavour to keep pollers synchronised and to call as many in
252 * 1 wakeup event as possible. 252 * 1 wakeup event as possible.
253 * 253 *
254 * This function adds a poller and returns its handle on success and NULL on 254 * This function adds a poller and returns its handle on success and NULL on
255 * failure. The function @p func will be called at tick intervals described 255 * failure. The function @p func will be called at tick intervals described
256 * above. The function will be passed the @p data pointer as its parameter. 256 * above. The function will be passed the @p data pointer as its parameter.
257 * 257 *
258 * When the poller @p func is called, it must return a value of either 258 * When the poller @p func is called, it must return a value of either
259 * 1 (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL). If it 259 * 1 (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL). If it
260 * returns 1, it will be called again at the next tick, or if it returns 260 * returns 1, it will be called again at the next tick, or if it returns
261 * 0 it will be deleted automatically making any references/handles for it 261 * 0 it will be deleted automatically making any references/handles for it
262 * invalid. 262 * invalid.
@@ -266,10 +266,10 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, int (*func) (v
266{ 266{
267 Ecore_Poller *poller; 267 Ecore_Poller *poller;
268 int ibit; 268 int ibit;
269 269
270 if (!func) return NULL; 270 if (!func) return NULL;
271 if (interval < 1) interval = 1; 271 if (interval < 1) interval = 1;
272 272
273 poller = calloc(1, sizeof(Ecore_Poller)); 273 poller = calloc(1, sizeof(Ecore_Poller));
274 if (!poller) return NULL; 274 if (!poller) return NULL;
275 ECORE_MAGIC_SET(poller, ECORE_MAGIC_POLLER); 275 ECORE_MAGIC_SET(poller, ECORE_MAGIC_POLLER);
@@ -283,7 +283,7 @@ ecore_poller_add(Ecore_Poller_Type type __UNUSED__, int interval, int (*func) (v
283 } 283 }
284 /* only allow up to 32768 - i.e. ibit == 15, so limit it */ 284 /* only allow up to 32768 - i.e. ibit == 15, so limit it */
285 if (ibit > 15) ibit = 15; 285 if (ibit > 15) ibit = 15;
286 286
287 poller->ibit = ibit; 287 poller->ibit = ibit;
288 poller->func = func; 288 poller->func = func;
289 poller->data = (void *)data; 289 poller->data = (void *)data;
@@ -309,7 +309,7 @@ EAPI void *
309ecore_poller_del(Ecore_Poller *poller) 309ecore_poller_del(Ecore_Poller *poller)
310{ 310{
311 void *data; 311 void *data;
312 312
313 if (!ECORE_MAGIC_CHECK(poller, ECORE_MAGIC_POLLER)) 313 if (!ECORE_MAGIC_CHECK(poller, ECORE_MAGIC_POLLER))
314 { 314 {
315 ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER, 315 ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER,
@@ -339,7 +339,7 @@ _ecore_poller_shutdown(void)
339 int i; 339 int i;
340 Ecore_List2 *l; 340 Ecore_List2 *l;
341 Ecore_Poller *poller; 341 Ecore_Poller *poller;
342 342
343 for (i = 0; i < 15; i++) 343 for (i = 0; i < 15; i++)
344 { 344 {
345 for (l = (Ecore_List2 *)pollers[i]; l;) 345 for (l = (Ecore_List2 *)pollers[i]; l;)