diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-05-28 16:08:46 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-05-28 16:08:46 +0100 |
commit | c105738fa36bb2400adc47399c5b878d252d1c86 (patch) | |
tree | 138eeb449e1bf51ee1726b5f820740aada0ccd0b /monkey/poll.c | |
parent | 20f2c86a511f7913cf858e7bd3668b0b59663ba0 (diff) | |
download | netsurf-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 'monkey/poll.c')
-rw-r--r-- | monkey/poll.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/monkey/poll.c b/monkey/poll.c index 6e96919a1..3ec31af86 100644 --- a/monkey/poll.c +++ b/monkey/poll.c @@ -29,7 +29,7 @@ #ifdef DEBUG_POLL_LOOP #include "utils/log.h" #else -#define LOG(X) +#define LOG(fmt, args...) ((void) 0) #endif @@ -103,7 +103,7 @@ void monkey_poll(void) fd->events = G_IO_IN | G_IO_HUP | G_IO_ERR; g_main_context_add_poll(0, fd, 0); fd_list[fd_count++] = fd; - LOG(("Want to read %d", i)); + LOG("Want to read %d", i); } if (FD_ISSET(i, &write_fd_set)) { GPollFD *fd = malloc(sizeof *fd); @@ -111,7 +111,7 @@ void monkey_poll(void) fd->events = G_IO_OUT | G_IO_ERR; g_main_context_add_poll(0, fd, 0); fd_list[fd_count++] = fd; - LOG(("Want to write %d", i)); + LOG("Want to write %d", i); } if (FD_ISSET(i, &exc_fd_set)) { GPollFD *fd = malloc(sizeof *fd); @@ -119,13 +119,13 @@ void monkey_poll(void) fd->events = G_IO_ERR; g_main_context_add_poll(0, fd, 0); fd_list[fd_count++] = fd; - LOG(("Want to check %d", i)); + LOG("Want to check %d", i); } } schedule_run(); - LOG(("Iterate %sblocking", block?"":"non-")); + LOG("Iterate %sblocking", block ? "" : "non-"); if (block) { fprintf(stdout, "GENERIC POLL BLOCKING\n"); } |