X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdaemon%2Futils_complain.h;h=46d3a1987555bd64fe1f10fa7da5c7c907766d8b;hp=390f961626c969b61d7887a03e510ffe3aebaa73;hb=1159cb5d383c55a80a0db100b8f7aadcf44740a5;hpb=2c7b491427fd84c9e24c9d41686a15ce42219a0b diff --git a/src/daemon/utils_complain.h b/src/daemon/utils_complain.h index 390f9616..46d3a198 100644 --- a/src/daemon/utils_complain.h +++ b/src/daemon/utils_complain.h @@ -31,24 +31,25 @@ #include "utils_time.h" -typedef struct -{ - /* time of the last report */ - cdtime_t last; +typedef struct { + /* time of the last report */ + cdtime_t last; - /* How long to wait until reporting again. - * 0 indicates that the complaint is no longer valid. */ - cdtime_t interval; + /* How long to wait until reporting again. + * 0 indicates that the complaint is no longer valid. */ + cdtime_t interval; - _Bool complained_once; + _Bool complained_once; } c_complain_t; -#define C_COMPLAIN_INIT_STATIC { 0, 0, 0 } -#define C_COMPLAIN_INIT(c) do { \ - (c)->last = 0; \ - (c)->interval = 0; \ - (c)->complained_once = 0; \ -} while (0) +#define C_COMPLAIN_INIT_STATIC \ + { 0, 0, 0 } +#define C_COMPLAIN_INIT(c) \ + do { \ + (c)->last = 0; \ + (c)->interval = 0; \ + (c)->complained_once = 0; \ + } while (0) /* * NAME @@ -66,7 +67,8 @@ typedef struct * `c' Identifier for the complaint. * `format' Message format - see the documentation of printf(3). */ -void c_complain (int level, c_complain_t *c, const char *format, ...); +__attribute__((format(printf, 3, 4))) void +c_complain(int level, c_complain_t *c, const char *format, ...); /* * NAME @@ -80,7 +82,8 @@ void c_complain (int level, c_complain_t *c, const char *format, ...); * * See `c_complain' for further details and a description of the parameters. */ -void c_complain_once (int level, c_complain_t *c, const char *format, ...); +__attribute__((format(printf, 3, 4))) void +c_complain_once(int level, c_complain_t *c, const char *format, ...); /* * NAME @@ -101,14 +104,12 @@ void c_complain_once (int level, c_complain_t *c, const char *format, ...); * * See `c_complain' for a description of the parameters. */ -void c_do_release (int level, c_complain_t *c, const char *format, ...); -#define c_release(level, c, ...) \ - do { \ - if (c_would_release (c)) \ - c_do_release(level, c, __VA_ARGS__); \ - } while (0) +__attribute__((format(printf, 3, 4))) void +c_do_release(int level, c_complain_t *c, const char *format, ...); +#define c_release(level, c, ...) \ + do { \ + if (c_would_release(c)) \ + c_do_release(level, c, __VA_ARGS__); \ + } while (0) #endif /* UTILS_COMPLAIN_H */ - -/* vim: set sw=4 ts=4 tw=78 noexpandtab : */ -