From c105738fa36bb2400adc47399c5b878d252d1c86 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 28 May 2015 16:08:46 +0100 Subject: 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. --- riscos/url_protocol.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'riscos/url_protocol.c') diff --git a/riscos/url_protocol.c b/riscos/url_protocol.c index 6c5bdac9a..9fa888269 100644 --- a/riscos/url_protocol.c +++ b/riscos/url_protocol.c @@ -74,17 +74,17 @@ void ro_url_message_received(wimp_message *message) } else { if (!url_message->indirect.url.offset) { - LOG(("no URL in message")); + LOG("no URL in message"); return; } if (28 < message->size && url_message->indirect.body_file.offset) { - LOG(("POST for URL message not implemented")); + LOG("POST for URL message not implemented"); return; } if (url_message->indirect.url.offset < 28 || 236 <= url_message->indirect.url.offset) { - LOG(("external pointers in URL message unimplemented")); + LOG("external pointers in URL message unimplemented"); /* these messages have never been seen in the wild, * and there is the problem of invalid addresses which * would cause an abort */ @@ -121,8 +121,7 @@ void ro_url_message_received(wimp_message *message) error = xwimp_send_message(wimp_USER_MESSAGE_ACKNOWLEDGE, message, message->sender); if (error) { - LOG(("xwimp_send_message: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); warn_user("WimpError", error->errmess); } @@ -165,8 +164,7 @@ void ro_url_broadcast(const char *url) error = xwimp_send_message(wimp_USER_MESSAGE_RECORDED, (wimp_message *) &message, 0); if (error) { - LOG(("xwimp_send_message: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimp_send_message: 0x%x: %s", error->errnum, error->errmess); warn_user("WimpError", error->errmess); } } @@ -185,7 +183,7 @@ void ro_url_load(const char *url) colon = strchr(url, ':'); if (!colon) { - LOG(("invalid url '%s'", url)); + LOG("invalid url '%s'", url); return; } @@ -205,8 +203,7 @@ void ro_url_load(const char *url) error = xwimp_start_task(command, 0); if (error) { - LOG(("xwimp_start_task: 0x%x: %s", - error->errnum, error->errmess)); + LOG("xwimp_start_task: 0x%x: %s", error->errnum, error->errmess); warn_user("WimpError", error->errmess); } -- cgit v1.2.3