summaryrefslogtreecommitdiff
path: root/render/html_css.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 /render/html_css.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 'render/html_css.c')
-rw-r--r--render/html_css.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/render/html_css.c b/render/html_css.c
index 89ab4477c..91a1e64dc 100644
--- a/render/html_css.c
+++ b/render/html_css.c
@@ -101,20 +101,17 @@ html_convert_css_callback(hlcache_handle *css,
switch (event->type) {
case CONTENT_MSG_DONE:
- LOG(("done stylesheet slot %d '%s'", i,
- nsurl_access(hlcache_handle_get_url(css))));
+ LOG("done stylesheet slot %d '%s'", i, nsurl_access(hlcache_handle_get_url(css)));
parent->base.active--;
- LOG(("%d fetches active", parent->base.active));
+ LOG("%d fetches active", parent->base.active);
break;
case CONTENT_MSG_ERROR:
- LOG(("stylesheet %s failed: %s",
- nsurl_access(hlcache_handle_get_url(css)),
- event->data.error));
+ LOG("stylesheet %s failed: %s", nsurl_access(hlcache_handle_get_url(css)), event->data.error);
hlcache_handle_release(css);
s->sheet = NULL;
parent->base.active--;
- LOG(("%d fetches active", parent->base.active));
+ LOG("%d fetches active", parent->base.active);
content_add_error(&parent->base, "?", 0);
break;
@@ -165,7 +162,7 @@ html_stylesheet_from_domnode(html_content *c,
exc = dom_node_get_text_content(node, &style);
if ((exc != DOM_NO_ERR) || (style == NULL)) {
- LOG(("No text content"));
+ LOG("No text content");
return NSERROR_OK;
}
@@ -196,7 +193,7 @@ html_stylesheet_from_domnode(html_content *c,
nsurl_unref(url);
c->base.active++;
- LOG(("%d fetches active", c->base.active));
+ LOG("%d fetches active", c->base.active);
return NSERROR_OK;
}
@@ -267,13 +264,13 @@ static bool html_css_process_modified_style(html_content *c,
error = html_stylesheet_from_domnode(c, s->node, &sheet);
if (error != NSERROR_OK) {
- LOG(("Failed to update sheet"));
+ LOG("Failed to update sheet");
content_broadcast_errorcode(&c->base, error);
return false;
}
if (sheet != NULL) {
- LOG(("Updating sheet %p with %p", s->sheet, sheet));
+ LOG("Updating sheet %p with %p", s->sheet, sheet);
if (s->sheet != NULL) {
switch (content_get_status(s->sheet)) {
@@ -282,7 +279,7 @@ static bool html_css_process_modified_style(html_content *c,
default:
hlcache_handle_abort(s->sheet);
c->base.active--;
- LOG(("%d fetches active", c->base.active));
+ LOG("%d fetches active", c->base.active);
}
hlcache_handle_release(s->sheet);
}
@@ -327,8 +324,7 @@ bool html_css_update_style(html_content *c, dom_node *style)
s = html_create_style_element(c, style);
}
if (s == NULL) {
- LOG(("Could not find or create inline stylesheet for %p",
- style));
+ LOG("Could not find or create inline stylesheet for %p", style);
return false;
}
@@ -401,8 +397,7 @@ bool html_css_process_link(html_content *htmlc, dom_node *node)
}
dom_string_unref(href);
- LOG(("linked stylesheet %i '%s'", htmlc->stylesheet_count,
- nsurl_access(joined)));
+ LOG("linked stylesheet %i '%s'", htmlc->stylesheet_count, nsurl_access(joined));
/* extend stylesheets array to allow for new sheet */
stylesheets = realloc(htmlc->stylesheets,
@@ -436,7 +431,7 @@ bool html_css_process_link(html_content *htmlc, dom_node *node)
htmlc->stylesheet_count++;
htmlc->base.active++;
- LOG(("%d fetches active", htmlc->base.active));
+ LOG("%d fetches active", htmlc->base.active);
return true;
@@ -501,7 +496,7 @@ nserror html_css_quirks_stylesheets(html_content *c)
}
c->base.active++;
- LOG(("%d fetches active", c->base.active));
+ LOG("%d fetches active", c->base.active);
}
return ns_error;
@@ -545,7 +540,7 @@ nserror html_css_new_stylesheets(html_content *c)
}
c->base.active++;
- LOG(("%d fetches active", c->base.active));
+ LOG("%d fetches active", c->base.active);
if (nsoption_bool(block_advertisements)) {
@@ -559,7 +554,7 @@ nserror html_css_new_stylesheets(html_content *c)
}
c->base.active++;
- LOG(("%d fetches active", c->base.active));
+ LOG("%d fetches active", c->base.active);
}
@@ -572,7 +567,7 @@ nserror html_css_new_stylesheets(html_content *c)
}
c->base.active++;
- LOG(("%d fetches active", c->base.active));
+ LOG("%d fetches active", c->base.active);
return ns_error;
}