From 1633a3ea44885c3d09f2b43f26956adee2fbb4a4 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 14 Dec 2012 11:40:41 +0100 Subject: [PATCH] Remove the redundant and little used STATIC_ARRAY_LEN() macro. --- src/collectd.h | 2 -- src/configfile.c | 4 ++-- src/snmp.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/collectd.h b/src/collectd.h index c0994d19..7cb405c0 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -262,8 +262,6 @@ typedef int _Bool; # 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 064c9a40..b16ae476 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -98,7 +98,7 @@ static cf_value_map_t cf_value_map[] = {"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[] = { @@ -112,7 +112,7 @@ 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 c4d043b9..16fd48aa 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -108,7 +108,7 @@ static int csnmp_read_host (user_data_t *ud); */ 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; } -- 2.30.2