ConfigTemplates: use ARRAY_SIZE()

This commit is contained in:
Max Kellermann 2014-12-09 22:04:34 +01:00
parent a588aef921
commit 5f4252bcd2

View File

@ -19,6 +19,7 @@
#include "ConfigTemplates.hxx"
#include "ConfigOption.hxx"
#include "util/Macros.hxx"
#include <string.h>
@ -81,8 +82,7 @@ const ConfigTemplate config_templates[] = {
{ "neighbors", true, true },
};
static constexpr unsigned n_config_templates =
sizeof(config_templates) / sizeof(config_templates[0]);
static constexpr unsigned n_config_templates = ARRAY_SIZE(config_templates);
static_assert(n_config_templates == unsigned(CONF_MAX),
"Wrong number of config_templates");