summaryrefslogtreecommitdiff
path: root/framebuffer/fbtk
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
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')
-rw-r--r--framebuffer/fbtk/event.c4
-rw-r--r--framebuffer/fbtk/fbtk.c23
-rw-r--r--framebuffer/fbtk/scroll.c4
3 files changed, 12 insertions, 19 deletions
diff --git a/framebuffer/fbtk/event.c b/framebuffer/fbtk/event.c
index 607db8984..aab150283 100644
--- a/framebuffer/fbtk/event.c
+++ b/framebuffer/fbtk/event.c
@@ -52,7 +52,7 @@ fbtk_input(fbtk_widget_t *root, nsfb_event_t *event)
/* obtain widget with input focus */
input = root->u.root.input;
if (input == NULL) {
- LOG(("No widget has input focus."));
+ LOG("No widget has input focus.");
return; /* no widget with input */
}
@@ -85,7 +85,7 @@ fbtk_click(fbtk_widget_t *widget, nsfb_event_t *event)
x = fbtk_get_absx(clicked);
y = fbtk_get_absy(clicked);
- LOG(("clicked %p at %d,%d", clicked, x, y));
+ LOG("clicked %p at %d,%d", clicked, x, y);
/* post the click */
fbtk_post_callback(clicked, FBTK_CBT_CLICK, event, cloc.x0 - x, cloc.y0 - y);
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);
diff --git a/framebuffer/fbtk/scroll.c b/framebuffer/fbtk/scroll.c
index e91c3ef6e..c86c8a6de 100644
--- a/framebuffer/fbtk/scroll.c
+++ b/framebuffer/fbtk/scroll.c
@@ -334,7 +334,7 @@ hscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
hpos = 0;
}
- LOG(("hscroll %d", hscroll));
+ LOG("hscroll %d", hscroll);
rect.x0 = bbox.x0 + 3 + hpos;
rect.y0 = bbox.y0 + 5;
@@ -362,7 +362,7 @@ hscrolll_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
newpos = scrollw->u.scroll.minimum;
if (newpos == scrollw->u.scroll.position) {
- LOG(("horiz scroll was the same %d", newpos));
+ LOG("horiz scroll was the same %d", newpos);
return 0;
}