fix issue 4 of #2396

This commit is contained in:
Dane Springmeyer 2014-08-26 19:01:45 -07:00
parent 147375e197
commit c1140fb2ea

View File

@ -29,8 +29,10 @@
namespace mapnik {
static constexpr std::uint8_t const_max_key = static_cast<std::uint8_t>(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<value_integer>(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<mapnik::keys>(0);
}
}
}