summaryrefslogtreecommitdiff
path: root/riscos/configure
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
committerVincent Sanders <vince@kyllikki.org>2015-05-28 16:08:46 +0100
commitc105738fa36bb2400adc47399c5b878d252d1c86 (patch)
tree138eeb449e1bf51ee1726b5f820740aada0ccd0b /riscos/configure
parent20f2c86a511f7913cf858e7bd3668b0b59663ba0 (diff)
downloadnetsurf-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')
-rw-r--r--riscos/configure/con_language.c4
-rw-r--r--riscos/configure/con_theme.c22
2 files changed, 10 insertions, 16 deletions
diff --git a/riscos/configure/con_language.c b/riscos/configure/con_language.c
index ace7a6fdf..48c20fc46 100644
--- a/riscos/configure/con_language.c
+++ b/riscos/configure/con_language.c
@@ -99,7 +99,7 @@ bool ro_gui_options_language_ok(wimp_w w)
if (temp) {
nsoption_set_charp(language, temp);
} else {
- LOG(("No memory to duplicate language code"));
+ LOG("No memory to duplicate language code");
warn_user("NoMemory", 0);
}
}
@@ -114,7 +114,7 @@ bool ro_gui_options_language_ok(wimp_w w)
if (temp) {
nsoption_set_charp(accept_language,temp);
} else {
- LOG(("No memory to duplicate language code"));
+ LOG("No memory to duplicate language code");
warn_user("NoMemory", 0);
}
}
diff --git a/riscos/configure/con_theme.c b/riscos/configure/con_theme.c
index 13ba3165c..bee2231cd 100644
--- a/riscos/configure/con_theme.c
+++ b/riscos/configure/con_theme.c
@@ -102,23 +102,20 @@ bool ro_gui_options_theme_initialise(wimp_w w)
return false;
error = xwimp_create_window(&theme_pane_definition, &theme_pane);
if (error) {
- LOG(("xwimp_create_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_window: 0x%x: %s", error->errnum, error->errmess);
return false;
}
state.w = w;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
return false;
}
icon_state.w = w;
icon_state.i = THEME_PANE_AREA;
error = xwimp_get_icon_state(&icon_state);
if (error) {
- LOG(("xwimp_get_icon_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_icon_state: 0x%x: %s", error->errnum, error->errmess);
return false;
}
state.w = theme_pane;
@@ -127,7 +124,7 @@ bool ro_gui_options_theme_initialise(wimp_w w)
state.visible.x0 += icon_state.icon.extent.x0 + 16;
state.visible.y0 = state.visible.y1 + icon_state.icon.extent.y0 + 16;
state.visible.y1 += icon_state.icon.extent.y1 - 28;
- LOG(("Y0 = %i, y1 = %i", icon_state.icon.extent.y0, icon_state.icon.extent.y1));
+ LOG("Y0 = %i, y1 = %i", icon_state.icon.extent.y0, icon_state.icon.extent.y1);
error = xwimp_open_window_nested(PTR_WIMP_OPEN(&state), w,
wimp_CHILD_LINKS_PARENT_VISIBLE_BOTTOM_OR_LEFT
<< wimp_CHILD_XORIGIN_SHIFT |
@@ -142,8 +139,7 @@ bool ro_gui_options_theme_initialise(wimp_w w)
wimp_CHILD_LINKS_PARENT_VISIBLE_TOP_OR_RIGHT
<< wimp_CHILD_TS_EDGE_SHIFT);
if (error) {
- LOG(("xwimp_open_window_nested: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_open_window_nested: 0x%x: %s", error->errnum, error->errmess);
return false;
}
@@ -178,8 +174,7 @@ void ro_gui_options_theme_finalise(wimp_w w)
ro_gui_wimp_event_finalise(theme_pane);
error = xwimp_delete_window(theme_pane);
if (error) {
- LOG(("xwimp_delete_window: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_window: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
}
theme_pane = 0;
@@ -272,7 +267,7 @@ void ro_gui_options_theme_load(void)
ro_toolbar_rebuild(toolbar);
toolbar_display = calloc(sizeof(struct toolbar_display), 1);
if (!toolbar_display) {
- LOG(("No memory for calloc()"));
+ LOG("No memory for calloc()");
warn_user("NoMemory", 0);
return;
}
@@ -294,8 +289,7 @@ void ro_gui_options_theme_load(void)
state.w = theme_pane;
error = xwimp_get_window_state(&state);
if (error) {
- LOG(("xwimp_get_window_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_window_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return;
}