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/query.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/query.c')
-rw-r--r-- | riscos/query.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/riscos/query.c b/riscos/query.c index aa7492196..178dcaf5b 100644 --- a/riscos/query.c +++ b/riscos/query.c @@ -175,7 +175,7 @@ query_id query_user_xy(const char *query, const char *detail, err = utf8_to_local_encoding(yes, 0, &local_text); if (err != NSERROR_OK) { assert(err != NSERROR_BAD_ENCODING); - LOG(("utf8_to_local_encoding_failed")); + LOG("utf8_to_local_encoding_failed"); local_text = NULL; } @@ -191,8 +191,7 @@ query_id query_user_xy(const char *query, const char *detail, error = xwimptextop_string_width(icn->data.indirected_text.text, len, &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); width = len * 16; } if (!query_yes_width) query_yes_width = icn->extent.x1 - icn->extent.x0; @@ -205,7 +204,7 @@ query_id query_user_xy(const char *query, const char *detail, err = utf8_to_local_encoding(no, 0, &local_text); if (err != NSERROR_OK) { assert(err != NSERROR_BAD_ENCODING); - LOG(("utf8_to_local_encoding_failed")); + LOG("utf8_to_local_encoding_failed"); local_text = NULL; } @@ -223,8 +222,7 @@ query_id query_user_xy(const char *query, const char *detail, icn->extent.x1 = tx - 16; error = xwimptextop_string_width(icn->data.indirected_text.text, len, &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); width = len * 16; } width += 28; @@ -265,8 +263,7 @@ query_id query_user_xy(const char *query, const char *detail, error = xwimp_set_caret_position(qw->window, (wimp_i)-1, 0, 0, 1 << 25, -1); if (error) { - LOG(("xwimp_get_caret_position: 0x%x : %s", - error->errnum, error->errmess)); + LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); warn_user("WimpError", error->errmess); } @@ -310,8 +307,7 @@ void ro_gui_query_window_bring_to_front(query_id id) error = xwimp_set_caret_position(qw->window, (wimp_i)-1, 0, 0, 1 << 25, -1); if (error) { - LOG(("xwimp_get_caret_position: 0x%x : %s", - error->errnum, error->errmess)); + LOG("xwimp_get_caret_position: 0x%x : %s", error->errnum, error->errmess); warn_user("WimpError", error->errmess); } } @@ -331,8 +327,7 @@ void ro_gui_query_close(wimp_w w) ro_gui_dialog_close(w); error = xwimp_delete_window(qw->window); 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); } ro_gui_wimp_event_finalise(w); |