summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3c55d01)
raw | patch | inline | side by side (parent: 3c55d01)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 6 Oct 2015 20:17:29 +0000 (22:17 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Tue, 6 Oct 2015 20:17:29 +0000 (22:17 +0200) |
Older versions of GCC/CLANG don't handle "missing" field initializers well.
src/core/plugin.c | patch | blob | history | |
src/include/core/store.h | patch | blob | history |
diff --git a/src/core/plugin.c b/src/core/plugin.c
index 3611be4966b51d296557620e9ed77abda9d7ce48..728e20c1740815d83b2d1366ac852b20ec19c140 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
int
sdb_plugin_store_host(const char *name, sdb_time_t last_update)
{
- sdb_store_host_t host = { 0 };
+ sdb_store_host_t host = SDB_STORE_HOST_INIT;
char *backends[1];
char *cname;
sdb_plugin_store_service(const char *hostname, const char *name,
sdb_time_t last_update)
{
- sdb_store_service_t service = { 0 };
+ sdb_store_service_t service = SDB_STORE_SERVICE_INIT;
char *backends[1];
char *cname;
sdb_plugin_store_metric(const char *hostname, const char *name,
sdb_metric_store_t *store, sdb_time_t last_update)
{
- sdb_store_metric_t metric = { 0 };
+ sdb_store_metric_t metric = SDB_STORE_METRIC_INIT;
char *backends[1];
char *cname;
sdb_plugin_store_attribute(const char *hostname, const char *key,
const sdb_data_t *value, sdb_time_t last_update)
{
- sdb_store_attribute_t attr = { 0 };
+ sdb_store_attribute_t attr = SDB_STORE_ATTRIBUTE_INIT;
char *backends[1];
char *cname;
sdb_plugin_store_service_attribute(const char *hostname, const char *service,
const char *key, const sdb_data_t *value, sdb_time_t last_update)
{
- sdb_store_attribute_t attr = { 0 };
+ sdb_store_attribute_t attr = SDB_STORE_ATTRIBUTE_INIT;
char *backends[1];
char *cname;
sdb_plugin_store_metric_attribute(const char *hostname, const char *metric,
const char *key, const sdb_data_t *value, sdb_time_t last_update)
{
- sdb_store_attribute_t attr = { 0 };
+ sdb_store_attribute_t attr = SDB_STORE_ATTRIBUTE_INIT;
char *backends[1];
char *cname;
index 0cee91362998d55c4f329c031572d5096e68400c..4038fe4da91c0fc0c70a68b4ba833e3cba67da5c 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
const char * const *backends;
size_t backends_num;
} sdb_store_host_t;
+#define SDB_STORE_HOST_INIT { NULL, 0, 0, NULL, 0 }
/*
* sdb_store_service_t represents the meta-data of a stored service object.
const char * const *backends;
size_t backends_num;
} sdb_store_service_t;
+#define SDB_STORE_SERVICE_INIT { NULL, NULL, 0, 0, NULL, 0 }
/*
* sdb_metric_store_t specifies how to access a metric's data.
const char * const *backends;
size_t backends_num;
} sdb_store_metric_t;
+#define SDB_STORE_METRIC_INIT { NULL, NULL, { NULL, NULL }, 0, 0, NULL, 0 }
/*
* sdb_store_attribute_t represents a stored attribute.
const char * const *backends;
size_t backends_num;
} sdb_store_attribute_t;
+#define SDB_STORE_ATTRIBUTE_INIT { NULL, 0, NULL, NULL, SDB_DATA_INIT, 0, 0, NULL, 0 }
/*
* Expressions represent arithmetic expressions based on stored objects and