summaryrefslogtreecommitdiff
path: root/atari/schedule.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
committerVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
commitc105738fa36bb2400adc47399c5b878d252d1c86 (patch)
tree138eeb449e1bf51ee1726b5f820740aada0ccd0b /atari/schedule.c
parent20f2c86a511f7913cf858e7bd3668b0b59663ba0 (diff)
downloadnetsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.gz
netsurf-c105738fa36bb2400adc47399c5b878d252d1c86.tar.bz2
Change LOG() macro to be varadic
This changes the LOG macro to be varadic removing the need for all callsites to have double bracketing and allows for future improvement on how we use the logging macros. The callsites were changed with coccinelle and the changes checked by hand. Compile tested for several frontends but not all. A formatting annotation has also been added which allows the compiler to check the parameters and types passed to the logging.
Diffstat (limited to 'atari/schedule.c')
-rw-r--r--atari/schedule.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/atari/schedule.c b/atari/schedule.c
index 4ff51d4f9..bb47cc623 100644
--- a/atari/schedule.c
+++ b/atari/schedule.c
@@ -71,7 +71,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
return NSERROR_OK;
}
- LOG(("removing %p, %p", callback, p));
+ LOG("removing %p, %p", callback, p);
cur_nscb = schedule_list;
prev_nscb = NULL;
@@ -80,8 +80,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p)
if ((cur_nscb->callback == callback) &&
(cur_nscb->p == p)) {
/* item to remove */
- LOG(("callback entry %p removing %p(%p)",
- cur_nscb, cur_nscb->callback, cur_nscb->p));
+ LOG("callback entry %p removing %p(%p)", cur_nscb, cur_nscb->callback, cur_nscb->p);
/* remove callback */
unlnk_nscb = cur_nscb;
@@ -119,8 +118,7 @@ nserror atari_schedule(int ival, void (*callback)(void *p), void *p)
nscb->timeout = MS_NOW() + ival;
- LOG(("adding callback %p for %p(%p) at %d ms",
- nscb, callback, p, nscb->timeout ));
+ LOG("adding callback %p for %p(%p) at %d ms", nscb, callback, p, nscb->timeout);
nscb->callback = callback;
nscb->p = p;
@@ -166,8 +164,7 @@ int schedule_run(void)
prev_nscb->next = unlnk_nscb->next;
}
- LOG(("callback entry %p running %p(%p)",
- unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p));
+ LOG("callback entry %p running %p(%p)", unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p);
/* call callback */
unlnk_nscb->callback(unlnk_nscb->p);
@@ -176,7 +173,7 @@ int schedule_run(void)
/* need to deal with callback modifying the list. */
if (schedule_list == NULL) {
- LOG(("schedule_list == NULL"));
+ LOG("schedule_list == NULL");
return -1; /* no more callbacks scheduled */
}
@@ -201,7 +198,7 @@ int schedule_run(void)
/* make rettime relative to now and convert to ms */
nexttime = nexttime - now;
- LOG(("returning time to next event as %ldms", nexttime ));
+ LOG("returning time to next event as %ldms", nexttime);
/*return next event time in milliseconds (24days max wait) */
return nexttime;
@@ -213,14 +210,14 @@ void list_schedule(void)
{
struct nscallback *cur_nscb;
- LOG(("schedule list at ms clock %ld", MS_NOW() ));
+ LOG("schedule list at ms clock %ld", MS_NOW());
cur_nscb = schedule_list;
while (cur_nscb != NULL) {
- LOG(("Schedule %p at %ld", cur_nscb, cur_nscb->timeout ));
+ LOG("Schedule %p at %ld", cur_nscb, cur_nscb->timeout);
cur_nscb = cur_nscb->next;
}
- LOG(("Maxmium callbacks scheduled: %d", max_scheduled ));
+ LOG("Maxmium callbacks scheduled: %d", max_scheduled);
}