fix GCC shadows a member warning [-Wshadow]

This commit is contained in:
artemp 2017-01-12 17:15:05 +01:00
parent 2f55f0962e
commit 0a7e8bb429
10 changed files with 34 additions and 42 deletions

View file

@ -43,8 +43,8 @@ struct evaluate_expression
{
using value_type = T;
explicit evaluate_expression(Attributes const& _attributes)
: attributes_(_attributes) {}
explicit evaluate_expression(Attributes const& attrs)
: attrs_(attrs) {}
value_type operator() (attribute const&) const
{
@ -53,8 +53,8 @@ struct evaluate_expression
value_type operator() (global_attribute const& attr) const
{
auto itr = attributes_.find(attr.name);
if (itr != attributes_.end())
auto itr = attrs_.find(attr.name);
if (itr != attrs_.end())
{
return itr->second;
}
@ -129,7 +129,7 @@ struct evaluate_expression
return value_type(val);
}
Attributes const& attributes_;
Attributes const& attrs_;
};
template <typename T>
@ -221,7 +221,7 @@ struct evaluate_expression<T, boost::none_t>
struct assign_value
{
template<typename Attributes>
static void apply(symbolizer_base::value_type & val, expression_ptr const& expr, Attributes const& attributes, property_types target )
static void apply(symbolizer_base::value_type & val, expression_ptr const& expr, Attributes const& attrs, property_types target )
{
switch (target)
@ -230,24 +230,24 @@ struct assign_value
{
// evaluate expression as a string then parse as css color
std::string str = util::apply_visitor(mapnik::evaluate_expression<mapnik::value,
Attributes>(attributes),*expr).to_string();
Attributes>(attrs),*expr).to_string();
try { val = parse_color(str); }
catch (...) { val = color(0,0,0);}
break;
}
case property_types::target_double:
{
val = util::apply_visitor(mapnik::evaluate_expression<mapnik::value, Attributes>(attributes),*expr).to_double();
val = util::apply_visitor(mapnik::evaluate_expression<mapnik::value, Attributes>(attrs),*expr).to_double();
break;
}
case property_types::target_integer:
{
val = util::apply_visitor(mapnik::evaluate_expression<mapnik::value, Attributes>(attributes),*expr).to_int();
val = util::apply_visitor(mapnik::evaluate_expression<mapnik::value, Attributes>(attrs),*expr).to_int();
break;
}
case property_types::target_bool:
{
val = util::apply_visitor(mapnik::evaluate_expression<mapnik::value, Attributes>(attributes),*expr).to_bool();
val = util::apply_visitor(mapnik::evaluate_expression<mapnik::value, Attributes>(attrs),*expr).to_bool();
break;
}
default: // no-op
@ -276,14 +276,14 @@ struct evaluate_global_attributes : util::noncopyable
template <typename Attributes>
struct evaluator
{
evaluator(symbolizer_base::cont_type::value_type & prop, Attributes const& attributes)
evaluator(symbolizer_base::cont_type::value_type & prop, Attributes const& attrs)
: prop_(prop),
attributes_(attributes) {}
attrs_(attrs) {}
void operator() (expression_ptr const& expr) const
{
auto const& meta = get_meta(prop_.first);
assign_value::apply(prop_.second, expr, attributes_, std::get<2>(meta));
assign_value::apply(prop_.second, expr, attrs_, std::get<2>(meta));
}
template <typename T>
@ -292,28 +292,28 @@ struct evaluate_global_attributes : util::noncopyable
// no-op
}
symbolizer_base::cont_type::value_type & prop_;
Attributes const& attributes_;
Attributes const& attrs_;
};
template <typename Attributes>
struct extract_symbolizer
{
extract_symbolizer(Attributes const& attributes)
: attributes_(attributes) {}
extract_symbolizer(Attributes const& attrs)
: attrs_(attrs) {}
template <typename Symbolizer>
void operator() (Symbolizer & sym) const
{
for (auto & prop : sym.properties)
{
util::apply_visitor(evaluator<Attributes>(prop, attributes_), prop.second);
util::apply_visitor(evaluator<Attributes>(prop, attrs_), prop.second);
}
}
Attributes const& attributes_;
Attributes const& attrs_;
};
template <typename Attributes>
static void apply(Map & m, Attributes const& attributes)
static void apply(Map & m, Attributes const& attrs)
{
for ( auto & val : m.styles() )
{
@ -321,7 +321,7 @@ struct evaluate_global_attributes : util::noncopyable
{
for (auto & sym : rule)
{
util::apply_visitor(extract_symbolizer<Attributes>(attributes), sym);
util::apply_visitor(extract_symbolizer<Attributes>(attrs), sym);
}
}
}

View file

@ -50,8 +50,6 @@ namespace mapnik {
struct clip_poly_tag;
using svg_attribute_type = agg::pod_bvector<svg::path_attributes>;
template <typename Detector>
struct vector_markers_dispatch : util::noncopyable
{

View file

@ -377,7 +377,6 @@ struct agg_render_marker_visitor
using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba<blender_type, agg::rendering_buffer>;
using renderer_base = agg::renderer_base<pixfmt_comp_type>;
using renderer_type = agg::renderer_scanline_aa_solid<renderer_base>;
using svg_attribute_type = agg::pod_bvector<mapnik::svg::path_attributes>;
ras_ptr_->reset();
if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0)

View file

@ -75,7 +75,6 @@ struct thunk_renderer<image_rgba8> : render_thunk_list_dispatch
using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba<blender_type, buf_type>;
using renderer_base = agg::renderer_base<pixfmt_comp_type>;
using renderer_type = agg::renderer_scanline_aa_solid<renderer_base>;
using svg_attribute_type = agg::pod_bvector<svg::path_attributes>;
using svg_renderer_type = svg::svg_renderer_agg<svg_path_adapter,
svg_attribute_type,
renderer_type,

View file

@ -56,7 +56,6 @@ struct agg_markers_renderer_context : markers_renderer_context
{
using renderer_base = typename SvgRenderer::renderer_base;
using vertex_source_type = typename SvgRenderer::vertex_source_type;
using attribute_source_type = typename SvgRenderer::attribute_source_type;
using pixfmt_type = typename renderer_base::pixfmt_type;
agg_markers_renderer_context(symbolizer_base const& sym,
@ -117,7 +116,6 @@ void agg_renderer<T0,T1>::process(markers_symbolizer const& sym,
using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba<blender_type, buf_type>;
using renderer_base = agg::renderer_base<pixfmt_comp_type>;
using renderer_type = agg::renderer_scanline_aa_solid<renderer_base>;
using svg_attribute_type = agg::pod_bvector<path_attributes>;
using svg_renderer_type = svg_renderer_agg<svg_path_adapter,
svg_attribute_type,
renderer_type,

View file

@ -74,7 +74,6 @@ struct thunk_renderer : render_thunk_list_dispatch
using renderer_type = agg::renderer_scanline_bin_solid<grid_renderer_base_type>;
using namespace mapnik::svg;
using svg_attribute_type = agg::pod_bvector<path_attributes>;
using svg_renderer_type = svg_renderer_agg<svg_path_adapter,
svg_attribute_type,
renderer_type,

View file

@ -143,7 +143,6 @@ void grid_renderer<T>::process(markers_symbolizer const& sym,
using renderer_type = agg::renderer_scanline_bin_solid<grid_renderer_base_type>;
using namespace mapnik::svg;
using svg_attribute_type = agg::pod_bvector<path_attributes>;
using svg_renderer_type = svg_renderer_agg<svg_path_adapter,
svg_attribute_type,
renderer_type,

View file

@ -58,8 +58,8 @@ PluginInfo::PluginInfo(std::string const& filename,
if (module_) module_->dl = LoadLibraryA(filename.c_str());
if (module_ && module_->dl)
{
callable_returning_string name = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
if (name) name_ = name();
callable_returning_string name_call = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
if (name_call) name_ = name_call();
callable_returning_void init_once = reinterpret_cast<callable_returning_void>(dlsym(module_->dl, "on_plugin_load"));
if (init_once) {
init_once();
@ -70,8 +70,8 @@ PluginInfo::PluginInfo(std::string const& filename,
if (module_) module_->dl = dlopen(filename.c_str(),RTLD_LAZY);
if (module_ && module_->dl)
{
callable_returning_string name = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
if (name) name_ = name();
callable_returning_string name_call = reinterpret_cast<callable_returning_string>(dlsym(module_->dl, library_name.c_str()));
if (name_call) name_ = name_call();
callable_returning_void init_once = reinterpret_cast<callable_returning_void>(dlsym(module_->dl, "on_plugin_load"));
if (init_once) {
init_once();

View file

@ -37,27 +37,27 @@ namespace formatting {
void list_node::to_xml(boost::property_tree::ptree & xml) const
{
for (node_ptr const& node : children_)
for (node_ptr const& n : children_)
{
node->to_xml(xml);
n->to_xml(xml);
}
}
void list_node::apply(evaluated_format_properties_ptr const& p, feature_impl const& feature, attributes const& vars, text_layout & output) const
{
for (node_ptr const& node : children_)
for (node_ptr const& n : children_)
{
node->apply(p, feature, vars, output);
n->apply(p, feature, vars, output);
}
}
void list_node::add_expressions(expression_set &output) const
{
for (node_ptr const& node : children_)
for (node_ptr const& n : children_)
{
node->add_expressions(output);
n->add_expressions(output);
}
}

View file

@ -346,16 +346,16 @@ boost::optional<T> xml_node::get_opt_attr(std::string const& name) const
template <typename T>
T xml_node::get_attr(std::string const& name, T const& default_opt_value) const
{
boost::optional<T> value = get_opt_attr<T>(name);
if (value) return *value;
boost::optional<T> val = get_opt_attr<T>(name);
if (val) return *val;
return default_opt_value;
}
template <typename T>
T xml_node::get_attr(std::string const& name) const
{
boost::optional<T> value = get_opt_attr<T>(name);
if (value) return *value;
boost::optional<T> val = get_opt_attr<T>(name);
if (val) return *val;
throw attribute_not_found(name_, name);
}