From 75018632a9b953aafeae6f4e8aea607fd1d89dca Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 6 Sep 2017 18:28:12 +0100 Subject: Use coccinelle to change logging macro calls in c files for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done @@ expression E; @@ -LOG(E); +NSLOG(netsurf, INFO, E); @@ expression E, E1; @@ -LOG(E, E1); +NSLOG(netsurf, INFO, E, E1); @@ expression E, E1, E2; @@ -LOG(E, E1, E2); +NSLOG(netsurf, INFO, E, E1, E2); @@ expression E, E1, E2, E3; @@ -LOG(E, E1, E2, E3); +NSLOG(netsurf, INFO, E, E1, E2, E3); @@ expression E, E1, E2, E3, E4; @@ -LOG(E, E1, E2, E3, E4); +NSLOG(netsurf, INFO, E, E1, E2, E3, E4); @@ expression E, E1, E2, E3, E4, E5; @@ -LOG(E, E1, E2, E3, E4, E5); +NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5); @@ expression E, E1, E2, E3, E4, E5, E6; @@ -LOG(E, E1, E2, E3, E4, E5, E6); +NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6); @@ expression E, E1, E2, E3, E4, E5, E6, E7; @@ -LOG(E, E1, E2, E3, E4, E5, E6, E7); +NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7); --- frontends/framebuffer/fbtk/event.c | 4 ++-- frontends/framebuffer/fbtk/fbtk.c | 22 ++++++++++++++-------- frontends/framebuffer/fbtk/scroll.c | 4 ++-- 3 files changed, 18 insertions(+), 12 deletions(-) (limited to 'frontends/framebuffer/fbtk') diff --git a/frontends/framebuffer/fbtk/event.c b/frontends/framebuffer/fbtk/event.c index a48e63809..84c6c3791 100644 --- a/frontends/framebuffer/fbtk/event.c +++ b/frontends/framebuffer/fbtk/event.c @@ -51,7 +51,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."); + NSLOG(netsurf, INFO, "No widget has input focus."); return; /* no widget with input */ } @@ -84,7 +84,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); + NSLOG(netsurf, INFO, "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/frontends/framebuffer/fbtk/fbtk.c b/frontends/framebuffer/fbtk/fbtk.c index c63a6d8c9..a0b0f6660 100644 --- a/frontends/framebuffer/fbtk/fbtk.c +++ b/frontends/framebuffer/fbtk/fbtk.c @@ -53,7 +53,7 @@ dump_tk_tree(fbtk_widget_t *widget) int indent = 0; while (widget != NULL) { - LOG("%*s%p", indent, "", widget); + NSLOG(netsurf, INFO, "%*s%p", indent, "", widget); if (widget->first_child != NULL) { widget = widget->first_child; indent += 6; @@ -101,7 +101,9 @@ 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); + NSLOG(netsurf, INFO, "redrawing %p %d,%d %d,%d", widget, + widget->redraw.x, widget->redraw.y, widget->redraw.width, + widget->redraw.height); #endif cwidget = widget->last_child; @@ -122,7 +124,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); + NSLOG(netsurf, INFO, "setting mapping on %p to %d", widget, map); widget->mapped = map; if (map) { fbtk_request_redraw(widget); @@ -145,7 +147,7 @@ swap_siblings(fbtk_widget_t *lw) assert(rw != NULL); - LOG("Swapping %p with %p", lw, rw); + NSLOG(netsurf, INFO, "Swapping %p with %p", lw, rw); before = lw->prev; after = rw->next; @@ -411,7 +413,8 @@ 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!"); + NSLOG(netsurf, INFO, + "Widget with null parent that is not the root widget!"); return NULL; } @@ -552,7 +555,8 @@ fbtk_widget_new(fbtk_widget_t *parent, return NULL; #ifdef FBTK_LOGGING - LOG("creating %p %d,%d %d,%d", neww, x, y, width, height); + NSLOG(netsurf, INFO, "creating %p %d,%d %d,%d", neww, x, y, width, + height); #endif /* make new window fit inside parent */ @@ -575,7 +579,8 @@ fbtk_widget_new(fbtk_widget_t *parent, } #ifdef FBTK_LOGGING - LOG("using %p %d,%d %d,%d", neww, x, y, width, height); + NSLOG(netsurf, INFO, "using %p %d,%d %d,%d", neww, x, y, width, + height); #endif /* set values */ neww->type = type; @@ -635,7 +640,8 @@ 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); + NSLOG(netsurf, INFO, "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/frontends/framebuffer/fbtk/scroll.c b/frontends/framebuffer/fbtk/scroll.c index cc98fb2dd..b056ac81f 100644 --- a/frontends/framebuffer/fbtk/scroll.c +++ b/frontends/framebuffer/fbtk/scroll.c @@ -334,7 +334,7 @@ hscroll_redraw(fbtk_widget_t *widget, fbtk_callback_info *cbi) hpos = 0; } - LOG("hscroll %d", hscroll); + NSLOG(netsurf, INFO, "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); + NSLOG(netsurf, INFO, "horiz scroll was the same %d", newpos); return 0; } -- cgit v1.2.3