summaryrefslogtreecommitdiff
path: root/src/style/style_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/style/style_parser.cpp')
-rw-r--r--src/style/style_parser.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/style/style_parser.cpp b/src/style/style_parser.cpp
index 3aa12a6670..47ff0c30ab 100644
--- a/src/style/style_parser.cpp
+++ b/src/style/style_parser.cpp
@@ -6,6 +6,8 @@
#include <mbgl/platform/log.hpp>
#include <csscolorparser/csscolorparser.hpp>
+#include <algorithm>
+
namespace mbgl {
using JSVal = const rapidjson::Value&;
@@ -108,13 +110,13 @@ template<> bool StyleParser::parseRenderProperty(JSVal value, uint16_t &target,
if (value.HasMember(name)) {
JSVal property = replaceConstant(value[name]);
if (property.IsUint()) {
- unsigned int value = property.GetUint();
- if (value > std::numeric_limits<uint16_t>::max()) {
+ unsigned int int_value = property.GetUint();
+ if (int_value > std::numeric_limits<uint16_t>::max()) {
Log::Warning(Event::ParseStyle, "values for %s that are larger than %d are not supported", name, std::numeric_limits<uint16_t>::max());
return false;
}
- target = value;
+ target = int_value;
return true;
} else {
Log::Warning(Event::ParseStyle, "%s must be an unsigned integer", name);
@@ -554,7 +556,7 @@ void StyleParser::parseStyles(JSVal value, std::map<ClassID, ClassProperties> &s
if (name == "style") {
parseStyle(replaceConstant(itr->value), styles[ClassID::Default]);
} else if (name.compare(0, 6, "style.") == 0 && name.length() > 6) {
- const ClassID class_id = ClassDictionary::Lookup(name.substr(6));
+ const ClassID class_id = ClassDictionary::Get().lookup(name.substr(6));
parseStyle(replaceConstant(itr->value), styles[class_id]);
}
}
@@ -763,11 +765,11 @@ FilterExpression StyleParser::parseFilter(JSVal value, FilterExpression::Operato
FilterComparison comparison(name);
JSVal filterValue = replaceConstant(itr->value);
if (filterValue.IsObject()) {
- rapidjson::Value::ConstMemberIterator itr = filterValue.MemberBegin();
- for (; itr != filterValue.MemberEnd(); ++itr) {
+ rapidjson::Value::ConstMemberIterator filter_itr = filterValue.MemberBegin();
+ for (; filter_itr != filterValue.MemberEnd(); ++filter_itr) {
comparison.add(
- parseFilterComparisonOperator({ itr->name.GetString(), itr->name.GetStringLength() }),
- parseValues(replaceConstant(itr->value))
+ parseFilterComparisonOperator({ filter_itr->name.GetString(), filter_itr->name.GetStringLength() }),
+ parseValues(replaceConstant(filter_itr->value))
);
}
} else if (filterValue.IsArray()) {