more fix GCC shadows a member warning [-Wshadow]

This commit is contained in:
artemp 2017-01-13 09:38:54 +01:00
parent 1b940bebcc
commit 28c51df986
6 changed files with 32 additions and 32 deletions

View file

@ -76,8 +76,8 @@ void cairo_renderer<T>::process(markers_symbolizer const& sym,
context_.set_operator(comp_op);
box2d<double> clip_box = common_.query_extent_;
using context_type = detail::cairo_markers_renderer_context;
context_type renderer_context(context_);
using renderer_context_type = detail::cairo_markers_renderer_context;
renderer_context_type renderer_context(context_);
render_markers_symbolizer(
sym, feature, prj_trans, common_, clip_box,

View file

@ -1483,32 +1483,32 @@ bool map_parser::parse_raster_colorizer(raster_colorizer_ptr const& rc,
colorizer_mode mode = n.get_attr<colorizer_mode>("mode", COLORIZER_INHERIT);
// value is required, and it must be bigger than the previous
optional<float> value = n.get_opt_attr<float>("value");
optional<float> val = n.get_opt_attr<float>("value");
if(!value)
if (!val)
{
throw config_error("stop tag missing value");
}
if(value < maximumValue)
if (val < maximumValue)
{
throw config_error("stop tag values must be in ascending order");
}
maximumValue = *value;
maximumValue = *val;
optional<std::string> label = n.get_opt_attr<std::string>("label");
//append the stop
colorizer_stop tmpStop;
tmpStop.set_color(*stopcolor);
tmpStop.set_mode(mode);
tmpStop.set_value(*value);
colorizer_stop stop;
stop.set_color(*stopcolor);
stop.set_mode(mode);
stop.set_value(*val);
if (label)
{
tmpStop.set_label(*label);
stop.set_label(*label);
}
rc->add_stop(tmpStop);
rc->add_stop(stop);
}
}
}

View file

@ -48,10 +48,10 @@ static const char *colorizer_mode_strings[] = {
IMPLEMENT_ENUM( colorizer_mode, colorizer_mode_strings )
colorizer_stop::colorizer_stop(float value, colorizer_mode mode,
colorizer_stop::colorizer_stop(float val, colorizer_mode mode,
color const& _color,
std::string const& label)
: value_(value)
: value_(val)
, mode_(mode)
, color_(_color)
, label_(label)
@ -135,14 +135,14 @@ void raster_colorizer::colorize(image_rgba8 & out, T const& in,
int len = out.width() * out.height();
for (int i=0; i<len; ++i)
{
pixel_type value = in_data[i];
if (nodata && (std::fabs(value - *nodata) < epsilon_))
pixel_type val = in_data[i];
if (nodata && (std::fabs(val - *nodata) < epsilon_))
{
out_data[i] = 0; // rgba(0,0,0,0)
}
else
{
out_data[i] = get_color(value);
out_data[i] = get_color(val);
}
}
}
@ -152,7 +152,7 @@ inline unsigned interpolate(unsigned start, unsigned end, float fraction)
return static_cast<unsigned>(fraction * (static_cast<float>(end) - static_cast<float>(start)) + static_cast<float>(start));
}
unsigned raster_colorizer::get_color(float value) const
unsigned raster_colorizer::get_color(float val) const
{
int stopCount = stops_.size();
@ -162,13 +162,13 @@ unsigned raster_colorizer::get_color(float value) const
return default_color_.rgba();
}
//1 - Find the stop that the value is in
//1 - Find the stop that the val is in
int stopIdx = -1;
bool foundStopIdx = false;
for(int i=0; i<stopCount; ++i)
{
if(value < stops_[i].get_value())
if (val < stops_[i].get_value())
{
stopIdx = i-1;
foundStopIdx = true;
@ -215,7 +215,7 @@ unsigned raster_colorizer::get_color(float value) const
{
stopColor = default_color_;
nextStopColor = stops_[nextStopIdx].get_color();
stopValue = value;
stopValue = val;
nextStopValue = stops_[nextStopIdx].get_value();
}
else
@ -237,7 +237,7 @@ unsigned raster_colorizer::get_color(float value) const
}
else
{
float fraction = (value - stopValue) / (nextStopValue - stopValue);
float fraction = (val - stopValue) / (nextStopValue - stopValue);
unsigned r = interpolate(stopColor.red(), nextStopColor.red(),fraction);
unsigned g = interpolate(stopColor.green(), nextStopColor.green(),fraction);
@ -258,7 +258,7 @@ unsigned raster_colorizer::get_color(float value) const
case COLORIZER_EXACT:
default:
//approximately equal (within epsilon)
if(std::fabs(value - stopValue) < epsilon_)
if (std::fabs(val - stopValue) < epsilon_)
{
outputColor = stopColor;
}
@ -271,7 +271,7 @@ unsigned raster_colorizer::get_color(float value) const
/*
MAPNIK_LOG_DEBUG(raster_colorizer) << "raster_colorizer: get_color " << value;
MAPNIK_LOG_DEBUG(raster_colorizer) << "raster_colorizer: get_color " << val;
MAPNIK_LOG_DEBUG(raster_colorizer) << "\tstopIdx: " << stopIdx;
MAPNIK_LOG_DEBUG(raster_colorizer) << "\tnextStopIdx: " << nextStopIdx;
MAPNIK_LOG_DEBUG(raster_colorizer) << "\tstopValue: " << stopValue;

View file

@ -87,8 +87,8 @@ render_thunk_extractor::render_thunk_extractor(box2d<double> & box,
void render_thunk_extractor::operator()(markers_symbolizer const& sym) const
{
using context_type = detail::thunk_markers_renderer_context;
context_type renderer_context(sym, feature_, vars_, thunks_);
using renderer_context_type = detail::thunk_markers_renderer_context;
renderer_context_type renderer_context(sym, feature_, vars_, thunks_);
render_markers_symbolizer(
sym, feature_, prj_trans_, common_, clipping_extent_, renderer_context);

View file

@ -91,8 +91,8 @@ bool parse_positions(std::string const& evaluated_positions,
text_placement_info_simple::text_placement_info_simple(text_placements_simple const* parent,
std::string const& evaluated_positions,
double scale_factor)
: text_placement_info(parent, scale_factor),
double scale_factor_)
: text_placement_info(parent, scale_factor_),
state(0),
position_state(0),
direction_(parent->direction_),
@ -136,10 +136,10 @@ bool text_placement_info_simple::next_position_only() const
return true;
}
text_placement_info_ptr text_placements_simple::get_placement_info(double scale_factor, feature_impl const& feature, attributes const& vars) const
text_placement_info_ptr text_placements_simple::get_placement_info(double scale_factor_, feature_impl const& feature, attributes const& vars) const
{
std::string evaluated_positions = util::apply_visitor(extract_value<std::string>(feature,vars), positions_);
return std::make_shared<text_placement_info_simple>(this, evaluated_positions, scale_factor);
return std::make_shared<text_placement_info_simple>(this, evaluated_positions, scale_factor_);
}
text_placements_simple::text_placements_simple(symbolizer_base::value_type const& positions)

View file

@ -230,9 +230,9 @@ xml_node & xml_node::add_child(const char * name, unsigned line, bool is_text)
return children_.back();
}
void xml_node::add_attribute(const char * name, const char * value)
void xml_node::add_attribute(const char * name, const char * value_)
{
auto result = attributes_.emplace(name,xml_attribute(value));
auto result = attributes_.emplace(name,xml_attribute(value_));
if (!result.second)
{
MAPNIK_LOG_ERROR(xml_tree) << "ignoring duplicate attribute '" << name << "'";