From cb8ffccbb84105388df859d70165640f189fb205 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sun, 1 Feb 2009 17:36:25 +0100 Subject: [PATCH 1/1] utils_complain: Added macro c_would_release(). This macro returns true if the specified complaint would be released, false else. This is useful e.g. to do further actions when releasing a complaint. --- src/utils_complain.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/utils_complain.h b/src/utils_complain.h index b51a81c6..09c43750 100644 --- a/src/utils_complain.h +++ b/src/utils_complain.h @@ -76,6 +76,15 @@ void c_complain_once (int level, c_complain_t *c, const char *format, ...); /* * NAME + * c_would_release + * + * DESCRIPTION + * Returns true if the specified complaint would be released, false else. + */ +#define c_would_release(c) ((c)->interval != 0) + +/* + * NAME * c_release * * DESCRIPTION @@ -87,7 +96,7 @@ void c_complain_once (int level, c_complain_t *c, const char *format, ...); void c_do_release (int level, c_complain_t *c, const char *format, ...); #define c_release(level, c, ...) \ do { \ - if ((c)->interval != 0) \ + if (c_would_release (c)) \ c_do_release(level, c, __VA_ARGS__); \ } while (0) -- 2.11.0