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. --- gtk/print.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'gtk/print.c') diff --git a/gtk/print.c b/gtk/print.c index 53fbed083..e5e9e847f 100644 --- a/gtk/print.c +++ b/gtk/print.c @@ -137,8 +137,7 @@ static inline void nsgtk_print_set_dashed(void) /** Set clipping area for subsequent plot operations. */ static bool nsgtk_print_plot_clip(const struct rect *clip) { - LOG(("Clipping. x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", - clip->x0, clip->y0, clip->x1, clip->y1)); + LOG("Clipping. x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", clip->x0, clip->y0, clip->x1, clip->y1); /* Normalize cllipping area - to prevent overflows. * See comment in pdf_plot_fill. */ @@ -248,7 +247,7 @@ static bool nsgtk_print_plot_line(int x0, int y0, int x1, int y1, const plot_sty static bool nsgtk_print_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *style) { - LOG(("x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", x0,y0,x1,y1)); + LOG("x0: %i ;\t y0: %i ;\t x1: %i ;\t y1: %i", x0, y0, x1, y1); if (style->fill_type != PLOT_OP_TYPE_NONE) { @@ -302,7 +301,7 @@ static bool nsgtk_print_plot_polygon(const int *p, unsigned int n, const plot_st { unsigned int i; - LOG(("Plotting polygon.")); + LOG("Plotting polygon."); nsgtk_print_set_colour(style->fill_colour); nsgtk_print_set_solid(); @@ -310,11 +309,11 @@ static bool nsgtk_print_plot_polygon(const int *p, unsigned int n, const plot_st cairo_set_line_width(gtk_print_current_cr, 0); cairo_move_to(gtk_print_current_cr, p[0], p[1]); - LOG(("Starting line at: %i\t%i",p[0],p[1])); + LOG("Starting line at: %i\t%i", p[0], p[1]); for (i = 1; i != n; i++) { cairo_line_to(gtk_print_current_cr, p[i * 2], p[i * 2 + 1]); - LOG(("Drawing line to: %i\t%i",p[i * 2], p[i * 2 + 1])); + LOG("Drawing line to: %i\t%i", p[i * 2], p[i * 2 + 1]); } cairo_fill(gtk_print_current_cr); @@ -553,7 +552,7 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation, int page_number; double height_on_page, height_to_print; - LOG(("Begin print")); + LOG("Begin print"); settings = user_data; @@ -572,9 +571,7 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation, } else { - LOG(("page_width: %f ;page_height: %f; content height: %lf", - settings->page_width, settings->page_height, - height_to_print)); + LOG("page_width: %f ;page_height: %f; content height: %lf", settings->page_width, settings->page_height, height_to_print); height_on_page = settings->page_height; height_on_page = height_on_page - @@ -598,7 +595,7 @@ void gtk_print_signal_begin_print (GtkPrintOperation *operation, void gtk_print_signal_draw_page(GtkPrintOperation *operation, GtkPrintContext *context, gint page_nr, gpointer user_data) { - LOG(("Draw Page")); + LOG("Draw Page"); gtk_print_current_cr = gtk_print_context_get_cairo_context(context); print_draw_next_page(>k_printer, settings); } @@ -610,7 +607,7 @@ void gtk_print_signal_draw_page(GtkPrintOperation *operation, void gtk_print_signal_end_print(GtkPrintOperation *operation, GtkPrintContext *context, gpointer user_data) { - LOG(("End print")); + LOG("End print"); print_cleanup(content_to_print, >k_printer, user_data); } -- cgit v1.2.3