summaryrefslogtreecommitdiff
path: root/riscos/gui/button_bar.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/gui/button_bar.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/gui/button_bar.c')
-rw-r--r--riscos/gui/button_bar.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/riscos/gui/button_bar.c b/riscos/gui/button_bar.c
index d92433d0b..e04bfc270 100644
--- a/riscos/gui/button_bar.c
+++ b/riscos/gui/button_bar.c
@@ -139,7 +139,7 @@ struct button_bar *ro_gui_button_bar_create(struct theme_descriptor *theme,
button_bar = malloc(sizeof(struct button_bar));
if (button_bar == NULL) {
- LOG(("No memory for malloc()"));
+ LOG("No memory for malloc()");
return NULL;
}
@@ -539,8 +539,7 @@ bool ro_gui_button_bar_icon_update(struct button_bar *button_bar)
error = xwimp_create_icon(&icon, &button->icon);
if (error) {
- LOG(("xwimp_create_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_create_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
button->icon = -1;
return false;
@@ -550,8 +549,7 @@ bool ro_gui_button_bar_icon_update(struct button_bar *button_bar)
error = xwimp_delete_icon(button_bar->window,
button->icon);
if (error != NULL) {
- LOG(("xwimp_delete_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_delete_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
return false;
}
@@ -601,8 +599,7 @@ bool ro_gui_button_bar_icon_resize(struct button_bar *button_bar)
button->y_pos +
button->y_size);
if (error != NULL) {
- LOG(("xwimp_resize_icon: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xwimp_resize_icon: 0x%x: %s", error->errnum, error->errmess);
warn_user("WimpError", error->errmess);
button->icon = -1;
return false;
@@ -773,8 +770,7 @@ bool ro_gui_button_bar_click(struct button_bar *button_bar,
button_bar->sprites,
sprite, &box, NULL);
if (error)
- LOG(("xdragasprite_start: 0x%x: %s",
- error->errnum, error->errmess));
+ LOG("xdragasprite_start: 0x%x: %s", error->errnum, error->errmess);
ro_mouse_drag_start(ro_gui_button_bar_drag_end,
NULL, NULL, NULL);
@@ -875,8 +871,7 @@ void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data)
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);
return;
}
@@ -886,8 +881,7 @@ void ro_gui_button_bar_drag_end(wimp_dragged *drag, void *data)
state.w = drag_start->window;
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;
}
@@ -1075,7 +1069,7 @@ char *ro_gui_button_bar_get_config(struct button_bar *button_bar)
config = malloc(size);
if (config == NULL) {
- LOG(("No memory for malloc()"));
+ LOG("No memory for malloc()");
warn_user("NoMemory", 0);
return NULL;
}