diff --git a/SConstruct b/SConstruct index 510bee802..f4e910b22 100644 --- a/SConstruct +++ b/SConstruct @@ -1770,8 +1770,8 @@ if not preconfigured: env.Append(CPPDEFINES = ndebug_defines) # Common flags for g++/clang++ CXX compiler. - # TODO: clean up code more to make -Wextra -Wsign-compare -Wsign-conversion -Wconversion -Wshadow viable - common_cxx_flags = '-Wall %s %s -ftemplate-depth-300 ' % (env['WARNING_CXXFLAGS'], pthread) + # TODO: clean up code more to make -Wextra -Wsign-compare -Wsign-conversion -Wconversion viable + common_cxx_flags = '-Wall %s %s -ftemplate-depth-300 -Wsign-compare -Wshadow ' % (env['WARNING_CXXFLAGS'], pthread) if 'clang++' in env['CXX']: common_cxx_flags += ' -Wno-unknown-pragmas -Wno-unsequenced ' diff --git a/benchmark/test_polygon_clipping.cpp b/benchmark/test_polygon_clipping.cpp index db060e7bb..25eacea76 100644 --- a/benchmark/test_polygon_clipping.cpp +++ b/benchmark/test_polygon_clipping.cpp @@ -246,10 +246,10 @@ public: std::string expect = expected_+".png"; std::string actual = expected_+"_actual.png"; mapnik::geometry::multi_polygon mp; - for (auto const& geom: result) + for (auto const& _geom: result) { //std::clog << boost::geometry::dsv(geom) << "\n"; - mp.emplace_back(geom); + mp.emplace_back(_geom); } mapnik::geometry::geometry geom2(mp); auto env = mapnik::geometry::envelope(geom2); @@ -287,9 +287,9 @@ public: std::deque > result; boost::geometry::intersection(extent_,poly,result); unsigned count = 0; - for (auto const& geom : result) + for (auto const& _geom : result) { - mapnik::geometry::polygon_vertex_adapter va(geom); + mapnik::geometry::polygon_vertex_adapter va(_geom); unsigned cmd; double x,y; while ((cmd = va.vertex(&x, &y)) != mapnik::SEG_END) { diff --git a/include/mapnik/attribute_collector.hpp b/include/mapnik/attribute_collector.hpp index 9f2e81573..6fa698214 100644 --- a/include/mapnik/attribute_collector.hpp +++ b/include/mapnik/attribute_collector.hpp @@ -42,6 +42,7 @@ // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/cairo/cairo_image_util.hpp b/include/mapnik/cairo/cairo_image_util.hpp index c0d23410b..9f039d605 100644 --- a/include/mapnik/cairo/cairo_image_util.hpp +++ b/include/mapnik/cairo/cairo_image_util.hpp @@ -41,8 +41,8 @@ static inline void cairo_image_to_rgba8(mapnik::image_rgba8 & data, throw std::runtime_error("Unable to convert this Cairo format to rgba8 image"); } - if (cairo_image_surface_get_width(&*surface) != data.width() || - cairo_image_surface_get_height(&*surface) != data.height()) + if (cairo_image_surface_get_width(&*surface) != static_cast(data.width()) || + cairo_image_surface_get_height(&*surface) != static_cast(data.height())) { throw std::runtime_error("Mismatch in dimensions: size of image must match side of cairo surface"); } diff --git a/include/mapnik/css_color_grammar.hpp b/include/mapnik/css_color_grammar.hpp index 7c7942d98..6521a4e1e 100644 --- a/include/mapnik/css_color_grammar.hpp +++ b/include/mapnik/css_color_grammar.hpp @@ -31,6 +31,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/include/mapnik/expression_grammar.hpp b/include/mapnik/expression_grammar.hpp index 3dd5fc410..6ce0b5cd6 100644 --- a/include/mapnik/expression_grammar.hpp +++ b/include/mapnik/expression_grammar.hpp @@ -34,6 +34,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/include/mapnik/expression_node.hpp b/include/mapnik/expression_node.hpp index ea161f094..49d63872a 100644 --- a/include/mapnik/expression_node.hpp +++ b/include/mapnik/expression_node.hpp @@ -86,8 +86,8 @@ struct unary_function_call { using argument_type = expr_node; unary_function_call() = default; - unary_function_call(unary_function_impl fun, argument_type const& arg) - : fun(fun), arg(arg) {} + unary_function_call(unary_function_impl _fun, argument_type const& _arg) + : fun(_fun), arg(_arg) {} unary_function_impl fun; argument_type arg; @@ -97,8 +97,8 @@ struct binary_function_call { using argument_type = expr_node; binary_function_call() = default; - binary_function_call(binary_function_impl fun, argument_type const& arg1, argument_type const& arg2) - : fun(fun), arg1(arg1), arg2(arg2) {} + binary_function_call(binary_function_impl _fun, argument_type const& _arg1, argument_type const& _arg2) + : fun(_fun), arg1(_arg1), arg2(_arg2) {} binary_function_impl fun; argument_type arg1; argument_type arg2; diff --git a/include/mapnik/geometry_adapters.hpp b/include/mapnik/geometry_adapters.hpp index 93076a82b..c53960bc7 100644 --- a/include/mapnik/geometry_adapters.hpp +++ b/include/mapnik/geometry_adapters.hpp @@ -28,6 +28,7 @@ // undef B0 to workaround https://svn.boost.org/trac/boost/ticket/10467 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #undef B0 #include #include diff --git a/include/mapnik/geometry_correct.hpp b/include/mapnik/geometry_correct.hpp index 8698c129a..328dc2ed0 100644 --- a/include/mapnik/geometry_correct.hpp +++ b/include/mapnik/geometry_correct.hpp @@ -31,6 +31,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/image_filter.hpp b/include/mapnik/image_filter.hpp index eef8141b2..861c7961d 100644 --- a/include/mapnik/image_filter.hpp +++ b/include/mapnik/image_filter.hpp @@ -33,6 +33,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wc++11-narrowing" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/image_filter_grammar.hpp b/include/mapnik/image_filter_grammar.hpp index a7c0bd90c..ec00f1ee3 100644 --- a/include/mapnik/image_filter_grammar.hpp +++ b/include/mapnik/image_filter_grammar.hpp @@ -27,6 +27,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/image_util.hpp b/include/mapnik/image_util.hpp index 7185d6478..e7233b874 100644 --- a/include/mapnik/image_util.hpp +++ b/include/mapnik/image_util.hpp @@ -30,6 +30,7 @@ // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/json/extract_bounding_box_grammar.hpp b/include/mapnik/json/extract_bounding_box_grammar.hpp index 0cc37336a..1e061e706 100644 --- a/include/mapnik/json/extract_bounding_box_grammar.hpp +++ b/include/mapnik/json/extract_bounding_box_grammar.hpp @@ -32,6 +32,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/include/mapnik/json/generic_json.hpp b/include/mapnik/json/generic_json.hpp index 16124adbc..edb1284f4 100644 --- a/include/mapnik/json/generic_json.hpp +++ b/include/mapnik/json/generic_json.hpp @@ -30,6 +30,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/json/geometry_generator_grammar.hpp b/include/mapnik/json/geometry_generator_grammar.hpp index a26de5b34..51990add4 100644 --- a/include/mapnik/json/geometry_generator_grammar.hpp +++ b/include/mapnik/json/geometry_generator_grammar.hpp @@ -32,6 +32,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include // for vc++ and android whose c++11 libs lack std::trunc diff --git a/include/mapnik/json/positions_grammar.hpp b/include/mapnik/json/positions_grammar.hpp index 2a70306ef..3440d820c 100644 --- a/include/mapnik/json/positions_grammar.hpp +++ b/include/mapnik/json/positions_grammar.hpp @@ -33,6 +33,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/include/mapnik/json/properties_generator_grammar.hpp b/include/mapnik/json/properties_generator_grammar.hpp index e52b55ed4..ea5da9332 100644 --- a/include/mapnik/json/properties_generator_grammar.hpp +++ b/include/mapnik/json/properties_generator_grammar.hpp @@ -28,6 +28,10 @@ #include // boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include @@ -37,6 +41,7 @@ #include #include #include +#pragma GCC diagnostic pop namespace mapnik { namespace json { diff --git a/include/mapnik/json/topojson_grammar.hpp b/include/mapnik/json/topojson_grammar.hpp index e3db0990d..bf8d24101 100644 --- a/include/mapnik/json/topojson_grammar.hpp +++ b/include/mapnik/json/topojson_grammar.hpp @@ -33,6 +33,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/json/topology.hpp b/include/mapnik/json/topology.hpp index 12e0f9a83..221f1f252 100644 --- a/include/mapnik/json/topology.hpp +++ b/include/mapnik/json/topology.hpp @@ -26,9 +26,12 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include +#pragma GCC diagnostic pop #include #include diff --git a/include/mapnik/offset_converter.hpp b/include/mapnik/offset_converter.hpp index 0f7501c67..9b5aa8ce6 100644 --- a/include/mapnik/offset_converter.hpp +++ b/include/mapnik/offset_converter.hpp @@ -292,7 +292,7 @@ private: std::vector points; std::vector close_points; bool is_polygon = false; - int cpt = 0; + std::size_t cpt = 0; v0.cmd = geom_.vertex(&v0.x, &v0.y); v1.x = v0.x; v1.y = v0.y; diff --git a/include/mapnik/params_impl.hpp b/include/mapnik/params_impl.hpp index c262cacb6..255521fec 100644 --- a/include/mapnik/params_impl.hpp +++ b/include/mapnik/params_impl.hpp @@ -33,6 +33,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/path_expression_grammar.hpp b/include/mapnik/path_expression_grammar.hpp index f39947ef6..a69f535a2 100644 --- a/include/mapnik/path_expression_grammar.hpp +++ b/include/mapnik/path_expression_grammar.hpp @@ -30,6 +30,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/proj_strategy.hpp b/include/mapnik/proj_strategy.hpp index 688e6d331..2afb17052 100644 --- a/include/mapnik/proj_strategy.hpp +++ b/include/mapnik/proj_strategy.hpp @@ -31,6 +31,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/include/mapnik/quad_tree.hpp b/include/mapnik/quad_tree.hpp index d8d405434..474ee2e7c 100644 --- a/include/mapnik/quad_tree.hpp +++ b/include/mapnik/quad_tree.hpp @@ -31,6 +31,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/renderer_common/process_group_symbolizer.hpp b/include/mapnik/renderer_common/process_group_symbolizer.hpp index 07adf5408..00017301a 100644 --- a/include/mapnik/renderer_common/process_group_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_group_symbolizer.hpp @@ -341,10 +341,10 @@ void render_group_symbolizer(group_symbolizer const& sym, render_thunk_extractor extractor(bounds, thunks, *sub_feature, common.vars_, prj_trans, virtual_renderer, clipping_extent); - for (auto const& sym : *rule) + for (auto const& _sym : *rule) { // TODO: construct layout and obtain bounding box - util::apply_visitor(extractor, sym); + util::apply_visitor(extractor, _sym); } // add the bounding box to the layout manager diff --git a/include/mapnik/sql_utils.hpp b/include/mapnik/sql_utils.hpp index f45af6ca8..543ea25ee 100644 --- a/include/mapnik/sql_utils.hpp +++ b/include/mapnik/sql_utils.hpp @@ -30,6 +30,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/svg/geometry_svg_generator.hpp b/include/mapnik/svg/geometry_svg_generator.hpp index 1aa056eb9..3f75d8444 100644 --- a/include/mapnik/svg/geometry_svg_generator.hpp +++ b/include/mapnik/svg/geometry_svg_generator.hpp @@ -37,6 +37,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/include/mapnik/svg/output/svg_output_grammars.hpp b/include/mapnik/svg/output/svg_output_grammars.hpp index f3ef886e7..ce1afe760 100644 --- a/include/mapnik/svg/output/svg_output_grammars.hpp +++ b/include/mapnik/svg/output/svg_output_grammars.hpp @@ -40,6 +40,7 @@ namespace mapnik { namespace svg { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/include/mapnik/svg/output/svg_output_grammars_impl.hpp b/include/mapnik/svg/output/svg_output_grammars_impl.hpp index 892fdf903..ab41aabae 100644 --- a/include/mapnik/svg/output/svg_output_grammars_impl.hpp +++ b/include/mapnik/svg/output/svg_output_grammars_impl.hpp @@ -30,6 +30,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/svg/svg_path_commands.hpp b/include/mapnik/svg/svg_path_commands.hpp index 905f262a2..ff398368b 100644 --- a/include/mapnik/svg/svg_path_commands.hpp +++ b/include/mapnik/svg/svg_path_commands.hpp @@ -30,6 +30,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/include/mapnik/svg/svg_transform_grammar.hpp b/include/mapnik/svg/svg_transform_grammar.hpp index ce5563df1..68ed02198 100644 --- a/include/mapnik/svg/svg_transform_grammar.hpp +++ b/include/mapnik/svg/svg_transform_grammar.hpp @@ -33,6 +33,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/include/mapnik/symbolizer_utils.hpp b/include/mapnik/symbolizer_utils.hpp index 00a4f0208..bbe0fd3fd 100644 --- a/include/mapnik/symbolizer_utils.hpp +++ b/include/mapnik/symbolizer_utils.hpp @@ -461,8 +461,8 @@ struct set_symbolizer_property_impl auto result = pre_evaluate_expression(*val); if (std::get<1>(result)) { - boost::optional enum_val = detail::enum_traits::from_string(std::get<0>(result).to_string()); - if (enum_val) + boost::optional enum_val2 = detail::enum_traits::from_string(std::get<0>(result).to_string()); + if (enum_val2) { put(sym, key, *enum_val); } diff --git a/include/mapnik/text/itemizer.hpp b/include/mapnik/text/itemizer.hpp index 0b28bc34d..42965bf6a 100644 --- a/include/mapnik/text/itemizer.hpp +++ b/include/mapnik/text/itemizer.hpp @@ -86,8 +86,8 @@ public: private: template struct run : util::noncopyable { - run(T const& data, unsigned start, unsigned end) - : start(start), end(end), data(data) {} + run(T const& _data, unsigned _start, unsigned _end) + : start(_start), end(_end), data(_data) {} unsigned start; unsigned end; T data; diff --git a/include/mapnik/util/container_adapter.hpp b/include/mapnik/util/container_adapter.hpp index 5ebf09ba6..da47b2ec5 100644 --- a/include/mapnik/util/container_adapter.hpp +++ b/include/mapnik/util/container_adapter.hpp @@ -31,6 +31,7 @@ // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/vertex_cache.hpp b/include/mapnik/vertex_cache.hpp index 094101a85..9b19b7e0c 100644 --- a/include/mapnik/vertex_cache.hpp +++ b/include/mapnik/vertex_cache.hpp @@ -47,7 +47,7 @@ class MAPNIK_DECL vertex_cache : util::noncopyable { struct segment { - segment(double x, double y, double length) : pos(x, y), length(length) {} + segment(double x, double y, double _length) : pos(x, y), length(_length) {} pixel_position pos; //Last point of this segment, first point is implicitly defined by the previous segement in this vector double length; }; diff --git a/include/mapnik/vertex_converters.hpp b/include/mapnik/vertex_converters.hpp index 13c07d8e7..466113ed4 100644 --- a/include/mapnik/vertex_converters.hpp +++ b/include/mapnik/vertex_converters.hpp @@ -351,17 +351,17 @@ struct dispatcher : util::noncopyable struct arguments : util::noncopyable { - arguments(box2d const& bbox, symbolizer_base const& sym, view_transform const& tr, - proj_transform const& prj_trans, agg::trans_affine const& affine_trans, feature_impl const& feature, - attributes const& vars, double scale_factor) - : bbox(bbox), - sym(sym), - tr(tr), - prj_trans(prj_trans), - affine_trans(affine_trans), - feature(feature), - vars(vars), - scale_factor(scale_factor) {} + arguments(box2d const& _bbox, symbolizer_base const& _sym, view_transform const& _tr, + proj_transform const& _prj_trans, agg::trans_affine const& _affine_trans, feature_impl const& _feature, + attributes const& _vars, double _scale_factor) + : bbox(_bbox), + sym(_sym), + tr(_tr), + prj_trans(_prj_trans), + affine_trans(_affine_trans), + feature(_feature), + vars(_vars), + scale_factor(_scale_factor) {} box2d const& bbox; symbolizer_base const& sym; diff --git a/include/mapnik/wkt/wkt_generator_grammar.hpp b/include/mapnik/wkt/wkt_generator_grammar.hpp index 1a0b558c8..0d4286ed4 100644 --- a/include/mapnik/wkt/wkt_generator_grammar.hpp +++ b/include/mapnik/wkt/wkt_generator_grammar.hpp @@ -33,6 +33,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include // for vc++ and android whose c++11 libs lack std::trunc diff --git a/include/mapnik/wkt/wkt_grammar.hpp b/include/mapnik/wkt/wkt_grammar.hpp index b0566635b..c2245631c 100644 --- a/include/mapnik/wkt/wkt_grammar.hpp +++ b/include/mapnik/wkt/wkt_grammar.hpp @@ -29,6 +29,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/plugins/input/geojson/geojson_datasource.cpp b/plugins/input/geojson/geojson_datasource.cpp index 8d82f4266..d5f42fe4b 100644 --- a/plugins/input/geojson/geojson_datasource.cpp +++ b/plugins/input/geojson/geojson_datasource.cpp @@ -55,7 +55,10 @@ #include #if defined(SHAPE_MEMORY_MAPPED_FILE) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include +#pragma GCC diagnostic pop #include #endif @@ -210,12 +213,11 @@ void geojson_datasource::initialise_index(Iterator start, Iterator end) extent_ = box; // parse first feature to extract attributes schema. // NOTE: this doesn't yield correct answer for geoJSON in general, just an indication - Iterator itr = start + geometry_index.first; - Iterator end = itr + geometry_index.second; + Iterator itr2 = start + geometry_index.first; + Iterator end2 = itr + geometry_index.second; mapnik::context_ptr ctx = std::make_shared(); mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx,1)); - boost::spirit::standard::space_type space; - if (!boost::spirit::qi::phrase_parse(itr, end, (geojson_datasource_static_feature_grammar)(boost::phoenix::ref(*feature)), space)) + if (!boost::spirit::qi::phrase_parse(itr2, end2, (geojson_datasource_static_feature_grammar)(boost::phoenix::ref(*feature)), space)) { throw std::runtime_error("Failed to parse geojson feature"); } @@ -351,13 +353,13 @@ boost::optional geojson_datasource::get_geometry_ std::fread(json.data(), size, 1, file.get()); using chr_iterator_type = char const*; - chr_iterator_type start = json.data(); - chr_iterator_type end = start + json.size(); + chr_iterator_type start2 = json.data(); + chr_iterator_type end2 = start2 + json.size(); using namespace boost::spirit; standard::space_type space; mapnik::feature_ptr feature(mapnik::feature_factory::create(ctx,1)); - if (!qi::phrase_parse(start, end, (geojson_datasource_static_feature_grammar)(boost::phoenix::ref(*feature)), space)) + if (!qi::phrase_parse(start2, end2, (geojson_datasource_static_feature_grammar)(boost::phoenix::ref(*feature)), space)) { throw std::runtime_error("Failed to parse geojson feature"); } diff --git a/plugins/input/geojson/geojson_datasource.hpp b/plugins/input/geojson/geojson_datasource.hpp index c9b320d9b..66c54e907 100644 --- a/plugins/input/geojson/geojson_datasource.hpp +++ b/plugins/input/geojson/geojson_datasource.hpp @@ -39,6 +39,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #pragma GCC diagnostic pop diff --git a/plugins/input/ogr/ogr_datasource.hpp b/plugins/input/ogr/ogr_datasource.hpp index ddd74b717..c058d799c 100644 --- a/plugins/input/ogr/ogr_datasource.hpp +++ b/plugins/input/ogr/ogr_datasource.hpp @@ -41,7 +41,10 @@ #include // ogr +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include +#pragma GCC diagnostic pop #include "ogr_layer_ptr.hpp" class ogr_datasource : public mapnik::datasource diff --git a/plugins/input/ogr/ogr_featureset.hpp b/plugins/input/ogr/ogr_featureset.hpp index 9dfd7290c..6b5ea16be 100644 --- a/plugins/input/ogr/ogr_featureset.hpp +++ b/plugins/input/ogr/ogr_featureset.hpp @@ -29,11 +29,11 @@ #include #include -// boost - - // ogr +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include +#pragma GCC diagnostic pop class ogr_featureset : public mapnik::Featureset { diff --git a/plugins/input/ogr/ogr_index_featureset.cpp b/plugins/input/ogr/ogr_index_featureset.cpp index 265ded381..e2526c6fd 100644 --- a/plugins/input/ogr/ogr_index_featureset.cpp +++ b/plugins/input/ogr/ogr_index_featureset.cpp @@ -35,8 +35,11 @@ // boost #ifdef SHAPE_MEMORY_MAPPED_FILE #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include #include +#pragma GCC diagnostic pop #endif // ogr diff --git a/plugins/input/topojson/topojson_datasource.hpp b/plugins/input/topojson/topojson_datasource.hpp index fff936d3a..829045028 100644 --- a/plugins/input/topojson/topojson_datasource.hpp +++ b/plugins/input/topojson/topojson_datasource.hpp @@ -39,6 +39,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/src/color.cpp b/src/color.cpp index 75204ce7f..5d25f3146 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -32,6 +32,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #include #include diff --git a/src/conversions.cpp b/src/conversions.cpp index 83bdd5fae..094ac0e1e 100644 --- a/src/conversions.cpp +++ b/src/conversions.cpp @@ -33,6 +33,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include #ifdef MAPNIK_KARMA_TO_STRING #include diff --git a/src/image_filter_types.cpp b/src/image_filter_types.cpp index 0b28b07c0..22c474f86 100644 --- a/src/image_filter_types.cpp +++ b/src/image_filter_types.cpp @@ -29,6 +29,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wshadow" #include #pragma GCC diagnostic pop diff --git a/src/mapped_memory_cache.cpp b/src/mapped_memory_cache.cpp index c589681e8..6e9ca1e1c 100644 --- a/src/mapped_memory_cache.cpp +++ b/src/mapped_memory_cache.cpp @@ -29,8 +29,11 @@ // boost #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include #include +#pragma GCC diagnostic pop namespace mapnik { diff --git a/src/svg/output/svg_generator.cpp b/src/svg/output/svg_generator.cpp index d6556eabf..5c48702d4 100644 --- a/src/svg/output/svg_generator.cpp +++ b/src/svg/output/svg_generator.cpp @@ -28,7 +28,12 @@ #include // boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #include +#pragma GCC diagnostic pop namespace mapnik { namespace svg { diff --git a/test/data-visual b/test/data-visual index a8a922990..8e70a97b3 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit a8a922990aa671369fdce51fe4bfe5447cead4d4 +Subproject commit 8e70a97b35fdb687bbfe4027713e302b86e8420a diff --git a/test/visual/config.hpp b/test/visual/config.hpp index 48e6359f2..8353d4b2e 100644 --- a/test/visual/config.hpp +++ b/test/visual/config.hpp @@ -35,10 +35,10 @@ namespace visual_tests struct map_size { - map_size(int width, int height) : width(width), height(height) { } + map_size(int _width, int _height) : width(_width), height(_height) { } map_size() { } - unsigned width; - unsigned height; + unsigned width = 0; + unsigned height = 0; }; struct config diff --git a/test/visual/renderer.hpp b/test/visual/renderer.hpp index 7dbfb0412..f097dac2b 100644 --- a/test/visual/renderer.hpp +++ b/test/visual/renderer.hpp @@ -195,8 +195,8 @@ template class renderer { public: - renderer(boost::filesystem::path const & output_dir, boost::filesystem::path const & reference_dir, bool overwrite) - : ren(), output_dir(output_dir), reference_dir(reference_dir), overwrite(overwrite) + renderer(boost::filesystem::path const & _output_dir, boost::filesystem::path const & _reference_dir, bool _overwrite) + : ren(), output_dir(_output_dir), reference_dir(_reference_dir), overwrite(_overwrite) { } diff --git a/test/visual/report.hpp b/test/visual/report.hpp index cdccad2aa..3b6146ec5 100644 --- a/test/visual/report.hpp +++ b/test/visual/report.hpp @@ -40,7 +40,7 @@ public: { } - console_report(std::ostream & s) : s(s) + console_report(std::ostream & _s) : s(_s) { } @@ -68,7 +68,7 @@ public: class html_report { public: - html_report(std::ostream & s) : s(s) + html_report(std::ostream & _s) : s(_s) { }