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/queryswdb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/queryswdb.c') diff --git a/src/queryswdb.c b/src/queryswdb.c index 537de39d..e72dabbc 100644 --- a/src/queryswdb.c +++ b/src/queryswdb.c @@ -58,18 +58,18 @@ gpgme_op_query_swdb_result (gpgme_ctx_t ctx) op_data_t opd; gpgme_error_t err; - TRACE_BEG (DEBUG_CTX, "gpgme_op_query_swdb_result", ctx); + TRACE_BEG (DEBUG_CTX, "gpgme_op_query_swdb_result", ctx, ""); err = _gpgme_op_data_lookup (ctx, OPDATA_QUERY_SWDB, &hook, -1, NULL); opd = hook; if (err || !opd) { - TRACE_SUC0 ("result=(null)"); + TRACE_SUC ("result=(null)"); return NULL; } - TRACE_SUC1 ("result=%p", &opd->result); + TRACE_SUC ("result=%p", &opd->result); return &opd->result; } @@ -91,8 +91,8 @@ gpgme_op_query_swdb (gpgme_ctx_t ctx, const char *name, const char *iversion, void *hook; op_data_t opd; - TRACE_BEG2 (DEBUG_CTX, "gpgme_op_query_swdb", ctx, - "name=%s, iversion=%a", name, iversion); + TRACE_BEG (DEBUG_CTX, "gpgme_op_query_swdb", ctx, + "name=%s, iversion=%", name, iversion); if (!ctx || reserved) return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); -- cgit v1.2.3