From 0d811963c1498aa625b5438bf66dbb677a0d4494 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 28 May 2015 17:06:18 +0100 Subject: fixup all the remaining logging macro callsites The semantic patch tool appears to have missed some difficult to reason about callsites which have now been manually cleaned up --- windows/plot.c | 44 ++++++++++++++++++++++---------------------- windows/prefs.c | 2 +- windows/schedule.c | 22 +++++++++++----------- windows/windbg.h | 2 +- windows/window.c | 14 +++++++------- 5 files changed, 42 insertions(+), 42 deletions(-) (limited to 'windows') diff --git a/windows/plot.c b/windows/plot.c index 4b281162a..86870ea4e 100644 --- a/windows/plot.c +++ b/windows/plot.c @@ -42,9 +42,9 @@ /* #define NSWS_PLOT_DEBUG */ #ifdef NSWS_PLOT_DEBUG -#define PLOT_LOG(x) LOG(x) +#define PLOT_LOG(x...) LOG(x) #else -#define PLOT_LOG(x) +#define PLOT_LOG(x...) ((void) 0) #endif HDC plot_hdc; @@ -53,7 +53,7 @@ static RECT plot_clip; /* currently set clipping rectangle */ static bool clip(const struct rect *clip) { - PLOT_LOG(("clip %d,%d to %d,%d", clip->x0, clip->y0, clip->x1, clip->y1)); + PLOT_LOG("clip %d,%d to %d,%d", clip->x0, clip->y0, clip->x1, clip->y1); plot_clip.left = clip->x0; plot_clip.top = clip->y0; @@ -65,7 +65,7 @@ static bool clip(const struct rect *clip) static bool line(int x0, int y0, int x1, int y1, const plot_style_t *style) { - PLOT_LOG(("from %d,%d to %d,%d", x0, y0, x1, y1)); + PLOT_LOG("from %d,%d to %d,%d", x0, y0, x1, y1); /* ensure the plot HDC is set */ if (plot_hdc == NULL) { @@ -120,7 +120,7 @@ static bool line(int x0, int y0, int x1, int y1, const plot_style_t *style) static bool rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style) { - PLOT_LOG(("rectangle from %d,%d to %d,%d", x0, y0, x1, y1)); + PLOT_LOG("rectangle from %d,%d to %d,%d", x0, y0, x1, y1); /* ensure the plot HDC is set */ if (plot_hdc == NULL) { @@ -187,7 +187,7 @@ static bool rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style) static bool polygon(const int *p, unsigned int n, const plot_style_t *style) { - PLOT_LOG(("polygon %d points", n)); + PLOT_LOG("polygon %d points", n); /* ensure the plot HDC is set */ if (plot_hdc == NULL) { @@ -235,7 +235,7 @@ static bool polygon(const int *p, unsigned int n, const plot_style_t *style) points[i].x = (long) p[2 * i]; points[i].y = (long) p[2 * i + 1]; - PLOT_LOG(("%ld,%ld ", points[i].x, points[i].y)); + PLOT_LOG("%ld,%ld ", points[i].x, points[i].y); } SelectClipRgn(plot_hdc, clipregion); @@ -258,7 +258,7 @@ static bool polygon(const int *p, unsigned int n, const plot_style_t *style) static bool text(int x, int y, const char *text, size_t length, const plot_font_style_t *style) { - PLOT_LOG(("words %s at %d,%d", text, x, y)); + PLOT_LOG("words %s at %d,%d", text, x, y); /* ensure the plot HDC is set */ if (plot_hdc == NULL) { @@ -317,7 +317,7 @@ static bool text(int x, int y, const char *text, size_t length, static bool disc(int x, int y, int radius, const plot_style_t *style) { - PLOT_LOG(("disc at %d,%d radius %d", x, y, radius)); + PLOT_LOG("disc at %d,%d radius %d", x, y, radius); /* ensure the plot HDC is set */ if (plot_hdc == NULL) { @@ -387,8 +387,8 @@ static bool disc(int x, int y, int radius, const plot_style_t *style) static bool arc(int x, int y, int radius, int angle1, int angle2, const plot_style_t *style) { - PLOT_LOG(("arc centre %d,%d radius %d from %d to %d", x, y, radius, - angle1, angle2)); + PLOT_LOG("arc centre %d,%d radius %d from %d to %d", x, y, radius, + angle1, angle2); /* ensure the plot HDC is set */ if (plot_hdc == NULL) { @@ -565,8 +565,8 @@ plot_alpha_bitmap(HDC hdc, BITMAPINFO *bmi; HBITMAP MemBMh; - PLOT_LOG(("%p bitmap %d,%d width %d height %d", bitmap, x, y, width, height)); - PLOT_LOG(("clipped %ld,%ld to %ld,%ld",plot_clip.left, plot_clip.top, plot_clip.right, plot_clip.bottom)); + PLOT_LOG("%p bitmap %d,%d width %d height %d", bitmap, x, y, width, height); + PLOT_LOG("clipped %ld,%ld to %ld,%ld",plot_clip.left, plot_clip.top, plot_clip.right, plot_clip.bottom); Memhdc = CreateCompatibleDC(hdc); if (Memhdc == NULL) { @@ -575,8 +575,8 @@ plot_alpha_bitmap(HDC hdc, if ((bitmap->width != width) || (bitmap->height != height)) { - PLOT_LOG(("scaling from %d,%d to %d,%d", - bitmap->width, bitmap->height, width, height)); + PLOT_LOG("scaling from %d,%d to %d,%d", + bitmap->width, bitmap->height, width, height); bitmap = bitmap_scale(bitmap, width, height); if (bitmap == NULL) return false; @@ -735,7 +735,7 @@ plot_bitmap(struct bitmap *bitmap, int x, int y, int width, int height) bltres = plot_alpha_bitmap(plot_hdc, bitmap, x, y, width, height); } - PLOT_LOG(("bltres = %d", bltres)); + PLOT_LOG("bltres = %d", bltres); DeleteObject(clipregion); @@ -755,7 +755,7 @@ windows_plot_bitmap(int x, int y, /* Bail early if we can */ - PLOT_LOG(("Plotting %p at %d,%d by %d,%d",bitmap, x,y,width,height)); + PLOT_LOG("Plotting %p at %d,%d by %d,%d",bitmap, x,y,width,height); if (bitmap == NULL) { LOG("Passed null bitmap!"); @@ -812,8 +812,8 @@ windows_plot_bitmap(int x, int y, } } - PLOT_LOG(("Tiled plotting %d,%d by %d,%d",x,y,width,height)); - PLOT_LOG(("clipped %ld,%ld to %ld,%ld",plot_clip.left, plot_clip.top, plot_clip.right, plot_clip.bottom)); + PLOT_LOG("Tiled plotting %d,%d by %d,%d",x,y,width,height); + PLOT_LOG("clipped %ld,%ld to %ld,%ld",plot_clip.left, plot_clip.top, plot_clip.right, plot_clip.bottom); /* get left most tile position */ if (repeat_x) @@ -823,7 +823,7 @@ windows_plot_bitmap(int x, int y, if (repeat_y) for (; y > plot_clip.top; y -= height); - PLOT_LOG(("repeat from %d,%d to %ld,%ld", x, y, plot_clip.right, plot_clip.bottom)); + PLOT_LOG("repeat from %d,%d to %ld,%ld", x, y, plot_clip.right, plot_clip.bottom); /* tile down and across to extents */ for (xf = x; xf < plot_clip.right; xf += width) { @@ -842,14 +842,14 @@ windows_plot_bitmap(int x, int y, static bool flush(void) { - PLOT_LOG(("flush unimplemented")); + PLOT_LOG("flush unimplemented"); return true; } static bool path(const float *p, unsigned int n, colour fill, float width, colour c, const float transform[6]) { - PLOT_LOG(("path unimplemented")); + PLOT_LOG("path unimplemented"); return true; } diff --git a/windows/prefs.c b/windows/prefs.c index e933cc10d..1f8dfc95e 100644 --- a/windows/prefs.c +++ b/windows/prefs.c @@ -266,7 +266,7 @@ static BOOL CALLBACK options_appearance_dialog_handler(HWND hwnd, case WM_COMMAND: - LOG(("WM_COMMAND Identifier 0x%x",LOWORD(wparam))); + LOG("WM_COMMAND Identifier 0x%x",LOWORD(wparam)); switch(LOWORD(wparam)) { case IDC_PREFS_PROXYTYPE: diff --git a/windows/schedule.c b/windows/schedule.c index 428aa227c..eb9ed3bc4 100644 --- a/windows/schedule.c +++ b/windows/schedule.c @@ -26,9 +26,9 @@ #include "windows/schedule.h" #ifdef DEBUG_SCHEDULER -#define SRLOG(x) LOG(x) +#define SRLOG(x...) LOG(x) #else -#define SRLOG(x) +#define SRLOG(x...) ((void) 0) #endif /* linked list of scheduled callbacks */ @@ -66,7 +66,7 @@ static nserror schedule_remove(void (*callback)(void *p), void *p) return NSERROR_OK; } - SRLOG(("removing %p, %p", callback, p)); + SRLOG("removing %p, %p", callback, p); cur_nscb = schedule_list; prev_nscb = NULL; @@ -76,8 +76,8 @@ static nserror schedule_remove(void (*callback)(void *p), void *p) (cur_nscb->p == p)) { /* item to remove */ - SRLOG(("callback entry %p removing %p(%p)", - cur_nscb, cur_nscb->callback, cur_nscb->p)); + SRLOG("callback entry %p removing %p(%p)", + cur_nscb, cur_nscb->callback, cur_nscb->p); /* remove callback */ unlnk_nscb = cur_nscb; @@ -118,8 +118,8 @@ nserror win32_schedule(int ival, void (*callback)(void *p), void *p) return NSERROR_NOMEM; } - SRLOG(("adding callback %p for %p(%p) at %d cs", - nscb, callback, p, ival)); + SRLOG("adding callback %p for %p(%p) at %d cs", + nscb, callback, p, ival); gettimeofday(&nscb->tv, NULL); timeradd(&nscb->tv, &tv, &nscb->tv); @@ -168,8 +168,8 @@ schedule_run(void) prev_nscb->next = unlnk_nscb->next; } - SRLOG(("callback entry %p running %p(%p)", - unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p)); + SRLOG("callback entry %p running %p(%p)", + unlnk_nscb, unlnk_nscb->callback, unlnk_nscb->p); /* call callback */ unlnk_nscb->callback(unlnk_nscb->p); @@ -201,8 +201,8 @@ schedule_run(void) /* make returned time relative to now */ timersub(&nexttime, &tv, &rettime); - SRLOG(("returning time to next event as %ldms", - (rettime.tv_sec * 1000) + (rettime.tv_usec / 1000))); + SRLOG("returning time to next event as %ldms", + (rettime.tv_sec * 1000) + (rettime.tv_usec / 1000)); /* return next event time in milliseconds (24days max wait) */ return (rettime.tv_sec * 1000) + (rettime.tv_usec / 1000); diff --git a/windows/windbg.h b/windows/windbg.h index f75206ae4..bb23b2335 100644 --- a/windows/windbg.h +++ b/windows/windbg.h @@ -29,6 +29,6 @@ void win_perror(const char *lpszFunction); ((m) != WM_MOUSEMOVE) && \ ((m) != WM_NCHITTEST) && \ ((m) != WM_ENTERIDLE)) \ - LOG(("%s, hwnd %p, w 0x%x, l 0x%x", msg_num_to_name(m), h, w, l)); + LOG("%s, hwnd %p, w 0x%x, l 0x%x", msg_num_to_name(m), h, w, l); #endif diff --git a/windows/window.c b/windows/window.c index 3775af118..455e6e5f5 100644 --- a/windows/window.c +++ b/windows/window.c @@ -763,7 +763,7 @@ static void nsws_set_scale(struct gui_window *gw, float scale) */ static void win32_window_redraw_window(struct gui_window *gw) { - /* LOG(("gw:%p", gw)); */ + /* LOG("gw:%p", gw); */ if (gw != NULL) { RedrawWindow(gw->drawingarea, NULL, NULL, RDW_INVALIDATE | RDW_NOERASE); @@ -794,7 +794,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy) return; } - /*LOG(("scroll sx,sy:%d,%d x,y:%d,%d w.h:%d,%d",sx,sy,w->scrollx,w->scrolly, width,height));*/ + /*LOG("scroll sx,sy:%d,%d x,y:%d,%d w.h:%d,%d",sx,sy,w->scrollx,w->scrolly, width,height);*/ /* The resulting gui window scroll must remain withn the * windows bounding box. @@ -814,7 +814,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy) w->requestscrolly = sy - w->scrolly; } - /*LOG(("requestscroll x,y:%d,%d", w->requestscrollx, w->requestscrolly));*/ + /*LOG("requestscroll x,y:%d,%d", w->requestscrollx, w->requestscrolly);*/ /* set the vertical scroll offset */ si.cbSize = sizeof(si); @@ -825,7 +825,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy) si.nPos = max(w->scrolly + w->requestscrolly, 0); si.nPos = min(si.nPos, height - w->height); SetScrollInfo(w->drawingarea, SB_VERT, &si, TRUE); - /*LOG(("SetScrollInfo VERT min:%d max:%d page:%d pos:%d", si.nMin, si.nMax, si.nPage, si.nPos));*/ + /*LOG("SetScrollInfo VERT min:%d max:%d page:%d pos:%d", si.nMin, si.nMax, si.nPage, si.nPos);*/ /* set the horizontal scroll offset */ si.cbSize = sizeof(si); @@ -836,7 +836,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy) si.nPos = max(w->scrollx + w->requestscrollx, 0); si.nPos = min(si.nPos, width - w->width); SetScrollInfo(w->drawingarea, SB_HORZ, &si, TRUE); - /*LOG(("SetScrollInfo HORZ min:%d max:%d page:%d pos:%d", si.nMin, si.nMax, si.nPage, si.nPos));*/ + /*LOG("SetScrollInfo HORZ min:%d max:%d page:%d pos:%d", si.nMin, si.nMax, si.nPage, si.nPos);*/ /* Set caret position */ GetCaretPos(&p); @@ -850,7 +850,7 @@ void win32_window_set_scroll(struct gui_window *w, int sx, int sy) r.left = 0; r.right = w->width + 1; ScrollWindowEx(w->drawingarea, - w->requestscrollx, - w->requestscrolly, &r, NULL, NULL, &redraw, SW_INVALIDATE); - /*LOG(("ScrollWindowEx %d, %d", - w->requestscrollx, - w->requestscrolly));*/ + /*LOG("ScrollWindowEx %d, %d", - w->requestscrollx, - w->requestscrolly);*/ w->scrolly += w->requestscrolly; w->scrollx += w->requestscrollx; w->requestscrollx = 0; @@ -1430,7 +1430,7 @@ static void win32_window_destroy(struct gui_window *w) static void win32_window_update_box(struct gui_window *gw, const struct rect *rect) { - /* LOG(("gw:%p %f,%f %f,%f", gw, data->redraw.x, data->redraw.y, data->redraw.width, data->redraw.height)); */ + /* LOG("gw:%p %f,%f %f,%f", gw, data->redraw.x, data->redraw.y, data->redraw.width, data->redraw.height); */ if (gw == NULL) return; -- cgit v1.2.3