From c105738fa36bb2400adc47399c5b878d252d1c86 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 28 May 2015 16:08:46 +0100 Subject: 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. --- windows/localhistory.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'windows/localhistory.c') diff --git a/windows/localhistory.c b/windows/localhistory.c index dfca4a4e1..674f198a0 100644 --- a/windows/localhistory.c +++ b/windows/localhistory.c @@ -86,7 +86,7 @@ static void nsws_localhistory_up(struct nsws_localhistory *l, struct gui_window .plot = &win_plotters }; - LOG(("gui window %p", gw)); + LOG("gui window %p", gw); l->vscroll = 0; l->hscroll = 0; @@ -125,7 +125,7 @@ nsws_localhistory_event_callback(HWND hwnd, UINT msg, 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); } @@ -305,7 +305,7 @@ struct nsws_localhistory *nsws_window_create_localhistory(struct gui_window *gw) int margin = 50; RECT r; - LOG(("gui window %p", gw)); + LOG("gui window %p", gw); /* if we already have a window, just update and re-show it */ if (gw->localhistory != NULL) { @@ -348,7 +348,7 @@ struct nsws_localhistory *nsws_window_create_localhistory(struct gui_window *gw) InitCommonControlsEx(&icc); - LOG(("creating local history window for hInstance %p", hInstance)); + LOG("creating local history window for hInstance %p", hInstance); localhistory->hwnd = CreateWindow(windowclassname_localhistory, "NetSurf History", WS_THICKFRAME | WS_HSCROLL | @@ -363,9 +363,7 @@ struct nsws_localhistory *nsws_window_create_localhistory(struct gui_window *gw) /* set the gui window associated with this browser */ SetProp(localhistory->hwnd, TEXT("GuiWnd"), (HANDLE)gw); - LOG(("gui_window %p width %d height %d hwnd %p", gw, - localhistory->guiwidth, localhistory->guiheight, - localhistory->hwnd)); + LOG("gui_window %p width %d height %d hwnd %p", gw, localhistory->guiwidth, localhistory->guiheight, localhistory->hwnd); nsws_localhistory_up(localhistory, gw); UpdateWindow(localhistory->hwnd); -- cgit v1.2.3