From 5857491a2aa7d4975100d90f1ad62c08aa345e3e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 16 Nov 2018 16:25:49 +0100 Subject: core: Simplify the trace maros by using variadics. * src/debug.h (TRACE_BEG, TRACE_LOG, TRACE_SUC): Use variadic macros and remove the TRACE_BEG1 et al. Change all users to always pass a format string. (TRACE): Ditto. * src/debug.c (_gpgme_debugf): New. * configure.ac : Add -Wno-format-zero-length. -- This makes it easier for use to enable format checks. The zero-length format is required to allow for an empty format due to the comman problematic of __VA_ARGS__. Signed-off-by: Werner Koch --- src/wait.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/wait.c') diff --git a/src/wait.c b/src/wait.c index a011b123..1da9e93d 100644 --- a/src/wait.c +++ b/src/wait.c @@ -136,7 +136,7 @@ _gpgme_add_io_cb (void *data, int fd, int dir, gpgme_io_cb_t fnc, return err; } - TRACE3 (DEBUG_CTX, "_gpgme_add_io_cb", ctx, + TRACE (DEBUG_CTX, "_gpgme_add_io_cb", ctx, "fd %d, dir=%d -> tag=%p", fd, dir, tag); *r_tag = tag; @@ -159,7 +159,7 @@ _gpgme_remove_io_cb (void *data) assert (fdt); idx = tag->idx; - TRACE2 (DEBUG_CTX, "_gpgme_remove_io_cb", data, + TRACE (DEBUG_CTX, "_gpgme_remove_io_cb", data, "setting fd 0x%x (item=%p) done", fdt->fds[idx].fd, fdt->fds[idx].opaque); @@ -196,7 +196,7 @@ _gpgme_run_io_cb (struct io_select_fd_s *an_fds, int checked, int nr; struct io_select_fd_s fds; - TRACE0 (DEBUG_CTX, "_gpgme_run_io_cb", item, "need to check"); + TRACE (DEBUG_CTX, "_gpgme_run_io_cb", item, "need to check"); fds = *an_fds; fds.signaled = 0; /* Just give it a quick poll. */ @@ -210,7 +210,7 @@ _gpgme_run_io_cb (struct io_select_fd_s *an_fds, int checked, return 0; } - TRACE2 (DEBUG_CTX, "_gpgme_run_io_cb", item, "handler (%p, %d)", + TRACE (DEBUG_CTX, "_gpgme_run_io_cb", item, "handler (%p, %d)", item->handler_value, an_fds->fd); iocb_data.handler_value = item->handler_value; -- cgit v1.2.3