summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 424adfd)
raw | patch | inline | side by side (parent: 424adfd)
author | Florian Forster <octo@noris.net> | |
Mon, 29 Sep 2008 12:56:43 +0000 (14:56 +0200) | ||
committer | Florian Forster <octo@noris.net> | |
Mon, 29 Sep 2008 12:56:43 +0000 (14:56 +0200) |
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>
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>
src/plugin.c | patch | blob | history | |
src/postgresql.c | patch | blob | history | |
src/utils_complain.h | patch | blob | history |
diff --git a/src/plugin.c b/src/plugin.c
index 2b5a34da22138324e1df1ee40d5cd4ef9c016931..bef715ee7595a1fa863400c7603f2bf1b8f4cd69 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
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;
diff --git a/src/postgresql.c b/src/postgresql.c
index 9438c576039a64547bfd787430b02e3b1ad09431..43f5af563af18e04d7a5478030565aa26055e93d 100644 (file)
--- a/src/postgresql.c
+++ b/src/postgresql.c
db->conn = NULL;
- db->conn_complaint.last = 0;
- db->conn_complaint.interval = 0;
+ C_COMPLAIN_INIT (&db->conn_complaint);
db->proto_version = 0;
diff --git a/src/utils_complain.h b/src/utils_complain.h
index e93d823e2ae8a52cb30cb15ff4be67c57308a184..b51a81c677a10d8777ca2d22b2ff7503093e0704 100644 (file)
--- a/src/utils_complain.h
+++ b/src/utils_complain.h
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