summaryrefslogtreecommitdiff
path: root/riscos/menus.c
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/menus.c
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/menus.c')
-rw-r--r--riscos/menus.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/riscos/menus.c b/riscos/menus.c
index a7926ff70..b803f8cf8 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -238,8 +238,7 @@ void ro_gui_menu_create(wimp_menu *menu, int x, int y, wimp_w w)
current_menu_open = true;
error = xwimp_create_menu(menu, x - 64, y);
if (error) {
- LOG(("xwimp_create_menu: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
ro_gui_menu_closed();
}
@@ -265,16 +264,14 @@ void ro_gui_popup_menu(wimp_menu *menu, wimp_w w, wimp_i i)
icon_state.i = i;
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("MenuError", error->errmess);
return;
}
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);
warn_user("MenuError", error->errmess);
return;
}
@@ -300,8 +297,7 @@ void ro_gui_menu_destroy(void)
error = xwimp_create_menu(wimp_CLOSE_MENU, 0, 0);
if (error) {
- LOG(("xwimp_create_menu: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
}
@@ -364,8 +360,7 @@ void ro_gui_menu_selection(wimp_selection *selection)
/* re-open the menu for Adjust clicks */
error = xwimp_get_pointer_info(&pointer);
if (error) {
- LOG(("xwimp_get_pointer_info: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_pointer_info: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
ro_gui_menu_closed();
return;
@@ -431,8 +426,7 @@ void ro_gui_menu_warning(wimp_message_menu_warning *warning)
error = xwimp_create_sub_menu(menu_entry->sub_menu,
warning->pos.x, warning->pos.y);
if (error) {
- LOG(("xwimp_create_sub_menu: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_sub_menu: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
}
}
@@ -497,8 +491,7 @@ void ro_gui_menu_refresh(wimp_menu *menu)
os_error *error;
error = xwimp_create_menu(current_menu, 0, 0);
if (error) {
- LOG(("xwimp_create_menu: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_menu: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
}
}
@@ -864,8 +857,7 @@ int ro_gui_menu_get_checksum(void)
error = xwimp_get_menu_state((wimp_menu_state_flags)0,
&menu_tree, 0, 0);
if (error) {
- LOG(("xwimp_get_menu_state: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_get_menu_state: 0x%x: %s", error->errnum, error->errmess);
warn_user("MenuError", error->errmess);
return 0;
}
@@ -908,8 +900,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
/* read current alphabet */
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;
}
@@ -924,7 +915,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
0, &translated);
if (err != NSERROR_OK) {
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_enc failed"));
+ LOG("utf8_to_enc failed");
return false;
}
@@ -941,7 +932,7 @@ bool ro_gui_menu_translate(struct menu_definition *menu)
0, &translated);
if (err != NSERROR_OK) {
assert(err != NSERROR_BAD_ENCODING);
- LOG(("utf8_to_enc failed"));
+ LOG("utf8_to_enc failed");
return false;
}