diff --git a/src/symbolizer_keys.cpp b/src/symbolizer_keys.cpp index a2d343edb..f6615c3e9 100644 --- a/src/symbolizer_keys.cpp +++ b/src/symbolizer_keys.cpp @@ -29,8 +29,10 @@ namespace mapnik { +static constexpr std::uint8_t const_max_key = static_cast(keys::MAX_SYMBOLIZER_KEY); + // tuple -> name, default value, enumeration to string converter lambda, target property type -static const property_meta_type key_meta[to_integral(keys::MAX_SYMBOLIZER_KEY)] = +static const property_meta_type key_meta[const_max_key] = { property_meta_type{ "gamma", 1.0, nullptr, property_types::target_double}, property_meta_type{ "gamma-method", static_cast(GAMMA_POWER), nullptr, property_types::target_gamma_method}, @@ -127,7 +129,7 @@ mapnik::keys get_key(std::string const& name) { std::string name_copy(name); boost::algorithm::replace_all(name_copy,"_","-"); - for (unsigned i=0; i< to_integral(keys::MAX_SYMBOLIZER_KEY) ; ++i) + for (unsigned i=0; i< const_max_key ; ++i) { property_meta_type const& item = key_meta[i]; if (name_copy == std::get<0>(item)) @@ -139,4 +141,4 @@ mapnik::keys get_key(std::string const& name) return static_cast(0); } -} +} \ No newline at end of file