summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb558ee)
raw | patch | inline | side by side (parent: fb558ee)
author | Florian Forster <octo@collectd.org> | |
Fri, 14 Dec 2012 10:40:41 +0000 (11:40 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 14 Dec 2012 10:40:41 +0000 (11:40 +0100) |
src/collectd.h | patch | blob | history | |
src/configfile.c | patch | blob | history | |
src/snmp.c | patch | blob | history |
diff --git a/src/collectd.h b/src/collectd.h
index c0994d19276e501a1170ed2cfde979c112eece79..7cb405c04bd43d25ec6b807f730419cbf39a93bb 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
# define COLLECTD_DEFAULT_INTERVAL 10.0
#endif
-#define STATIC_ARRAY_LEN(array) (sizeof (array) / sizeof ((array)[0]))
-
/* Remove GNU specific __attribute__ settings when using another compiler */
#if !__GNUC__
# define __attribute__(x) /**/
diff --git a/src/configfile.c b/src/configfile.c
index 064c9a4053640200aff1363cc0daee16e3783e60..b16ae476de9e9e79600e96dacf5467e30bab1a71 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
{"PluginDir", dispatch_value_plugindir},
{"LoadPlugin", dispatch_loadplugin}
};
-static int cf_value_map_num = STATIC_ARRAY_LEN (cf_value_map);
+static int cf_value_map_num = STATIC_ARRAY_SIZE (cf_value_map);
static cf_global_option_t cf_global_options[] =
{
{"PreCacheChain", NULL, "PreCache"},
{"PostCacheChain", NULL, "PostCache"}
};
-static int cf_global_options_num = STATIC_ARRAY_LEN (cf_global_options);
+static int cf_global_options_num = STATIC_ARRAY_SIZE (cf_global_options);
static int cf_default_typesdb = 1;
diff --git a/src/snmp.c b/src/snmp.c
index c4d043b9e70283e13136b20fd6e71e0805155aa7..16fd48aaaf5d3df87ace94b0f358df63f15dbc2f 100644 (file)
--- a/src/snmp.c
+++ b/src/snmp.c
*/
static void csnmp_oid_init (oid_t *dst, oid const *src, size_t n)
{
- assert (n <= STATIC_ARRAY_LEN (dst->oid));
+ assert (n <= STATIC_ARRAY_SIZE (dst->oid));
memcpy (dst->oid, src, sizeof (*src) * n);
dst->oid_len = n;
}