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/decrypt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/decrypt.c') diff --git a/src/decrypt.c b/src/decrypt.c index 77c45627..f8847996 100644 --- a/src/decrypt.c +++ b/src/decrypt.c @@ -102,7 +102,7 @@ gpgme_op_decrypt_result (gpgme_ctx_t ctx) op_data_t opd; gpgme_error_t err; - TRACE_BEG (DEBUG_CTX, "gpgme_op_decrypt_result", ctx); + TRACE_BEG (DEBUG_CTX, "gpgme_op_decrypt_result", ctx, ""); ctx->ignore_mdc_error = 0; /* Always reset this flag. */ @@ -110,7 +110,7 @@ gpgme_op_decrypt_result (gpgme_ctx_t ctx) opd = hook; if (err || !opd) { - TRACE_SUC0 ("result=(null)"); + TRACE_SUC ("result=(null)"); return NULL; } @@ -120,7 +120,7 @@ gpgme_op_decrypt_result (gpgme_ctx_t ctx) opd->result.symkey_algo = strdup ("?.?"); if (!opd->result.symkey_algo) { - TRACE_SUC0 ("result=(null)"); + TRACE_SUC ("result=(null)"); return NULL; } } @@ -131,7 +131,7 @@ gpgme_op_decrypt_result (gpgme_ctx_t ctx) if (opd->result.unsupported_algorithm) { - TRACE_LOG1 ("result: unsupported_algorithm: %s", + TRACE_LOG ("result: unsupported_algorithm: %s", opd->result.unsupported_algorithm); } if (opd->result.wrong_key_usage) @@ -141,18 +141,18 @@ gpgme_op_decrypt_result (gpgme_ctx_t ctx) rcp = opd->result.recipients; while (rcp) { - TRACE_LOG3 ("result: recipient: keyid=%s, pubkey_algo=%i, " + TRACE_LOG ("result: recipient: keyid=%s, pubkey_algo=%i, " "status=%s", rcp->keyid, rcp->pubkey_algo, gpg_strerror (rcp->status)); rcp = rcp->next; } if (opd->result.file_name) { - TRACE_LOG1 ("result: original file name: %s", opd->result.file_name); + TRACE_LOG ("result: original file name: %s", opd->result.file_name); } } - TRACE_SUC1 ("result=%p", &opd->result); + TRACE_SUC ("result=%p", &opd->result); return &opd->result; } @@ -587,7 +587,7 @@ gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher, { gpgme_error_t err; - TRACE_BEG2 (DEBUG_CTX, "gpgme_op_decrypt_start", ctx, + TRACE_BEG (DEBUG_CTX, "gpgme_op_decrypt_start", ctx, "cipher=%p, plain=%p", cipher, plain); if (!ctx) @@ -605,7 +605,7 @@ gpgme_op_decrypt (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain) { gpgme_error_t err; - TRACE_BEG2 (DEBUG_CTX, "gpgme_op_decrypt", ctx, + TRACE_BEG (DEBUG_CTX, "gpgme_op_decrypt", ctx, "cipher=%p, plain=%p", cipher, plain); if (!ctx) -- cgit v1.2.3