summaryrefslogtreecommitdiff
path: root/content/fetchers/data.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 /content/fetchers/data.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 'content/fetchers/data.c')
-rw-r--r--content/fetchers/data.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/content/fetchers/data.c b/content/fetchers/data.c
index ecf77b048..00494ccc7 100644
--- a/content/fetchers/data.c
+++ b/content/fetchers/data.c
@@ -62,7 +62,7 @@ static CURL *curl;
static bool fetch_data_initialise(lwc_string *scheme)
{
- LOG(("fetch_data_initialise called for %s", lwc_string_data(scheme)));
+ LOG("fetch_data_initialise called for %s", lwc_string_data(scheme));
if ( (curl = curl_easy_init()) == NULL)
return false;
else
@@ -71,7 +71,7 @@ static bool fetch_data_initialise(lwc_string *scheme)
static void fetch_data_finalise(lwc_string *scheme)
{
- LOG(("fetch_data_finalise called for %s", lwc_string_data(scheme)));
+ LOG("fetch_data_finalise called for %s", lwc_string_data(scheme));
curl_easy_cleanup(curl);
}
@@ -154,7 +154,7 @@ static bool fetch_data_process(struct fetch_data_context *c)
* data must still be there.
*/
- LOG(("url: %.140s", c->url));
+ LOG("url: %.140s", c->url);
if (strlen(c->url) < 6) {
/* 6 is the minimum possible length (data:,) */
@@ -263,8 +263,7 @@ static void fetch_data_poll(lwc_string *scheme)
char header[64];
fetch_set_http_code(c->parent_fetch, 200);
- LOG(("setting data: MIME type to %s, length to %zd",
- c->mimetype, c->datalen));
+ LOG("setting data: MIME type to %s, length to %zd", c->mimetype, c->datalen);
/* Any callback can result in the fetch being aborted.
* Therefore, we _must_ check for this after _every_
* call to fetch_data_send_callback().
@@ -300,7 +299,7 @@ static void fetch_data_poll(lwc_string *scheme)
fetch_data_send_callback(&msg, c);
}
} else {
- LOG(("Processing of %s failed!", c->url));
+ LOG("Processing of %s failed!", c->url);
/* Ensure that we're unlocked here. If we aren't,
* then fetch_data_process() is broken.