From: Daiki Ueno Date: Tue, 16 Oct 2018 16:05:10 +0000 (+0200) Subject: debug: Work around cppcheck false-positives X-Git-Tag: 0.23.15~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a8db182af533a43b4d478d28af8623035475d68;p=p11-kit debug: Work around cppcheck false-positives https://trac.cppcheck.net/ticket/8794 --- diff --git a/common/debug.h b/common/debug.h index 255c62c..7ea36f3 100644 --- a/common/debug.h +++ b/common/debug.h @@ -71,13 +71,13 @@ void p11_debug_precond (const char *format, #endif #define return_val_if_fail(x, v) \ - do { if (!(x)) { \ + do { if (x) { } else { \ p11_debug_precond ("p11-kit: '%s' not true at %s\n", #x, __func__); \ return v; \ } } while (false) #define return_if_fail(x) \ - do { if (!(x)) { \ + do { if (x) { } else { \ p11_debug_precond ("p11-kit: '%s' not true at %s\n", #x, __func__); \ return; \ } } while (false) @@ -100,7 +100,7 @@ void p11_debug_precond (const char *format, } while (false) #define warn_if_fail(x) \ - do { if (!(x)) { \ + do { if (x) { } else { \ p11_debug_precond ("p11-kit: '%s' not true at %s\n", #x, __func__); \ } } while (false)