Permalink
Browse files

fix compile with latest clang++ and latest mapnik

  • Loading branch information...
Dane Springmeyer
Dane Springmeyer committed Oct 14, 2012
1 parent 3668369 commit 86e9170db436b0b4f7bb0c650f60a32f469a1175
Showing with 16 additions and 4 deletions.
  1. +5 −1 src/expression_eval.cpp
  2. +4 −0 src/generate_filter.cpp
  3. +7 −3 src/mss_parser.cpp
View
@@ -78,6 +78,10 @@ utree expression::eval_function(utree const& node)
iter it = node.begin(),
end = node.end();
+ if (it == end)
+ {
+ throw carto_error("Empty function in node ", get_location(node));
+ }
std::string func_name = as<std::string>(*it);
++it;
@@ -142,7 +146,7 @@ utree expression::eval_function(utree const& node)
utree expression::fix_color_range(utree const& node)
{
- BOOST_ASSERT(is_color(node) == TRUE);
+ BOOST_ASSERT(is_color(node) == true);
BOOST_ASSERT(node.size() == 4);
typedef utree::const_iterator iter;
View
@@ -94,6 +94,10 @@ std::string filter_printer::operator() (utree const& ut)
typedef utree::const_iterator iter;
iter it = ut.begin(),
end = ut.end();
+ if (it == end)
+ {
+ throw carto_error("Empty node ", get_location(ut));
+ }
if (node_type == FILTER_VAR || node_type == FILTER_VAR_ATTR) {
View
@@ -194,9 +194,13 @@ void mss_parser::parse_style(mapnik::Map& map, utree const& node, style_env cons
style_env env(parent_env);
mapnik::rule rule(parent_rule, true);
- BOOST_ASSERT(*style_it.size() == 3);
+ BOOST_ASSERT(style_it->size() == 3);
iter name_it = (*style_it).begin(),
name_end = (*style_it).end();
+ if (name_it == name_end)
+ {
+ continue;
+ }
utree const& uname = *name_it; name_it++;
utree const& uattach = *name_it; name_it++;
@@ -374,7 +378,7 @@ bool mss_parser::parse_line(mapnik::rule& rule, std::string const& key, utree co
if (key == "line-dasharray") {
- BOOST_ASSERT( (value.size()-1) % 2 == 0 );
+ //BOOST_ASSERT( (value.size()-1) % 2 == 0 );
typedef utree::const_iterator iter;
iter it = value.begin(),
@@ -564,7 +568,7 @@ bool mss_parser::parse_text(mapnik::Map& map, mapnik::rule& rule, std::string co
s->set_face_name(as<std::string>(value));
} else {
- mapnik::font_set fs;
+ mapnik::font_set fs("");
std::size_t hash = 0;
typedef utree::const_iterator iter;

0 comments on commit 86e9170

Please sign in to comment.