Because it can only be used when initializing during declaration. A macro
for initializing a struct by pointer as been added with the previous name,
i. e. `C_COMPLAIN_INIT(c)'.
Signed-off-by: Florian Forster <octo@noris.net>
int plugin_dispatch_values (value_list_t *vl)
{
- static c_complain_t no_write_complaint = C_COMPLAIN_INIT;
+ static c_complain_t no_write_complaint = C_COMPLAIN_INIT_STATIC;
int (*callback) (const data_set_t *, const value_list_t *);
data_set_t *ds;
db->conn = NULL;
- db->conn_complaint.last = 0;
- db->conn_complaint.interval = 0;
+ C_COMPLAIN_INIT (&db->conn_complaint);
db->proto_version = 0;
int interval;
} c_complain_t;
-#define C_COMPLAIN_INIT { 0, 0 }
+#define C_COMPLAIN_INIT_STATIC { 0, 0 }
+#define C_COMPLAIN_INIT(c) do { (c)->last = 0; (c)->interval = 0; } while (0)
/*
* NAME