summaryrefslogtreecommitdiff
path: root/framebuffer/gui.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/gui.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/gui.c')
-rw-r--r--framebuffer/gui.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index 56fe41bc4..1c60bee2f 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -140,7 +140,7 @@ widget_scroll_y(struct gui_window *gw, int y, bool abs)
int content_width, content_height;
int height;
- LOG(("window scroll"));
+ LOG("window scroll");
if (abs) {
bwidget->pany = y - bwidget->scrolly;
} else {
@@ -224,7 +224,7 @@ fb_pan(fbtk_widget_t *widget,
height = fbtk_get_height(widget);
width = fbtk_get_width(widget);
- LOG(("panning %d, %d", bwidget->panx, bwidget->pany));
+ LOG("panning %d, %d", bwidget->panx, bwidget->pany);
x = fbtk_get_absx(widget);
y = fbtk_get_absy(widget);
@@ -400,7 +400,7 @@ fb_browser_window_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi)
bwidget = fbtk_get_userpw(widget);
if (bwidget == NULL) {
- LOG(("browser widget from widget %p was null", widget));
+ LOG("browser widget from widget %p was null", widget);
return -1;
}
@@ -452,7 +452,7 @@ process_cmdline(int argc, char** argv)
{0, 0, 0, 0 }
}; /* no long options */
- LOG(("argc %d, argv %p", argc, argv));
+ LOG("argc %d, argv %p", argc, argv);
fename = "sdl";
febpp = 32;
@@ -521,7 +521,7 @@ static nserror set_defaults(struct nsoption_s *defaults)
if (nsoption_charp(cookie_file) == NULL ||
nsoption_charp(cookie_jar) == NULL) {
- LOG(("Failed initialising cookie options"));
+ LOG("Failed initialising cookie options");
return NSERROR_BAD_PARAMETER;
}
@@ -599,7 +599,7 @@ static void framebuffer_run(void)
static void gui_quit(void)
{
- LOG(("gui_quit"));
+ LOG("gui_quit");
urldb_save_cookies(nsoption_charp(cookie_jar));
@@ -626,7 +626,7 @@ fb_browser_window_click(fbtk_widget_t *widget, fbtk_callback_info *cbi)
cbi->event->type != NSFB_EVENT_KEY_UP)
return 0;
- LOG(("browser window clicked at %d,%d", cbi->x, cbi->y));
+ LOG("browser window clicked at %d,%d", cbi->x, cbi->y);
switch (cbi->event->type) {
case NSFB_EVENT_KEY_DOWN:
@@ -809,7 +809,7 @@ fb_browser_window_input(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static fbtk_modifier_type modifier = FBTK_MOD_CLEAR;
int ucs4 = -1;
- LOG(("got value %d", cbi->event->value.keycode));
+ LOG("got value %d", cbi->event->value.keycode);
switch (cbi->event->type) {
case NSFB_EVENT_KEY_DOWN:
@@ -1185,7 +1185,7 @@ create_toolbar(struct gui_window *gw,
toolbar_layout = NSFB_TOOLBAR_DEFAULT_LAYOUT;
}
- LOG(("Using toolbar layout %s", toolbar_layout));
+ LOG("Using toolbar layout %s", toolbar_layout);
itmtype = toolbar_layout;
@@ -1219,7 +1219,7 @@ create_toolbar(struct gui_window *gw,
(*itmtype != 0) &&
(xdir !=0)) {
- LOG(("toolbar adding %c", *itmtype));
+ LOG("toolbar adding %c", *itmtype);
switch (*itmtype) {
@@ -1361,7 +1361,7 @@ create_toolbar(struct gui_window *gw,
default:
widget = NULL;
xdir = 0;
- LOG(("Unknown element %c in toolbar layout", *itmtype));
+ LOG("Unknown element %c in toolbar layout", *itmtype);
break;
}
@@ -1370,7 +1370,7 @@ create_toolbar(struct gui_window *gw,
xpos += (xdir * (fbtk_get_width(widget) + padding));
}
- LOG(("xpos is %d",xpos));
+ LOG("xpos is %d", xpos);
itmtype += xdir;
}
@@ -1580,7 +1580,7 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width)
int statusbar_width = 0;
int toolbar_height = nsoption_int(fb_toolbar_size);
- LOG(("Normal window"));
+ LOG("Normal window");
gw->window = fbtk_create_window(fbtk, 0, 0, 0, 0, 0);
@@ -1611,7 +1611,7 @@ create_normal_browser_window(struct gui_window *gw, int furniture_width)
false);
fbtk_set_handler(gw->status, FBTK_CBT_POINTERENTER, set_ptr_default_move, NULL);
- LOG(("status bar %p at %d,%d", gw->status, fbtk_get_absx(gw->status), fbtk_get_absy(gw->status)));
+ LOG("status bar %p at %d,%d", gw->status, fbtk_get_absx(gw->status), fbtk_get_absy(gw->status));
/* create horizontal scrollbar */
gw->hscroll = fbtk_create_hscroll(gw->window,
@@ -2027,7 +2027,7 @@ gui_window_remove_caret(struct gui_window *g)
static void framebuffer_window_reformat(struct gui_window *gw)
{
/** @todo if we ever do zooming reformat should be implemented */
- LOG(("window:%p", gw));
+ LOG("window:%p", gw);
/*
browser_window_reformat(gw->bw, false, width, height);
@@ -2138,7 +2138,7 @@ main(int argc, char** argv)
/* create an initial browser window */
- LOG(("calling browser_window_create"));
+ LOG("calling browser_window_create");
ret = nsurl_create(feurl, &url);
if (ret == NSERROR_OK) {
@@ -2160,7 +2160,7 @@ main(int argc, char** argv)
netsurf_exit();
if (fb_font_finalise() == false)
- LOG(("Font finalisation failed."));
+ LOG("Font finalisation failed.");
/* finalise options */
nsoption_finalise(nsoptions, nsoptions_default);