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 /windows/download.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 'windows/download.c')
-rw-r--r-- | windows/download.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/windows/download.c b/windows/download.c index 995ca1386..e1641bae3 100644 --- a/windows/download.c +++ b/windows/download.c @@ -137,8 +137,7 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) strcat(destination, "/"); if (strlen(destination) + strlen(filename) < PATH_MAX - 1) strcat(destination, filename); - LOG(("download %s [%s] from %s to %s", filename, size, domain, - destination)); + LOG("download %s [%s] from %s to %s", filename, size, domain, destination); w->title = filename; w->domain = domain; w->size = total_size; @@ -308,7 +307,7 @@ gui_download_window_data(struct gui_download_window *w, const char *data, struct timeval val; res = fwrite((void *)data, 1, size, w->file); if (res != size) - LOG(("file write error %d of %d", size - res, size)); + LOG("file write error %d of %d", size - res, size); w->downloaded += res; w->progress = (unsigned int)(((long long)(w->downloaded) * 10000) / w->size); @@ -322,7 +321,7 @@ gui_download_window_data(struct gui_download_window *w, const char *data, static void gui_download_window_error(struct gui_download_window *w, const char *error_msg) { - LOG(("error %s", error_msg)); + LOG("error %s", error_msg); } static void gui_download_window_done(struct gui_download_window *w) |