summaryrefslogtreecommitdiff
path: root/windows/drawable.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 /windows/drawable.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 'windows/drawable.c')
-rw-r--r--windows/drawable.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/windows/drawable.c b/windows/drawable.c
index f53e5d4d2..317143a46 100644
--- a/windows/drawable.c
+++ b/windows/drawable.c
@@ -76,7 +76,7 @@ nsws_drawable_vscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
SCROLLINFO si;
int mem;
- LOG(("VSCROLL %d", gw->requestscrolly));
+ LOG("VSCROLL %d", gw->requestscrolly);
if (gw->requestscrolly != 0)
return 0;
@@ -148,7 +148,7 @@ nsws_drawable_hscroll(struct gui_window *gw, HWND hwnd, WPARAM wparam)
SCROLLINFO si;
int mem;
- LOG(("HSCROLL %d", gw->requestscrollx));
+ LOG("HSCROLL %d", gw->requestscrollx);
if (gw->requestscrollx != 0)
return 0;
@@ -357,7 +357,7 @@ nsws_drawable_mouseup(struct gui_window *gw,
(gw->bw == NULL))
return 0;
- LOG(("state 0x%x, press 0x%x", gw->mouse->state, press));
+ LOG("state 0x%x, press 0x%x", gw->mouse->state, press);
if ((gw->mouse->state & press) != 0) {
gw->mouse->state &= ~press;
gw->mouse->state |= click;
@@ -371,10 +371,7 @@ nsws_drawable_mouseup(struct gui_window *gw,
gw->mouse->state &= ~BROWSER_MOUSE_MOD_3;
if ((gw->mouse->state & click) != 0) {
- LOG(("mouse click bw %p, state 0x%x, x %f, y %f",gw->bw,
- gw->mouse->state,
- (x + gw->scrollx) / gw->scale,
- (y + gw->scrolly) / gw->scale));
+ LOG("mouse click bw %p, state 0x%x, x %f, y %f", gw->bw, gw->mouse->state, (x + gw->scrollx) / gw->scale, (y + gw->scrolly) / gw->scale);
browser_window_mouse_click(gw->bw,
gw->mouse->state,
@@ -418,10 +415,7 @@ nsws_drawable_mousedown(struct gui_window *gw,
gw->mouse->pressed_x = (x + gw->scrollx) / gw->scale;
gw->mouse->pressed_y = (y + gw->scrolly) / gw->scale;
- LOG(("mouse click bw %p, state %x, x %f, y %f", gw->bw,
- gw->mouse->state,
- (x + gw->scrollx) / gw->scale,
- (y + gw->scrolly) / gw->scale));
+ LOG("mouse click bw %p, state %x, x %f, y %f", gw->bw, gw->mouse->state, (x + gw->scrollx) / gw->scale, (y + gw->scrolly) / gw->scale);
browser_window_mouse_click(gw->bw, gw->mouse->state,
(x + gw->scrollx) / gw->scale,
@@ -453,7 +447,7 @@ nsws_drawable_mousemove(struct gui_window *gw, int x, int y)
(abs(x - gw->mouse->pressed_x) >= 5) &&
(abs(y - gw->mouse->pressed_y) >= 5)) {
- LOG(("Drag start state 0x%x", gw->mouse->state));
+ LOG("Drag start state 0x%x", gw->mouse->state);
if ((gw->mouse->state & BROWSER_MOUSE_PRESS_1) != 0) {
browser_window_mouse_click(gw->bw, BROWSER_MOUSE_DRAG_1,
@@ -501,7 +495,7 @@ nsws_window_drawable_event_callback(HWND hwnd,
gw = nsws_get_gui_window(hwnd);
if (gw == NULL) {
- LOG(("Unable to find gui window structure for hwnd %p", hwnd));
+ LOG("Unable to find gui window structure for hwnd %p", hwnd);
return DefWindowProc(hwnd, msg, wparam, lparam);
}
@@ -590,7 +584,7 @@ nsws_window_create_drawable(HINSTANCE hinstance,
if (hwnd == NULL) {
win_perror("WindowCreateDrawable");
- LOG(("Window creation failed"));
+ LOG("Window creation failed");
return NULL;
}