diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-05-28 16:08:46 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-05-28 16:08:46 +0100 |
commit | c105738fa36bb2400adc47399c5b878d252d1c86 (patch) | |
tree | 138eeb449e1bf51ee1726b5f820740aada0ccd0b /riscos/configure.c | |
parent | 20f2c86a511f7913cf858e7bd3668b0b59663ba0 (diff) | |
download | netsurf-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 'riscos/configure.c')
-rw-r--r-- | riscos/configure.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/riscos/configure.c b/riscos/configure.c index 68aa3c0c6..62937b543 100644 --- a/riscos/configure.c +++ b/riscos/configure.c @@ -212,8 +212,7 @@ void ro_gui_configure_open_window(wimp_open *open) y + configure_icon_height - CONFIGURE_ICON_PADDING_V); if (error) { - LOG(("xwimp_resize_icon: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); } x += configure_icon_width; l++; @@ -226,8 +225,7 @@ void ro_gui_configure_open_window(wimp_open *open) error = xwimp_force_redraw(configure_window, 0, -16384, 16384, 0); if (error) { - LOG(("xwimp_force_redraw: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimp_force_redraw: 0x%x: %s", error->errnum, error->errmess); warn_user("WimpError", error->errmess); } } @@ -250,8 +248,7 @@ void ro_gui_configure_open_window(wimp_open *open) extent.y0 = -max_height; error = xwimp_set_extent(open->w, &extent); if (error) { - LOG(("xwimp_set_extent: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimp_set_extent: 0x%x: %s", error->errnum, error->errmess); warn_user("WimpError", error->errmess); return; } @@ -262,8 +259,7 @@ void ro_gui_configure_open_window(wimp_open *open) /* open the window */ error = xwimp_open_window(open); if (error) { - LOG(("xwimp_open_window: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimp_open_window: 0x%x: %s", error->errnum, error->errmess); warn_user("WimpError", error->errmess); return; } @@ -280,7 +276,7 @@ void ro_gui_configure_register(const char *window, /* create our tool */ tool = calloc(sizeof(struct configure_tool), 1); if (!tool) { - LOG(("Insufficient memory for calloc()")); + LOG("Insufficient memory for calloc()"); die("Insufficient memory"); return; /* For the benefit of scan-build */ } @@ -288,7 +284,7 @@ void ro_gui_configure_register(const char *window, tool->translated[0] = '\0'; tool->validation = malloc(strlen(window) + 2); if (!tool->validation) { - LOG(("Insufficient memory for malloc()")); + LOG("Insufficient memory for malloc()"); die("Insufficient memory"); } sprintf(tool->validation, "S%s", window); @@ -315,8 +311,7 @@ void ro_gui_configure_register(const char *window, CONFIGURE_TOOL_TRANSLATED_SIZE; error = xwimp_create_icon(&new_icon, &tool->i); if (error) { - LOG(("xwimp_create_icon: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess); die(error->errmess); } @@ -365,8 +360,7 @@ bool ro_gui_configure_translate(void) error = xosbyte1(osbyte_ALPHABET_NUMBER, 127, 0, &alphabet); if (error) { - LOG(("failed reading alphabet: 0x%x: %s", - error->errnum, error->errmess)); + LOG("failed reading alphabet: 0x%x: %s", error->errnum, error->errmess); /* assume Latin1 */ alphabet = territory_ALPHABET_LATIN1; } @@ -387,8 +381,7 @@ bool ro_gui_configure_translate(void) error = xwimptextop_string_width(tool->translated, strlen(tool->translated), &icon_width); if (error) { - LOG(("xwimptextop_string_width: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimptextop_string_width: 0x%x: %s", error->errnum, error->errmess); return false; } icon_width += CONFIGURE_ICON_PADDING_H; @@ -402,8 +395,7 @@ bool ro_gui_configure_translate(void) configure_icon_width, 0); if (error) { - LOG(("xwimp_resize_icon: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess); } } |