summaryrefslogtreecommitdiff
path: root/framebuffer/fbtk/fbtk.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 /framebuffer/fbtk/fbtk.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 'framebuffer/fbtk/fbtk.c')
-rw-r--r--framebuffer/fbtk/fbtk.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/framebuffer/fbtk/fbtk.c b/framebuffer/fbtk/fbtk.c
index c36966c3e..882e5e5f2 100644
--- a/framebuffer/fbtk/fbtk.c
+++ b/framebuffer/fbtk/fbtk.c
@@ -52,7 +52,7 @@ dump_tk_tree(fbtk_widget_t *widget)
int indent = 0;
while (widget != NULL) {
- LOG(("%*s%p", indent, "", widget));
+ LOG("%*s%p", indent, "", widget);
if (widget->first_child != NULL) {
widget = widget->first_child;
indent += 6;
@@ -100,12 +100,7 @@ fbtk_request_redraw(fbtk_widget_t *widget)
widget->redraw.height = widget->height;
#ifdef FBTK_LOGGING
- LOG(("redrawing %p %d,%d %d,%d",
- widget,
- widget->redraw.x,
- widget->redraw.y,
- widget->redraw.width,
- widget->redraw.height));
+ LOG("redrawing %p %d,%d %d,%d", widget, widget->redraw.x, widget->redraw.y, widget->redraw.width, widget->redraw.height);
#endif
cwidget = widget->last_child;
@@ -126,7 +121,7 @@ fbtk_request_redraw(fbtk_widget_t *widget)
int
fbtk_set_mapping(fbtk_widget_t *widget, bool map)
{
- LOG(("setting mapping on %p to %d", widget, map));
+ LOG("setting mapping on %p to %d", widget, map);
widget->mapped = map;
if (map) {
fbtk_request_redraw(widget);
@@ -149,7 +144,7 @@ swap_siblings(fbtk_widget_t *lw)
assert(rw != NULL);
- LOG(("Swapping %p with %p", lw, rw));
+ LOG("Swapping %p with %p", lw, rw);
before = lw->prev;
after = rw->next;
@@ -415,7 +410,7 @@ fbtk_get_root_widget(fbtk_widget_t *widget)
/* check root widget was found */
if (widget->type != FB_WIDGET_TYPE_ROOT) {
- LOG(("Widget with null parent that is not the root widget!"));
+ LOG("Widget with null parent that is not the root widget!");
return NULL;
}
@@ -556,7 +551,7 @@ fbtk_widget_new(fbtk_widget_t *parent,
return NULL;
#ifdef FBTK_LOGGING
- LOG(("creating %p %d,%d %d,%d", neww, x, y, width, height));
+ LOG("creating %p %d,%d %d,%d", neww, x, y, width, height);
#endif
/* make new window fit inside parent */
@@ -579,7 +574,7 @@ fbtk_widget_new(fbtk_widget_t *parent,
}
#ifdef FBTK_LOGGING
- LOG(("using %p %d,%d %d,%d", neww, x, y, width, height));
+ LOG("using %p %d,%d %d,%d", neww, x, y, width, height);
#endif
/* set values */
neww->type = type;
@@ -639,9 +634,7 @@ do_redraw(nsfb_t *nsfb, fbtk_widget_t *widget)
plot_ctx.y1 = plot_ctx.y0 + widget->redraw.height;
#ifdef FBTK_LOGGING
- LOG(("clipping %p %d,%d %d,%d",
- widget, plot_ctx.x0, plot_ctx.y0,
- plot_ctx.x1, plot_ctx.y1));
+ LOG("clipping %p %d,%d %d,%d", widget, plot_ctx.x0, plot_ctx.y0, plot_ctx.x1, plot_ctx.y1);
#endif
if (nsfb_plot_set_clip(nsfb, &plot_ctx) == true) {
fbtk_post_callback(widget, FBTK_CBT_REDRAW);