Commit 5f4252bc authored by Max Kellermann's avatar Max Kellermann

ConfigTemplates: use ARRAY_SIZE()

parent a588aef9
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "ConfigTemplates.hxx" #include "ConfigTemplates.hxx"
#include "ConfigOption.hxx" #include "ConfigOption.hxx"
#include "util/Macros.hxx"
#include <string.h> #include <string.h>
...@@ -81,8 +82,7 @@ const ConfigTemplate config_templates[] = { ...@@ -81,8 +82,7 @@ const ConfigTemplate config_templates[] = {
{ "neighbors", true, true }, { "neighbors", true, true },
}; };
static constexpr unsigned n_config_templates = static constexpr unsigned n_config_templates = ARRAY_SIZE(config_templates);
sizeof(config_templates) / sizeof(config_templates[0]);
static_assert(n_config_templates == unsigned(CONF_MAX), static_assert(n_config_templates == unsigned(CONF_MAX),
"Wrong number of config_templates"); "Wrong number of config_templates");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment