diff --git a/.travis.yml b/.travis.yml index f5a8d2981..c0e2afb14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,7 +67,7 @@ script: export MASON_VERSION=latest; export MASON_LIB_FILE=lib/libmapnik-wkt.a; source ./.mason/mason.sh; - ./configure PREFIX=${MASON_PREFIX} PATH_REPLACE='' MAPNIK_BUNDLED_SHARE_DIRECTORY=True; + ./configure PREFIX=${MASON_PREFIX} PATH_REPLACE='' MAPNIK_BUNDLED_SHARE_DIRECTORY=True RUNTIME_LINK='static'; else ./configure; fi @@ -79,8 +79,6 @@ script: - if [[ ${COVERAGE} != true ]]; then make bench; fi - -after_success: - if [[ ${MASON_PUBLISH} == true ]]; then ./mason_latest.sh build; ./mason_latest.sh link; 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/bench_framework.hpp b/benchmark/bench_framework.hpp index 33c5b0f99..52088e4e1 100644 --- a/benchmark/bench_framework.hpp +++ b/benchmark/bench_framework.hpp @@ -4,6 +4,8 @@ // mapnik #include #include +#include +#include "../test/cleanup.hpp" // stl #include @@ -25,8 +27,8 @@ protected: public: test_case(mapnik::parameters const& params) : params_(params), - threads_(*params.get("threads",0)), - iterations_(*params.get("iterations",0)) + threads_(mapnik::safe_cast(*params.get("threads",0))), + iterations_(mapnik::safe_cast(*params.get("iterations",0))) {} std::size_t threads() const { @@ -66,11 +68,14 @@ void handle_args(int argc, char** argv, mapnik::parameters & params) mapnik::parameters params; \ benchmark::handle_args(argc,argv,params); \ test_class test_runner(params); \ - return run(test_runner,name); \ + auto result = run(test_runner,name); \ + testing::run_cleanup(); \ + return result; \ } \ catch (std::exception const& ex) \ { \ std::clog << ex.what() << "\n"; \ + testing::run_cleanup(); \ return -1; \ } \ } \ diff --git a/benchmark/build.py b/benchmark/build.py index 426666508..4a058dd3a 100644 --- a/benchmark/build.py +++ b/benchmark/build.py @@ -44,6 +44,7 @@ benchmarks = [ "test_rendering.cpp", "test_rendering_shared_map.cpp", "test_offset_converter.cpp", + "test_marker_cache.cpp", # "test_numeric_cast_vs_static_cast.cpp", ] for cpp_test in benchmarks: diff --git a/benchmark/test_marker_cache.cpp b/benchmark/test_marker_cache.cpp new file mode 100644 index 000000000..03aed7f27 --- /dev/null +++ b/benchmark/test_marker_cache.cpp @@ -0,0 +1,42 @@ +#include "bench_framework.hpp" +#include + +class test : public benchmark::test_case +{ + std::vector images_; +public: + test(mapnik::parameters const& params) + : test_case(params), + images_{ + "./test/data/images/dummy.jpg", + "./test/data/images/dummy.jpeg", + "./test/data/images/dummy.png", + "./test/data/images/dummy.tif", + "./test/data/images/dummy.tiff", + //"./test/data/images/landusepattern.jpeg", // will fail since it is a png + //"./test/data/images/xcode-CgBI.png", // will fail since its an invalid png + "./test/data/svg/octocat.svg", + "./test/data/svg/place-of-worship-24.svg", + "./test/data/svg/point_sm.svg", + "./test/data/svg/point.svg", + "./test/data/svg/airfield-12.svg" + } {} + bool validate() const + { + return true; + } + bool operator()() const + { + unsigned count = 0; + for (std::size_t i=0;i 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/benchmark/test_proj_transform1.cpp b/benchmark/test_proj_transform1.cpp index 38fcf8b14..b98a49758 100644 --- a/benchmark/test_proj_transform1.cpp +++ b/benchmark/test_proj_transform1.cpp @@ -38,15 +38,16 @@ public: } bool operator()() const { - for (std::size_t i=0;i box(i,j,i,j); + mapnik::box2d box(j,k,j,k); if (!tr.forward(box)) throw std::runtime_error("could not transform coords"); } } diff --git a/demo/c++/build.py b/demo/c++/build.py index 7eb878f0b..c059b05da 100644 --- a/demo/c++/build.py +++ b/demo/c++/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2009 Artem Pavlenko, Dane Springmeyer +# Copyright (C) 2015 Artem Pavlenko, Dane Springmeyer # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os from copy import copy diff --git a/demo/c++/rundemo.cpp b/demo/c++/rundemo.cpp index 39614bfe9..c07bd5c31 100644 --- a/demo/c++/rundemo.cpp +++ b/demo/c++/rundemo.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/demo/viewer/about_dialog.cpp b/demo/viewer/about_dialog.cpp index 468a29898..06f0a966e 100644 --- a/demo/viewer/about_dialog.cpp +++ b/demo/viewer/about_dialog.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/about_dialog.hpp b/demo/viewer/about_dialog.hpp index b555a6d5f..670567112 100644 --- a/demo/viewer/about_dialog.hpp +++ b/demo/viewer/about_dialog.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/build.py b/demo/viewer/build.py index b60a80ba9..cbd35f7ae 100644 --- a/demo/viewer/build.py +++ b/demo/viewer/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,13 +17,13 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# Import ('env') import os import platform -lib_dir = os.path.normpath(env['DESTDIR'] + '/' + env['PREFIX'] + '/' + env['LIBDIR_SCHEMA'] + '/mapnik') +lib_dir = os.path.normpath(env['DESTDIR'] + '/' + env['PREFIX'] + '/' + env['LIBDIR_SCHEMA'] + '/mapnik') fonts = 1 ini_template = ''' diff --git a/demo/viewer/info_dialog.cpp b/demo/viewer/info_dialog.cpp index 37c243d69..304abf8f3 100644 --- a/demo/viewer/info_dialog.cpp +++ b/demo/viewer/info_dialog.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/info_dialog.hpp b/demo/viewer/info_dialog.hpp index 8ac762022..dde4c6661 100644 --- a/demo/viewer/info_dialog.hpp +++ b/demo/viewer/info_dialog.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layer_info_dialog.cpp b/demo/viewer/layer_info_dialog.cpp index 6d176e8f2..23de7e824 100644 --- a/demo/viewer/layer_info_dialog.cpp +++ b/demo/viewer/layer_info_dialog.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layer_info_dialog.hpp b/demo/viewer/layer_info_dialog.hpp index 9cea6e81f..efac7822f 100644 --- a/demo/viewer/layer_info_dialog.hpp +++ b/demo/viewer/layer_info_dialog.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerdelegate.cpp b/demo/viewer/layerdelegate.cpp index 93b50595c..13a1135e1 100644 --- a/demo/viewer/layerdelegate.cpp +++ b/demo/viewer/layerdelegate.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerdelegate.hpp b/demo/viewer/layerdelegate.hpp index 53fd8b381..941621d2f 100644 --- a/demo/viewer/layerdelegate.hpp +++ b/demo/viewer/layerdelegate.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerlistmodel.cpp b/demo/viewer/layerlistmodel.cpp index fccfdfdd7..6a4b0bbfa 100644 --- a/demo/viewer/layerlistmodel.cpp +++ b/demo/viewer/layerlistmodel.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerlistmodel.hpp b/demo/viewer/layerlistmodel.hpp index cc2b73fb7..ab838c782 100644 --- a/demo/viewer/layerlistmodel.hpp +++ b/demo/viewer/layerlistmodel.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerwidget.cpp b/demo/viewer/layerwidget.cpp index 93dea25af..58b88a29a 100644 --- a/demo/viewer/layerwidget.cpp +++ b/demo/viewer/layerwidget.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/layerwidget.hpp b/demo/viewer/layerwidget.hpp index d19a16a0e..f458ee94f 100644 --- a/demo/viewer/layerwidget.hpp +++ b/demo/viewer/layerwidget.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/main.cpp b/demo/viewer/main.cpp index da915d374..e80619772 100644 --- a/demo/viewer/main.cpp +++ b/demo/viewer/main.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/mainwindow.cpp b/demo/viewer/mainwindow.cpp index 442b99068..bd80bcf3d 100644 --- a/demo/viewer/mainwindow.cpp +++ b/demo/viewer/mainwindow.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/mainwindow.hpp b/demo/viewer/mainwindow.hpp index d0943dc91..260968c8f 100644 --- a/demo/viewer/mainwindow.hpp +++ b/demo/viewer/mainwindow.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/mapwidget.cpp b/demo/viewer/mapwidget.cpp index 0f6c54030..efcab8968 100644 --- a/demo/viewer/mapwidget.cpp +++ b/demo/viewer/mapwidget.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/mapwidget.hpp b/demo/viewer/mapwidget.hpp index 2373d584c..cc7964b5e 100644 --- a/demo/viewer/mapwidget.hpp +++ b/demo/viewer/mapwidget.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/styles_model.cpp b/demo/viewer/styles_model.cpp index 5b40e2a72..d2b2f708e 100644 --- a/demo/viewer/styles_model.cpp +++ b/demo/viewer/styles_model.cpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/demo/viewer/styles_model.hpp b/demo/viewer/styles_model.hpp index 407ec5974..b6ead4bfc 100644 --- a/demo/viewer/styles_model.hpp +++ b/demo/viewer/styles_model.hpp @@ -1,6 +1,6 @@ /* This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * Mapnik is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff --git a/deps/agg/build.py b/deps/agg/build.py index 51e6bc83d..e6ab9c5ae 100644 --- a/deps/agg/build.py +++ b/deps/agg/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os from glob import glob diff --git a/deps/agg/src/agg_image_filters.cpp b/deps/agg/src/agg_image_filters.cpp index 0f6191de9..bc3aa9719 100644 --- a/deps/agg/src/agg_image_filters.cpp +++ b/deps/agg/src/agg_image_filters.cpp @@ -63,7 +63,7 @@ void image_filter_lut::normalize() if(sum == image_filter_scale) break; - double k = double(image_filter_scale) / double(sum); + double k = (sum > 0) ? double(image_filter_scale) / double(sum) : 1; sum = 0; for(j = 0; j < m_diameter; j++) { diff --git a/deps/agg/src/agg_pixfmt_rgba.cpp b/deps/agg/src/agg_pixfmt_rgba.cpp index 05b8734d5..45e0b19b8 100644 --- a/deps/agg/src/agg_pixfmt_rgba.cpp +++ b/deps/agg/src/agg_pixfmt_rgba.cpp @@ -6,6 +6,9 @@ #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" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/deps/agg/src/agg_trans_single_path.cpp b/deps/agg/src/agg_trans_single_path.cpp index 57a6cb094..9b1d7cb69 100644 --- a/deps/agg/src/agg_trans_single_path.cpp +++ b/deps/agg/src/agg_trans_single_path.cpp @@ -91,9 +91,9 @@ void trans_single_path::finalize_path() for(i = 0; i < m_src_vertices.size(); i++) { vertex_dist& v = m_src_vertices[i]; - double d = v.dist; + double dd = v.dist; v.dist = dist; - dist += d; + dist += dd; } m_kindex = (m_src_vertices.size() - 1) / dist; m_status = ready; diff --git a/deps/agg/src/agg_vcgen_dash.cpp b/deps/agg/src/agg_vcgen_dash.cpp index 311239040..6bfa5db71 100644 --- a/deps/agg/src/agg_vcgen_dash.cpp +++ b/deps/agg/src/agg_vcgen_dash.cpp @@ -169,7 +169,7 @@ unsigned vcgen_dash::vertex(double* x, double* y) { double dash_rest = m_dashes[m_curr_dash] - m_curr_dash_start; - unsigned cmd = (m_curr_dash & 1) ? + unsigned cmd2 = (m_curr_dash & 1) ? path_cmd_move_to : path_cmd_line_to; @@ -217,7 +217,7 @@ unsigned vcgen_dash::vertex(double* x, double* y) } } } - return cmd; + return cmd2; } break; diff --git a/fonts/build.py b/fonts/build.py index 1dbcacfa9..de8b21487 100644 --- a/fonts/build.py +++ b/fonts/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os import glob @@ -32,4 +32,4 @@ if not env['SYSTEM_FONTS']: target_path = env['MAPNIK_FONTS_DEST'] if 'uninstall' not in COMMAND_LINE_TARGETS: env.Alias(target='install', source=env.Install(target_path, includes)) - env['create_uninstall_target'](env, target_path) \ No newline at end of file + env['create_uninstall_target'](env, target_path) diff --git a/include/build.py b/include/build.py index 680c7f14f..9c225a767 100644 --- a/include/build.py +++ b/include/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/agg_helpers.hpp b/include/mapnik/agg_helpers.hpp index 8e2b1b2d7..139405cd9 100644 --- a/include/mapnik/agg_helpers.hpp +++ b/include/mapnik/agg_helpers.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/agg_pattern_source.hpp b/include/mapnik/agg_pattern_source.hpp index 1c5673950..a0000204f 100644 --- a/include/mapnik/agg_pattern_source.hpp +++ b/include/mapnik/agg_pattern_source.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/agg_rasterizer.hpp b/include/mapnik/agg_rasterizer.hpp index 0232f8858..51cf4cd5d 100644 --- a/include/mapnik/agg_rasterizer.hpp +++ b/include/mapnik/agg_rasterizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/agg_render_marker.hpp b/include/mapnik/agg_render_marker.hpp index bbe70a44e..65e531cfd 100644 --- a/include/mapnik/agg_render_marker.hpp +++ b/include/mapnik/agg_render_marker.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,8 @@ #include #include #include +#include +#include // agg #include "agg_color_rgba.h" @@ -70,7 +72,9 @@ void render_raster_marker(RendererType renb, RasterizerType & ras, image_rgba8 c float scale_factor, bool snap_to_pixels) { using color_type = agg::rgba8; - using pixfmt_pre = agg::pixfmt_rgba32_pre; + using const_rendering_buffer = util::rendering_buffer; + using pixfmt_pre = agg::pixfmt_alpha_blend_rgba; + agg::scanline_u8 sl; double width = src.width(); double height = src.height(); @@ -80,22 +84,22 @@ void render_raster_marker(RendererType renb, RasterizerType & ras, image_rgba8 c && (std::fabs(0.0 - tr.shx) < agg::affine_epsilon) && (std::fabs(1.0 - tr.sy) < agg::affine_epsilon)) { - agg::rendering_buffer src_buffer((unsigned char *)src.bytes(),src.width(),src.height(),src.row_size()); + const_rendering_buffer src_buffer(src); pixfmt_pre pixf_mask(src_buffer); if (snap_to_pixels) { renb.blend_from(pixf_mask, 0, - std::floor(tr.tx + .5), - std::floor(tr.ty + .5), + static_cast(std::floor(tr.tx + .5)), + static_cast(std::floor(tr.ty + .5)), unsigned(255*opacity)); } else { renb.blend_from(pixf_mask, 0, - tr.tx, - tr.ty, + static_cast(tr.tx), + static_cast(tr.ty), unsigned(255*opacity)); } } @@ -121,11 +125,8 @@ void render_raster_marker(RendererType renb, RasterizerType & ras, image_rgba8 c agg::span_allocator sa; agg::image_filter_lut filter; filter.calculate(agg::image_filter_bilinear(), true); - agg::rendering_buffer marker_buf((unsigned char *)src.bytes(), - src.width(), - src.height(), - src.row_size()); - pixfmt_pre pixf(marker_buf); + const_rendering_buffer src_buffer(src); + pixfmt_pre pixf(src_buffer); img_accessor_type ia(pixf); agg::trans_affine final_tr(p, 0, 0, width, height); if (snap_to_pixels) diff --git a/include/mapnik/agg_renderer.hpp b/include/mapnik/agg_renderer.hpp index 4f3996ba8..776632d68 100644 --- a/include/mapnik/agg_renderer.hpp +++ b/include/mapnik/agg_renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/attribute.hpp b/include/mapnik/attribute.hpp index 65b87b9dd..b0cf6839a 100644 --- a/include/mapnik/attribute.hpp +++ b/include/mapnik/attribute.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/attribute_collector.hpp b/include/mapnik/attribute_collector.hpp index 9f2e81573..878bfd4d4 100644 --- a/include/mapnik/attribute_collector.hpp +++ b/include/mapnik/attribute_collector.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -42,6 +42,9 @@ // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop @@ -274,8 +277,8 @@ inline void group_attribute_collector::operator() (group_symbolizer const& sym) } // get indexed column names - int start = get(sym, keys::start_column); - int end = start + get(sym, keys::num_columns); + value_integer start = get(sym, keys::start_column); + value_integer end = start + get(sym, keys::num_columns); for (auto const& col_name : group_columns) { if (expand_index_columns_ && col_name.find('%') != std::string::npos) @@ -286,7 +289,7 @@ inline void group_attribute_collector::operator() (group_symbolizer const& sym) if (col_name.size() > 1) { // Indexed column name. add column name for each index value. - for (int col_idx = start; col_idx < end; ++col_idx) + for (value_integer col_idx = start; col_idx < end; ++col_idx) { std::string col_idx_str; if (mapnik::util::to_string(col_idx_str,col_idx)) diff --git a/include/mapnik/attribute_descriptor.hpp b/include/mapnik/attribute_descriptor.hpp index 1656cbb15..ff9715730 100644 --- a/include/mapnik/attribute_descriptor.hpp +++ b/include/mapnik/attribute_descriptor.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/boolean.hpp b/include/mapnik/boolean.hpp index 171cbd7b8..92751b7fe 100644 --- a/include/mapnik/boolean.hpp +++ b/include/mapnik/boolean.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/box2d.hpp b/include/mapnik/box2d.hpp index e6fc2a976..4471c281c 100644 --- a/include/mapnik/box2d.hpp +++ b/include/mapnik/box2d.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/cairo/cairo_context.hpp b/include/mapnik/cairo/cairo_context.hpp index f4ca72a0a..3f065db36 100644 --- a/include/mapnik/cairo/cairo_context.hpp +++ b/include/mapnik/cairo/cairo_context.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -124,12 +124,12 @@ class cairo_pattern : private util::noncopyable public: explicit cairo_pattern(image_rgba8 const& data, double opacity = 1.0) { - int pixels = data.width() * data.height(); + std::size_t pixels = data.width() * data.height(); const unsigned int *in_ptr = data.data(); const unsigned int *in_end = in_ptr + pixels; unsigned int *out_ptr; - surface_ = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, data.width(), data.height()); + surface_ = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, static_cast(data.width()), static_cast(data.height())); out_ptr = reinterpret_cast(cairo_image_surface_get_data(surface_)); 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/cairo/cairo_render_vector.hpp b/include/mapnik/cairo/cairo_render_vector.hpp index b529a508f..37bd44925 100644 --- a/include/mapnik/cairo/cairo_render_vector.hpp +++ b/include/mapnik/cairo/cairo_render_vector.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/cairo/cairo_renderer.hpp b/include/mapnik/cairo/cairo_renderer.hpp index 0914d626a..a39b4ed9e 100644 --- a/include/mapnik/cairo/cairo_renderer.hpp +++ b/include/mapnik/cairo/cairo_renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -165,7 +165,7 @@ public: { return common_.vars_; } - + void render_marker(pixel_position const& pos, marker const& marker, agg::trans_affine const& mtx, diff --git a/include/mapnik/cairo_io.hpp b/include/mapnik/cairo_io.hpp index c808b9970..55b107286 100644 --- a/include/mapnik/cairo_io.hpp +++ b/include/mapnik/cairo_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/color.hpp b/include/mapnik/color.hpp index 84f03d539..b22a9989d 100644 --- a/include/mapnik/color.hpp +++ b/include/mapnik/color.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/color_factory.hpp b/include/mapnik/color_factory.hpp index 6bc360b95..6fdb5663c 100644 --- a/include/mapnik/color_factory.hpp +++ b/include/mapnik/color_factory.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/config.hpp b/include/mapnik/config.hpp index c96948b47..6461a6c08 100644 --- a/include/mapnik/config.hpp +++ b/include/mapnik/config.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/config_error.hpp b/include/mapnik/config_error.hpp index 2f6b3f6f4..b8bd31f67 100644 --- a/include/mapnik/config_error.hpp +++ b/include/mapnik/config_error.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/coord.hpp b/include/mapnik/coord.hpp index 040c76b88..fcdfa9090 100644 --- a/include/mapnik/coord.hpp +++ b/include/mapnik/coord.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/css_color_grammar.hpp b/include/mapnik/css_color_grammar.hpp index 7c7942d98..4403d34c9 100644 --- a/include/mapnik/css_color_grammar.hpp +++ b/include/mapnik/css_color_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,11 +26,15 @@ // mapnik #include #include +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -45,10 +49,10 @@ BOOST_FUSION_ADAPT_ADT( mapnik::color, - (unsigned, unsigned, obj.red(), obj.set_red(val)) - (unsigned, unsigned, obj.green(), obj.set_green(val)) - (unsigned, unsigned, obj.blue(), obj.set_blue(val)) - (unsigned, unsigned, obj.alpha(), obj.set_alpha(val)) + (unsigned, unsigned, obj.red(), obj.set_red(mapnik::safe_cast(val))) + (unsigned, unsigned, obj.green(), obj.set_green(mapnik::safe_cast(val))) + (unsigned, unsigned, obj.blue(), obj.set_blue(mapnik::safe_cast(val))) + (unsigned, unsigned, obj.alpha(), obj.set_alpha(mapnik::safe_cast(val))) ) namespace mapnik @@ -216,15 +220,6 @@ struct named_colors_ : qi::symbols } } ; -// clipper helper -template -inline int clip_int(int val) -{ - if (val < MIN ) return MIN; - if (val > MAX ) return MAX; - return val; -} - struct percent_conv_impl { template @@ -235,7 +230,7 @@ struct percent_conv_impl unsigned operator() (double val) const { - return clip_int<0,255>(int((255.0 * val)/100.0 + 0.5)); + return safe_cast(std::lround((255.0 * val)/100.0)); } }; @@ -249,7 +244,7 @@ struct alpha_conv_impl unsigned operator() (double val) const { - return clip_int<0,255>(int((255.0 * val) + 0.5)); + return safe_cast(std::lround((255.0 * val))); } }; @@ -284,9 +279,9 @@ struct hsl_conv_impl double g = hue_to_rgb(m1, m2, h); double b = hue_to_rgb(m1, m2, h - 1.0/3.0); - c.set_red(clip_int<0,255>(int((255.0 * r) + 0.5))); - c.set_green(clip_int<0,255>(int((255.0 * g) + 0.5))); - c.set_blue(clip_int<0,255>(int((255.0 * b) + 0.5))); + c.set_red(safe_cast(std::lround(255.0 * r))); + c.set_green(safe_cast(std::lround(255.0 * g))); + c.set_blue(safe_cast(std::lround(255.0 * b))); } }; diff --git a/include/mapnik/css_color_grammar_impl.hpp b/include/mapnik/css_color_grammar_impl.hpp index 4fe462711..4ce313435 100644 --- a/include/mapnik/css_color_grammar_impl.hpp +++ b/include/mapnik/css_color_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/datasource.hpp b/include/mapnik/datasource.hpp index 0cb9a59b2..ec14a621c 100644 --- a/include/mapnik/datasource.hpp +++ b/include/mapnik/datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/datasource_cache.hpp b/include/mapnik/datasource_cache.hpp index 67aec76a1..bf951e7f7 100644 --- a/include/mapnik/datasource_cache.hpp +++ b/include/mapnik/datasource_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/debug.hpp b/include/mapnik/debug.hpp index 6f24e4365..aaccb4fb7 100644 --- a/include/mapnik/debug.hpp +++ b/include/mapnik/debug.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/ellipsoid.hpp b/include/mapnik/ellipsoid.hpp index e1be68ca3..6f872d4d4 100644 --- a/include/mapnik/ellipsoid.hpp +++ b/include/mapnik/ellipsoid.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/enumeration.hpp b/include/mapnik/enumeration.hpp index 12f3dad72..c0cfe1e8a 100644 --- a/include/mapnik/enumeration.hpp +++ b/include/mapnik/enumeration.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/evaluate_global_attributes.hpp b/include/mapnik/evaluate_global_attributes.hpp index 63f0348a4..3e3d63cbd 100644 --- a/include/mapnik/evaluate_global_attributes.hpp +++ b/include/mapnik/evaluate_global_attributes.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/expression.hpp b/include/mapnik/expression.hpp index 88945074a..7b9ca59e7 100644 --- a/include/mapnik/expression.hpp +++ b/include/mapnik/expression.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/expression_evaluator.hpp b/include/mapnik/expression_evaluator.hpp index 1d37bdecc..6ac0451ef 100644 --- a/include/mapnik/expression_evaluator.hpp +++ b/include/mapnik/expression_evaluator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/expression_grammar.hpp b/include/mapnik/expression_grammar.hpp index 3dd5fc410..7a71976a7 100644 --- a/include/mapnik/expression_grammar.hpp +++ b/include/mapnik/expression_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,6 +34,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/expression_grammar_impl.hpp b/include/mapnik/expression_grammar_impl.hpp index a4d8353b0..d123b3bae 100644 --- a/include/mapnik/expression_grammar_impl.hpp +++ b/include/mapnik/expression_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/expression_node.hpp b/include/mapnik/expression_node.hpp index ea161f094..7731414a4 100644 --- a/include/mapnik/expression_node.hpp +++ b/include/mapnik/expression_node.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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/expression_node_types.hpp b/include/mapnik/expression_node_types.hpp index 86d12b2bc..371274a4e 100644 --- a/include/mapnik/expression_node_types.hpp +++ b/include/mapnik/expression_node_types.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/expression_string.hpp b/include/mapnik/expression_string.hpp index afb6331ca..6efc07e81 100644 --- a/include/mapnik/expression_string.hpp +++ b/include/mapnik/expression_string.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/factory.hpp b/include/mapnik/factory.hpp index 68d7ea110..81f261320 100644 --- a/include/mapnik/factory.hpp +++ b/include/mapnik/factory.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index 42bc5add0..eb084bc0c 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_factory.hpp b/include/mapnik/feature_factory.hpp index 57ed6dc6d..c4a4d560e 100644 --- a/include/mapnik/feature_factory.hpp +++ b/include/mapnik/feature_factory.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_kv_iterator.hpp b/include/mapnik/feature_kv_iterator.hpp index 5d9b93a9b..37093a897 100644 --- a/include/mapnik/feature_kv_iterator.hpp +++ b/include/mapnik/feature_kv_iterator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_layer_desc.hpp b/include/mapnik/feature_layer_desc.hpp index 7dd1293f7..c89d944cb 100644 --- a/include/mapnik/feature_layer_desc.hpp +++ b/include/mapnik/feature_layer_desc.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_style_processor.hpp b/include/mapnik/feature_style_processor.hpp index cc36c01e6..062c9d666 100644 --- a/include/mapnik/feature_style_processor.hpp +++ b/include/mapnik/feature_style_processor.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_style_processor_context.hpp b/include/mapnik/feature_style_processor_context.hpp index 585c746ef..aca0c8f72 100644 --- a/include/mapnik/feature_style_processor_context.hpp +++ b/include/mapnik/feature_style_processor_context.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/feature_style_processor_impl.hpp b/include/mapnik/feature_style_processor_impl.hpp index d20e6a501..0c7782198 100644 --- a/include/mapnik/feature_style_processor_impl.hpp +++ b/include/mapnik/feature_style_processor_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -224,7 +224,7 @@ void feature_style_processor::prepare_layer(layer_rendering_material std::vector const& style_names = lay.styles(); - unsigned int num_styles = style_names.size(); + std::size_t num_styles = style_names.size(); if (num_styles == 0) { MAPNIK_LOG_DEBUG(feature_style_processor) diff --git a/include/mapnik/feature_type_style.hpp b/include/mapnik/feature_type_style.hpp index 0f0d839fb..68240af3a 100644 --- a/include/mapnik/feature_type_style.hpp +++ b/include/mapnik/feature_type_style.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/featureset.hpp b/include/mapnik/featureset.hpp index e23532a4f..c6829d1eb 100644 --- a/include/mapnik/featureset.hpp +++ b/include/mapnik/featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/filter_featureset.hpp b/include/mapnik/filter_featureset.hpp index b70462556..ee3fa4087 100644 --- a/include/mapnik/filter_featureset.hpp +++ b/include/mapnik/filter_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/font_engine_freetype.hpp b/include/mapnik/font_engine_freetype.hpp index 78dc055d5..33ac45035 100644 --- a/include/mapnik/font_engine_freetype.hpp +++ b/include/mapnik/font_engine_freetype.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/font_set.hpp b/include/mapnik/font_set.hpp index 8803c99eb..5df8e35df 100644 --- a/include/mapnik/font_set.hpp +++ b/include/mapnik/font_set.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/function_call.hpp b/include/mapnik/function_call.hpp index 5453d92af..efbaa5f28 100644 --- a/include/mapnik/function_call.hpp +++ b/include/mapnik/function_call.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/geom_util.hpp b/include/mapnik/geom_util.hpp index e6ad12e6e..7dbe51ff4 100644 --- a/include/mapnik/geom_util.hpp +++ b/include/mapnik/geom_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/geometry_adapters.hpp b/include/mapnik/geometry_adapters.hpp index 93076a82b..0c7a65713 100644 --- a/include/mapnik/geometry_adapters.hpp +++ b/include/mapnik/geometry_adapters.hpp @@ -28,6 +28,10 @@ // 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" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wunused-parameter" #undef B0 #include #include diff --git a/include/mapnik/geometry_centroid.hpp b/include/mapnik/geometry_centroid.hpp index 2e7dec199..71d0c0754 100644 --- a/include/mapnik/geometry_centroid.hpp +++ b/include/mapnik/geometry_centroid.hpp @@ -50,7 +50,7 @@ struct geometry_centroid return false; } - result_type operator() (geometry_collection const& collection) const + result_type operator() (geometry_collection const&) const { return false; } diff --git a/include/mapnik/geometry_correct.hpp b/include/mapnik/geometry_correct.hpp index 8698c129a..dcbb2d7ab 100644 --- a/include/mapnik/geometry_correct.hpp +++ b/include/mapnik/geometry_correct.hpp @@ -31,6 +31,9 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop @@ -72,7 +75,7 @@ struct geometry_correct } template - result_type operator() (T & geom) const + result_type operator() (T &) const { //no-op } diff --git a/include/mapnik/geometry_reprojection.hpp b/include/mapnik/geometry_reprojection.hpp index 83a429ae2..22a334e61 100644 --- a/include/mapnik/geometry_reprojection.hpp +++ b/include/mapnik/geometry_reprojection.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/geometry_reprojection_impl.hpp b/include/mapnik/geometry_reprojection_impl.hpp index 1e8297ba5..7e78635e4 100644 --- a/include/mapnik/geometry_reprojection_impl.hpp +++ b/include/mapnik/geometry_reprojection_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -195,7 +195,7 @@ struct geom_reproj_copy_visitor { geometry operator() (line_string const& ls) { geometry geom; // default empty - int intial_err = n_err_; + unsigned int intial_err = n_err_; line_string new_ls = reproject_internal(ls, proj_trans_, n_err_); if (n_err_ > intial_err || new_ls.empty()) return geom; geom = std::move(new_ls); diff --git a/include/mapnik/global.hpp b/include/mapnik/global.hpp index 4526f052c..aa5be35f5 100644 --- a/include/mapnik/global.hpp +++ b/include/mapnik/global.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/gradient.hpp b/include/mapnik/gradient.hpp index a7e628a56..eb70be4c2 100644 --- a/include/mapnik/gradient.hpp +++ b/include/mapnik/gradient.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid.hpp b/include/mapnik/grid/grid.hpp index a00479e93..ab79cdd2a 100644 --- a/include/mapnik/grid/grid.hpp +++ b/include/mapnik/grid/grid.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,7 @@ #include #include #include +#include // stl #include @@ -191,12 +192,16 @@ public: if (ext0.intersects(ext1)) { box2d box = ext0.intersect(ext1); - for (std::size_t y = box.miny(); y < box.maxy(); ++y) + std::size_t miny = safe_cast(box.miny()); + std::size_t maxy = safe_cast(box.maxy()); + std::size_t minx = safe_cast(box.minx()); + std::size_t maxx = safe_cast(box.maxx()); + for (std::size_t y = miny; y < maxy; ++y) { value_type* row_to = data_.get_row(y); image_rgba8::pixel_type const * row_from = data.get_row(y - y0); - for (std::size_t x = box.minx(); x < box.maxx(); ++x) + for (std::size_t x = minx; x < maxx; ++x) { image_rgba8::pixel_type rgba = row_from[x - x0]; unsigned a = (rgba >> 24) & 0xff; diff --git a/include/mapnik/grid/grid_pixel.hpp b/include/mapnik/grid/grid_pixel.hpp index 5ef1c78bd..fda65779a 100644 --- a/include/mapnik/grid/grid_pixel.hpp +++ b/include/mapnik/grid/grid_pixel.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid_pixfmt.hpp b/include/mapnik/grid/grid_pixfmt.hpp index 6f61b9933..a26a936c9 100644 --- a/include/mapnik/grid/grid_pixfmt.hpp +++ b/include/mapnik/grid/grid_pixfmt.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,9 +24,15 @@ #define MAPNIK_GRID_PIXFMT_HPP #include +#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include "agg_basics.h" #include -#include +#pragma GCC diagnostic pop namespace mapnik { diff --git a/include/mapnik/grid/grid_rasterizer.hpp b/include/mapnik/grid/grid_rasterizer.hpp index cd7381384..98a6dd31f 100644 --- a/include/mapnik/grid/grid_rasterizer.hpp +++ b/include/mapnik/grid/grid_rasterizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid_render_marker.hpp b/include/mapnik/grid/grid_render_marker.hpp index 79c5ec097..8f345e301 100644 --- a/include/mapnik/grid/grid_render_marker.hpp +++ b/include/mapnik/grid/grid_render_marker.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2012 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid_renderer.hpp b/include/mapnik/grid/grid_renderer.hpp index 2db770984..cc689e308 100644 --- a/include/mapnik/grid/grid_renderer.hpp +++ b/include/mapnik/grid/grid_renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid_renderer_base.hpp b/include/mapnik/grid/grid_renderer_base.hpp index 9524b1661..462010b6a 100644 --- a/include/mapnik/grid/grid_renderer_base.hpp +++ b/include/mapnik/grid/grid_renderer_base.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,9 +23,14 @@ #ifndef MAPNIK_GRID_RENDERER_BASE_HPP #define MAPNIK_GRID_RENDERER_BASE_HPP +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include "agg_renderer_base.h" -#include #include +#pragma GCC diagnostic pop +#include namespace mapnik { diff --git a/include/mapnik/grid/grid_rendering_buffer.hpp b/include/mapnik/grid/grid_rendering_buffer.hpp index d5031c826..4282e3bb9 100644 --- a/include/mapnik/grid/grid_rendering_buffer.hpp +++ b/include/mapnik/grid/grid_rendering_buffer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid_util.hpp b/include/mapnik/grid/grid_util.hpp index 28d979715..826d2e15d 100644 --- a/include/mapnik/grid/grid_util.hpp +++ b/include/mapnik/grid/grid_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/grid/grid_view.hpp b/include/mapnik/grid/grid_view.hpp index f161eaa4d..80c539f53 100644 --- a/include/mapnik/grid/grid_view.hpp +++ b/include/mapnik/grid/grid_view.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/group/group_layout.hpp b/include/mapnik/group/group_layout.hpp index 2087b0b6c..23811e800 100644 --- a/include/mapnik/group/group_layout.hpp +++ b/include/mapnik/group/group_layout.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/group/group_layout_manager.hpp b/include/mapnik/group/group_layout_manager.hpp index 89acf5338..38ee30b5d 100644 --- a/include/mapnik/group/group_layout_manager.hpp +++ b/include/mapnik/group/group_layout_manager.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/group/group_rule.hpp b/include/mapnik/group/group_rule.hpp index a0442ce10..58f8505b4 100644 --- a/include/mapnik/group/group_rule.hpp +++ b/include/mapnik/group/group_rule.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/group/group_symbolizer_helper.hpp b/include/mapnik/group/group_symbolizer_helper.hpp index b32c9ec10..93c7d4f3f 100644 --- a/include/mapnik/group/group_symbolizer_helper.hpp +++ b/include/mapnik/group/group_symbolizer_helper.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/group/group_symbolizer_properties.hpp b/include/mapnik/group/group_symbolizer_properties.hpp index fce169431..f5967b8be 100644 --- a/include/mapnik/group/group_symbolizer_properties.hpp +++ b/include/mapnik/group/group_symbolizer_properties.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/hextree.hpp b/include/mapnik/hextree.hpp index d98f9e2f1..466462404 100644 --- a/include/mapnik/hextree.hpp +++ b/include/mapnik/hextree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/hit_test_filter.hpp b/include/mapnik/hit_test_filter.hpp index d81a9497b..d4b850496 100644 --- a/include/mapnik/hit_test_filter.hpp +++ b/include/mapnik/hit_test_filter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image.hpp b/include/mapnik/image.hpp index 7567bfc9c..ec8b1f88a 100644 --- a/include/mapnik/image.hpp +++ b/include/mapnik/image.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_any.hpp b/include/mapnik/image_any.hpp index 2fdac7d30..c14d5dd49 100644 --- a/include/mapnik/image_any.hpp +++ b/include/mapnik/image_any.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_compositing.hpp b/include/mapnik/image_compositing.hpp index c3fce8be7..2967be780 100644 --- a/include/mapnik/image_compositing.hpp +++ b/include/mapnik/image_compositing.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_copy.hpp b/include/mapnik/image_copy.hpp index 62e2ab215..8f40ef40a 100644 --- a/include/mapnik/image_copy.hpp +++ b/include/mapnik/image_copy.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_filter.hpp b/include/mapnik/image_filter.hpp index eef8141b2..37c332786 100644 --- a/include/mapnik/image_filter.hpp +++ b/include/mapnik/image_filter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #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" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop @@ -251,10 +254,10 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi typename Src::x_iterator dst_it = dst_view.row_begin(0); // top row - for (int x = 0 ; x < src_view.width(); ++x) + for (std::size_t x = 0 ; x < static_cast(src_view.width()); ++x) { (*dst_it)[3] = src_loc[loc11][3]; // Dst.a = Src.a - for (int i = 0; i < 3; ++i) + for (std::size_t i = 0; i < 3; ++i) { bits32f p[9]; @@ -272,7 +275,7 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi p[6] = src_loc[loc02][i]; } - if ( x == src_view.width()-1) + if ( x == static_cast(src_view.width())-1) { p[5] = p[4]; p[8] = p[7]; @@ -293,15 +296,15 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi ++dst_it; } // carrige-return - src_loc += point2(-src_view.width(),1); + src_loc += point2(-static_cast(src_view.width()),1); // 1... height-1 rows - for (int y = 1; y(src_view.height())-1; ++y) { - for (int x = 0; x < src_view.width(); ++x) + for (std::size_t x = 0; x < static_cast(src_view.width()); ++x) { (*dst_it)[3] = src_loc[loc11][3]; // Dst.a = Src.a - for (int i = 0; i < 3; ++i) + for (std::size_t i = 0; i < 3; ++i) { bits32f p[9]; @@ -322,7 +325,7 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi p[6] = src_loc[loc02][i]; } - if ( x == src_view.width() - 1) + if ( x == static_cast(src_view.width()) - 1) { p[2] = p[1]; p[5] = p[4]; @@ -340,15 +343,15 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi ++src_loc.x(); } // carrige-return - src_loc += point2(-src_view.width(),1); + src_loc += point2(-static_cast(src_view.width()),1); } // bottom row - //src_loc = src_view.xy_at(0,src_view.height()-1); - for (int x = 0 ; x < src_view.width(); ++x) + //src_loc = src_view.xy_at(0,static_cast(src_view.height())-1); + for (std::size_t x = 0 ; x < static_cast(src_view.width()); ++x) { (*dst_it)[3] = src_loc[loc11][3]; // Dst.a = Src.a - for (int i = 0; i < 3; ++i) + for (std::size_t i = 0; i < 3; ++i) { bits32f p[9]; @@ -366,7 +369,7 @@ void apply_convolution_3x3(Src const& src_view, Dst & dst_view, Filter const& fi p[3] = src_loc[loc01][i]; } - if ( x == src_view.width()-1) + if ( x == static_cast(src_view.width())-1) { p[2] = p[1]; p[5] = p[4]; @@ -428,10 +431,10 @@ void apply_filter(Src & src, color_to_alpha const& op) double cr = static_cast(op.color.red())/255.0; double cg = static_cast(op.color.green())/255.0; double cb = static_cast(op.color.blue())/255.0; - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { uint8_t & r = get_color(src_it[x], red_t()); uint8_t & g = get_color(src_it[x], green_t()); @@ -489,10 +492,10 @@ void apply_filter(Src & src, colorize_alpha const& op) mapnik::filter::color_stop const& stop = op[0]; mapnik::color const& c = stop.color; rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { uint8_t & r = get_color(src_it[x], red_t()); uint8_t & g = get_color(src_it[x], green_t()); @@ -530,10 +533,10 @@ void apply_filter(Src & src, colorize_alpha const& op) if (grad_lut.build_lut()) { rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { uint8_t & r = get_color(src_it[x], red_t()); uint8_t & g = get_color(src_it[x], green_t()); @@ -595,10 +598,10 @@ void apply_filter(Src & src, scale_hsla const& transform) if (tinting || set_alpha) { rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { uint8_t & r = get_color(src_it[x], red_t()); uint8_t & g = get_color(src_it[x], green_t()); @@ -678,10 +681,10 @@ void apply_filter(Src & src, gray const& /*op*/) rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { // formula taken from boost/gil/color_convert.hpp:rgb_to_luminance uint8_t & r = get_color(src_it[x], red_t()); @@ -696,22 +699,22 @@ void apply_filter(Src & src, gray const& /*op*/) template void x_gradient_impl(Src const& src_view, Dst const& dst_view) { - for (int y=0; y(src_view.height()); ++y) { - typename Src::x_iterator src_it = src_view.row_begin(y); - typename Dst::x_iterator dst_it = dst_view.row_begin(y); + typename Src::x_iterator src_it = src_view.row_begin(static_cast(y)); + typename Dst::x_iterator dst_it = dst_view.row_begin(static_cast(y)); dst_it[0][0] = 128 + (src_it[0][0] - src_it[1][0]) / 2; dst_it[0][1] = 128 + (src_it[0][1] - src_it[1][1]) / 2; dst_it[0][2] = 128 + (src_it[0][2] - src_it[1][2]) / 2; - dst_it[dst_view.width()-1][0] = 128 + (src_it[src_view.width()-2][0] - src_it[src_view.width()-1][0]) / 2; - dst_it[dst_view.width()-1][1] = 128 + (src_it[src_view.width()-2][1] - src_it[src_view.width()-1][1]) / 2; - dst_it[dst_view.width()-1][2] = 128 + (src_it[src_view.width()-2][2] - src_it[src_view.width()-1][2]) / 2; + dst_it[dst_view.width()-1][0] = 128 + (src_it[static_cast(src_view.width())-2][0] - src_it[static_cast(src_view.width())-1][0]) / 2; + dst_it[dst_view.width()-1][1] = 128 + (src_it[static_cast(src_view.width())-2][1] - src_it[static_cast(src_view.width())-1][1]) / 2; + dst_it[dst_view.width()-1][2] = 128 + (src_it[static_cast(src_view.width())-2][2] - src_it[static_cast(src_view.width())-1][2]) / 2; - dst_it[0][3] = dst_it[src_view.width()-1][3] = 255; + dst_it[0][3] = dst_it[static_cast(src_view.width())-1][3] = 255; - for (int x=1; x(src_view.width())-1; ++x) { dst_it[x][0] = 128 + (src_it[x-1][0] - src_it[x+1][0]) / 2; dst_it[x][1] = 128 + (src_it[x-1][1] - src_it[x+1][1]) / 2; @@ -743,10 +746,10 @@ void apply_filter(Src & src, invert const& /*op*/) rgba8_view_t src_view = rgba8_view(src); - for (int y=0; y(src_view.height()); ++y) { - rgba8_view_t::x_iterator src_it = src_view.row_begin(y); - for (int x=0; x(y)); + for (std::size_t x=0; x(src_view.width()); ++x) { // we only work with premultiplied source, // thus all color values must be <= alpha diff --git a/include/mapnik/image_filter_grammar.hpp b/include/mapnik/image_filter_grammar.hpp index a7c0bd90c..5f2d719bd 100644 --- a/include/mapnik/image_filter_grammar.hpp +++ b/include/mapnik/image_filter_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/image_filter_grammar_impl.hpp b/include/mapnik/image_filter_grammar_impl.hpp index c88089f90..a9f11d823 100644 --- a/include/mapnik/image_filter_grammar_impl.hpp +++ b/include/mapnik/image_filter_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,10 @@ #include // spirit +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #include +#pragma GCC diagnostic pop namespace mapnik { diff --git a/include/mapnik/image_filter_types.hpp b/include/mapnik/image_filter_types.hpp index e4c9df03b..5d61d1d3f 100644 --- a/include/mapnik/image_filter_types.hpp +++ b/include/mapnik/image_filter_types.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_impl.hpp b/include/mapnik/image_impl.hpp index f4815b7b9..5a84f9e85 100644 --- a/include/mapnik/image_impl.hpp +++ b/include/mapnik/image_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_null.hpp b/include/mapnik/image_null.hpp index 285a57910..c318c766c 100644 --- a/include/mapnik/image_null.hpp +++ b/include/mapnik/image_null.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -42,34 +42,34 @@ public: private: public: image() {} - image(int width, - int height, - bool initialize = true, - bool premultiplied = false, - bool painted = false) {} - image(image const& rhs) {} - image(image && rhs) noexcept {} - image& operator=(image rhs) { return *this; } + image(int /*width*/, + int /*height*/, + bool /*initialize*/ = true, + bool /*premultiplied*/ = false, + bool /*painted*/ = false) {} + image(image const&) {} + image(image &&) noexcept {} + image& operator=(image) { return *this; } imageconst& operator=(image const& rhs) const { return rhs; } - bool operator==(image const& rhs) const { return true; } - bool operator<(image const& rhs) const { return false; } + bool operator==(image const&) const { return true; } + bool operator<(image const&) const { return false; } std::size_t width() const { return 0; } std::size_t height() const { return 0; } std::size_t size() const { return 0; } std::size_t row_size() const { return 0; } - void set(pixel_type const& t) { throw std::runtime_error("Can not set values for null image"); } - pixel_type& operator() (std::size_t i, std::size_t j) { throw std::runtime_error("Can not get or set values for null image"); } - pixel_type const& operator() (std::size_t i, std::size_t j) const { throw std::runtime_error("Can not get or set values for null image"); } + void set(pixel_type const&) { throw std::runtime_error("Can not set values for null image"); } + pixel_type& operator() (std::size_t, std::size_t) { throw std::runtime_error("Can not get or set values for null image"); } + pixel_type const& operator() (std::size_t, std::size_t) const { throw std::runtime_error("Can not get or set values for null image"); } unsigned const char* bytes() const { return nullptr; } unsigned char* bytes() {return nullptr; } double get_offset() const { return 0.0; } - void set_offset(double set) {} + void set_offset(double) {} double get_scaling() const { return 1.0; } - void set_scaling(double set) {} + void set_scaling(double) {} bool get_premultiplied() const { return false; } - void set_premultiplied(bool set) {} - void painted(bool painted) {} + void set_premultiplied(bool) {} + void painted(bool) {} bool painted() const { return false; } image_dtype get_dtype() const { return dtype; } }; diff --git a/include/mapnik/image_reader.hpp b/include/mapnik/image_reader.hpp index 471a08b58..a15d7c9dd 100644 --- a/include/mapnik/image_reader.hpp +++ b/include/mapnik/image_reader.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_scaling.hpp b/include/mapnik/image_scaling.hpp index 0dd94c9a6..ad4954eb1 100644 --- a/include/mapnik/image_scaling.hpp +++ b/include/mapnik/image_scaling.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_scaling_traits.hpp b/include/mapnik/image_scaling_traits.hpp index 9b783062c..e2d0220ff 100644 --- a/include/mapnik/image_scaling_traits.hpp +++ b/include/mapnik/image_scaling_traits.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_util.hpp b/include/mapnik/image_util.hpp index 7185d6478..1207bb80b 100644 --- a/include/mapnik/image_util.hpp +++ b/include/mapnik/image_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop @@ -195,12 +198,6 @@ MAPNIK_DECL void fill (image & data, T const&); template MAPNIK_DECL void fill (image & data, T const&); -// SET RECTANGLE -MAPNIK_DECL void set_rectangle (image_any & dst, image_any const& src, int x = 0, int y = 0); - -template -MAPNIK_DECL void set_rectangle (T & dst, T const& src, int x = 0, int y = 0); - // CHECK BOUNDS template inline bool check_bounds (T const& data, std::size_t x, std::size_t y) diff --git a/include/mapnik/image_util_jpeg.hpp b/include/mapnik/image_util_jpeg.hpp index 5f77f56f0..b4d2648db 100644 --- a/include/mapnik/image_util_jpeg.hpp +++ b/include/mapnik/image_util_jpeg.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_util_png.hpp b/include/mapnik/image_util_png.hpp index 06dcde894..e02cb4427 100644 --- a/include/mapnik/image_util_png.hpp +++ b/include/mapnik/image_util_png.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,7 +37,7 @@ struct png_saver_pal private: std::ostream & stream_; std::string const& t_; - rgba_palette const& pal_; + rgba_palette const& pal_; }; struct png_saver diff --git a/include/mapnik/image_util_tiff.hpp b/include/mapnik/image_util_tiff.hpp index 5cacc6781..39b524d88 100644 --- a/include/mapnik/image_util_tiff.hpp +++ b/include/mapnik/image_util_tiff.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_util_webp.hpp b/include/mapnik/image_util_webp.hpp index 14a218309..6d28138de 100644 --- a/include/mapnik/image_util_webp.hpp +++ b/include/mapnik/image_util_webp.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_view.hpp b/include/mapnik/image_view.hpp index 302cd4034..c2f023a30 100644 --- a/include/mapnik/image_view.hpp +++ b/include/mapnik/image_view.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_view_any.hpp b/include/mapnik/image_view_any.hpp index 6ce0fe5cd..f61e33db5 100644 --- a/include/mapnik/image_view_any.hpp +++ b/include/mapnik/image_view_any.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_view_impl.hpp b/include/mapnik/image_view_impl.hpp index 6fc85179b..89ae15182 100644 --- a/include/mapnik/image_view_impl.hpp +++ b/include/mapnik/image_view_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/image_view_null.hpp b/include/mapnik/image_view_null.hpp index 1ad6c3d04..5672c05dd 100644 --- a/include/mapnik/image_view_null.hpp +++ b/include/mapnik/image_view_null.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,20 +40,20 @@ public: image_view() {} ~image_view() {}; - image_view(image_view const& rhs) {} - image_view & operator=(image_view const& rhs) { return *this; } - bool operator==(image_view const& rhs) const { return true; } - bool operator<(image_view const& rhs) const { return false; } + image_view(image_view const&) {} + image_view & operator=(image_view const&) { return *this; } + bool operator==(image_view const&) const { return true; } + bool operator<(image_view const&) const { return false; } std::size_t x() const { return 0; } std::size_t y() const { return 0; } std::size_t width() const { return 0; } std::size_t height() const { return 0; } - pixel_type operator() (std::size_t i, std::size_t j) const { throw std::runtime_error("Can not get from a null image view"); } + pixel_type operator() (std::size_t, std::size_t) const { throw std::runtime_error("Can not get from a null image view"); } std::size_t size() const { return 0; } std::size_t row_size() const { return 0; } - const pixel_type* get_row(std::size_t row) const { return nullptr; } - const pixel_type* get_row(std::size_t row, std::size_t x0) const { return nullptr; } + const pixel_type* get_row(std::size_t) const { return nullptr; } + const pixel_type* get_row(std::size_t, std::size_t) const { return nullptr; } bool get_premultiplied() const { return false; } double get_offset() const { return 0.0; } double get_scaling() const { return 1.0; } diff --git a/include/mapnik/jpeg_io.hpp b/include/mapnik/jpeg_io.hpp index 2c3c28434..06a0bc319 100644 --- a/include/mapnik/jpeg_io.hpp +++ b/include/mapnik/jpeg_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/error_handler.hpp b/include/mapnik/json/error_handler.hpp index 74b0aa48d..2f38f6245 100644 --- a/include/mapnik/json/error_handler.hpp +++ b/include/mapnik/json/error_handler.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,7 +25,10 @@ #include #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #include +#pragma GCC diagnostic pop namespace mapnik { namespace json { diff --git a/include/mapnik/json/extract_bounding_box_grammar.hpp b/include/mapnik/json/extract_bounding_box_grammar.hpp index 0cc37336a..2183fe501 100644 --- a/include/mapnik/json/extract_bounding_box_grammar.hpp +++ b/include/mapnik/json/extract_bounding_box_grammar.hpp @@ -32,6 +32,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/json/feature_collection_grammar.hpp b/include/mapnik/json/feature_collection_grammar.hpp index 2089cfe0d..5c13f8c7c 100644 --- a/include/mapnik/json/feature_collection_grammar.hpp +++ b/include/mapnik/json/feature_collection_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/feature_collection_grammar_impl.hpp b/include/mapnik/json/feature_collection_grammar_impl.hpp index 0275b47c1..8f7391896 100644 --- a/include/mapnik/json/feature_collection_grammar_impl.hpp +++ b/include/mapnik/json/feature_collection_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/feature_generator.hpp b/include/mapnik/json/feature_generator.hpp index 0d3fcb847..f24df4ed8 100644 --- a/include/mapnik/json/feature_generator.hpp +++ b/include/mapnik/json/feature_generator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/feature_generator_grammar.hpp b/include/mapnik/json/feature_generator_grammar.hpp index 3852c7ba6..9eaa3bb99 100644 --- a/include/mapnik/json/feature_generator_grammar.hpp +++ b/include/mapnik/json/feature_generator_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -84,8 +84,8 @@ template struct get_id { using feature_type = T; - using result_type = int; - int operator() (feature_type const& f) const + using result_type = mapnik::value_integer; + result_type operator() (feature_type const& f) const { return f.id(); } diff --git a/include/mapnik/json/feature_generator_grammar_impl.hpp b/include/mapnik/json/feature_generator_grammar_impl.hpp index 7147bd892..f819baa80 100644 --- a/include/mapnik/json/feature_generator_grammar_impl.hpp +++ b/include/mapnik/json/feature_generator_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/feature_grammar.hpp b/include/mapnik/json/feature_grammar.hpp index 08eb39df1..59261d707 100644 --- a/include/mapnik/json/feature_grammar.hpp +++ b/include/mapnik/json/feature_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,10 +31,13 @@ #include #include #include -// spirit::qi + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include #include +#pragma GCC diagnostic pop namespace mapnik { namespace json { diff --git a/include/mapnik/json/feature_grammar_impl.hpp b/include/mapnik/json/feature_grammar_impl.hpp index c7f50bbe9..409925a38 100644 --- a/include/mapnik/json/feature_grammar_impl.hpp +++ b/include/mapnik/json/feature_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/feature_parser.hpp b/include/mapnik/json/feature_parser.hpp index 3e5b2b32b..433d19e30 100644 --- a/include/mapnik/json/feature_parser.hpp +++ b/include/mapnik/json/feature_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/generic_json.hpp b/include/mapnik/json/generic_json.hpp index 16124adbc..adc199041 100644 --- a/include/mapnik/json/generic_json.hpp +++ b/include/mapnik/json/generic_json.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #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..01b631804 100644 --- a/include/mapnik/json/geometry_generator_grammar.hpp +++ b/include/mapnik/json/geometry_generator_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,6 +32,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include // for vc++ and android whose c++11 libs lack std::trunc diff --git a/include/mapnik/json/geometry_grammar.hpp b/include/mapnik/json/geometry_grammar.hpp index 2414557f6..4bc25c967 100644 --- a/include/mapnik/json/geometry_grammar.hpp +++ b/include/mapnik/json/geometry_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/geometry_grammar_impl.hpp b/include/mapnik/json/geometry_grammar_impl.hpp index 71188a7f3..9fa7df98e 100644 --- a/include/mapnik/json/geometry_grammar_impl.hpp +++ b/include/mapnik/json/geometry_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/geometry_parser.hpp b/include/mapnik/json/geometry_parser.hpp index 941abb0c7..c83901d32 100644 --- a/include/mapnik/json/geometry_parser.hpp +++ b/include/mapnik/json/geometry_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/geometry_util.hpp b/include/mapnik/json/geometry_util.hpp index 36c417531..6e8fb6794 100644 --- a/include/mapnik/json/geometry_util.hpp +++ b/include/mapnik/json/geometry_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/positions_grammar.hpp b/include/mapnik/json/positions_grammar.hpp index 2a70306ef..b7d65d027 100644 --- a/include/mapnik/json/positions_grammar.hpp +++ b/include/mapnik/json/positions_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/json/positions_grammar_impl.hpp b/include/mapnik/json/positions_grammar_impl.hpp index d90843c0d..7737e46b5 100644 --- a/include/mapnik/json/positions_grammar_impl.hpp +++ b/include/mapnik/json/positions_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/properties_generator_grammar.hpp b/include/mapnik/json/properties_generator_grammar.hpp index e52b55ed4..781d807ea 100644 --- a/include/mapnik/json/properties_generator_grammar.hpp +++ b/include/mapnik/json/properties_generator_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,6 +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" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -37,6 +43,7 @@ #include #include #include +#pragma GCC diagnostic pop namespace mapnik { namespace json { diff --git a/include/mapnik/json/properties_generator_grammar_impl.hpp b/include/mapnik/json/properties_generator_grammar_impl.hpp index 197f00026..eff4565b5 100644 --- a/include/mapnik/json/properties_generator_grammar_impl.hpp +++ b/include/mapnik/json/properties_generator_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/symbolizer_grammar.hpp b/include/mapnik/json/symbolizer_grammar.hpp index bd34af0bd..494b81f96 100644 --- a/include/mapnik/json/symbolizer_grammar.hpp +++ b/include/mapnik/json/symbolizer_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/topojson_grammar.hpp b/include/mapnik/json/topojson_grammar.hpp index e3db0990d..1cc967e01 100644 --- a/include/mapnik/json/topojson_grammar.hpp +++ b/include/mapnik/json/topojson_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/json/topojson_grammar_impl.hpp b/include/mapnik/json/topojson_grammar_impl.hpp index d939d4be8..f20fbf935 100644 --- a/include/mapnik/json/topojson_grammar_impl.hpp +++ b/include/mapnik/json/topojson_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/json/topojson_utils.hpp b/include/mapnik/json/topojson_utils.hpp index 905521874..5558bde97 100644 --- a/include/mapnik/json/topojson_utils.hpp +++ b/include/mapnik/json/topojson_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -83,7 +83,7 @@ struct bounding_box_visitor { index_type index = line.ring; index_type arc_index = index < 0 ? std::abs(index) - 1 : index; - if (arc_index < num_arcs_) + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { bool first = true; double px = 0, py = 0; @@ -121,7 +121,7 @@ struct bounding_box_visitor for (auto index : multi_line.rings) { index_type arc_index = index < 0 ? std::abs(index) - 1 : index; - if (arc_index < num_arcs_) + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { double px = 0, py = 0; auto const& arcs = topo_.arcs[arc_index]; @@ -161,7 +161,7 @@ struct bounding_box_visitor for (auto index : ring) { index_type arc_index = index < 0 ? std::abs(index) - 1 : index; - if (arc_index < num_arcs_) + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { double px = 0, py = 0; auto const& arcs = topo_.arcs[arc_index]; @@ -206,7 +206,7 @@ struct bounding_box_visitor for (auto index : ring) { index_type arc_index = index < 0 ? std::abs(index) - 1 : index; - if (arc_index < num_arcs_) + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { double px = 0, py = 0; auto const& arcs = topo_.arcs[arc_index]; diff --git a/include/mapnik/json/topology.hpp b/include/mapnik/json/topology.hpp index 12e0f9a83..3cfc2d322 100644 --- a/include/mapnik/json/topology.hpp +++ b/include/mapnik/json/topology.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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/json/value_converters.hpp b/include/mapnik/json/value_converters.hpp index 9bbc24e24..384ecb88c 100644 --- a/include/mapnik/json/value_converters.hpp +++ b/include/mapnik/json/value_converters.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/label_collision_detector.hpp b/include/mapnik/label_collision_detector.hpp index a33747b90..53c2ae7cc 100644 --- a/include/mapnik/label_collision_detector.hpp +++ b/include/mapnik/label_collision_detector.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/layer.hpp b/include/mapnik/layer.hpp index 4b4e9f87c..a00b4885f 100644 --- a/include/mapnik/layer.hpp +++ b/include/mapnik/layer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/load_map.hpp b/include/mapnik/load_map.hpp index 5696a9e8f..30a04eb07 100644 --- a/include/mapnik/load_map.hpp +++ b/include/mapnik/load_map.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/make_unique.hpp b/include/mapnik/make_unique.hpp index ea2974cf0..f6fd4a230 100644 --- a/include/mapnik/make_unique.hpp +++ b/include/mapnik/make_unique.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/map.hpp b/include/mapnik/map.hpp index ee1c7a3b7..23ea96a7c 100644 --- a/include/mapnik/map.hpp +++ b/include/mapnik/map.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/mapped_memory_cache.hpp b/include/mapnik/mapped_memory_cache.hpp index bbdf02e70..f41c2e803 100644 --- a/include/mapnik/mapped_memory_cache.hpp +++ b/include/mapnik/mapped_memory_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/marker.hpp b/include/mapnik/marker.hpp index 3eaaebec8..6f7cbf02d 100644 --- a/include/mapnik/marker.hpp +++ b/include/mapnik/marker.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -49,7 +49,7 @@ using image_ptr = std::shared_ptr; struct marker_rgba8 { public: - marker_rgba8() + marker_rgba8() : bitmap_data_(4,4,true,true) { // create default OGC 4x4 black pixel @@ -58,7 +58,7 @@ public: marker_rgba8(image_rgba8 const & data) : bitmap_data_(data) {} - + marker_rgba8(image_rgba8 && data) : bitmap_data_(std::move(data)) {} @@ -70,19 +70,19 @@ public: box2d bounding_box() const { - double width = bitmap_data_.width(); - double height = bitmap_data_.height(); - return box2d(0, 0, width, height); + std::size_t width = bitmap_data_.width(); + std::size_t height = bitmap_data_.height(); + return box2d(static_cast(0), static_cast(0), static_cast(width), static_cast(height)); } - inline std::size_t width() const + inline double width() const { - return bitmap_data_.width(); + return static_cast(bitmap_data_.width()); } - inline std::size_t height() const + inline double height() const { - return bitmap_data_.height(); + return static_cast(bitmap_data_.height()); } image_rgba8 const& get_data() const @@ -132,7 +132,7 @@ private: }; -struct marker_null +struct marker_null { marker_null() = default; public: @@ -150,7 +150,7 @@ public: } }; -using marker_base = util::variant; namespace detail { @@ -169,7 +169,7 @@ struct get_marker_width_visitor template double operator()(T const& data) const { - return static_cast(data.width()); + return data.width(); } }; @@ -178,7 +178,7 @@ struct get_marker_height_visitor template double operator()(T const& data) const { - return static_cast(data.height()); + return data.height(); } }; diff --git a/include/mapnik/marker_cache.hpp b/include/mapnik/marker_cache.hpp index 7072b3921..47aa5558e 100644 --- a/include/mapnik/marker_cache.hpp +++ b/include/mapnik/marker_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,9 +28,9 @@ #include #include -// boost -#include +#include #include +#include namespace mapnik { @@ -46,9 +46,9 @@ private: marker_cache(); ~marker_cache(); bool insert_marker(std::string const& key, marker && path); - boost::unordered_map > marker_cache_; + std::unordered_map > marker_cache_; bool insert_svg(std::string const& name, std::string const& svg_string); - boost::unordered_map svg_cache_; + std::unordered_map svg_cache_; public: std::string known_svg_prefix_; std::string known_image_prefix_; diff --git a/include/mapnik/marker_helpers.hpp b/include/mapnik/marker_helpers.hpp index 0c3a91040..e6fdfa209 100644 --- a/include/mapnik/marker_helpers.hpp +++ b/include/mapnik/marker_helpers.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/markers_placement.hpp b/include/mapnik/markers_placement.hpp index 1472e6ea1..3e7e3e495 100644 --- a/include/mapnik/markers_placement.hpp +++ b/include/mapnik/markers_placement.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/markers_placements/interior.hpp b/include/mapnik/markers_placements/interior.hpp index 9fbc14cbc..93b5e3418 100644 --- a/include/mapnik/markers_placements/interior.hpp +++ b/include/mapnik/markers_placements/interior.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/markers_placements/line.hpp b/include/mapnik/markers_placements/line.hpp index c8017b55a..fe2c2bd9f 100644 --- a/include/mapnik/markers_placements/line.hpp +++ b/include/mapnik/markers_placements/line.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/markers_placements/point.hpp b/include/mapnik/markers_placements/point.hpp index 37cda8457..65b95ce79 100644 --- a/include/mapnik/markers_placements/point.hpp +++ b/include/mapnik/markers_placements/point.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/markers_placements/vertext_first.hpp b/include/mapnik/markers_placements/vertext_first.hpp index 7c149ebb7..bcdac2b4b 100644 --- a/include/mapnik/markers_placements/vertext_first.hpp +++ b/include/mapnik/markers_placements/vertext_first.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/markers_placements/vertext_last.hpp b/include/mapnik/markers_placements/vertext_last.hpp index 1c85c95b3..4d57130a2 100644 --- a/include/mapnik/markers_placements/vertext_last.hpp +++ b/include/mapnik/markers_placements/vertext_last.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/memory_datasource.hpp b/include/mapnik/memory_datasource.hpp index 83fdba63c..a6ab9188c 100644 --- a/include/mapnik/memory_datasource.hpp +++ b/include/mapnik/memory_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/memory_featureset.hpp b/include/mapnik/memory_featureset.hpp index 5193c8cc3..cc5005b42 100644 --- a/include/mapnik/memory_featureset.hpp +++ b/include/mapnik/memory_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/miniz_png.hpp b/include/mapnik/miniz_png.hpp index 0414c329c..6c46e448f 100644 --- a/include/mapnik/miniz_png.hpp +++ b/include/mapnik/miniz_png.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/octree.hpp b/include/mapnik/octree.hpp index ea813c89e..007e6960e 100644 --- a/include/mapnik/octree.hpp +++ b/include/mapnik/octree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/offset_converter.hpp b/include/mapnik/offset_converter.hpp index 722040586..f2c585c74 100644 --- a/include/mapnik/offset_converter.hpp +++ b/include/mapnik/offset_converter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,7 +40,7 @@ namespace mapnik { template -struct MAPNIK_DECL offset_converter +struct offset_converter { using size_type = std::size_t; @@ -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; @@ -326,13 +326,13 @@ private: } double angle_a = 0; - if (is_polygon) + if (is_polygon) { double x = v1.x - close_points[cpt].x; double y = v1.y - close_points[cpt].y; cpt++; - x = std::abs(x) < std::numeric_limits::epsilon() ? 0 : x; - y = std::abs(y) < std::numeric_limits::epsilon() ? 0 : y; + x = std::abs(x) < std::numeric_limits::epsilon() ? 0 : x; + y = std::abs(y) < std::numeric_limits::epsilon() ? 0 : y; angle_a = std::atan2(y, x); } double angle_b = std::atan2((v2.y - v1.y), (v2.x - v1.x)); @@ -417,8 +417,8 @@ private: { double x = v1.x - close_points[cpt].x; double y = v1.y - close_points[cpt].y; - x = std::abs(x) < std::numeric_limits::epsilon() ? 0.0 : x; - y = std::abs(y) < std::numeric_limits::epsilon() ? 0.0 : y; + x = std::abs(x) < std::numeric_limits::epsilon() ? 0.0 : x; + y = std::abs(y) < std::numeric_limits::epsilon() ? 0.0 : y; angle_b = std::atan2(y,x); cpt++; } diff --git a/include/mapnik/palette.hpp b/include/mapnik/palette.hpp index cf21338ac..377967aea 100644 --- a/include/mapnik/palette.hpp +++ b/include/mapnik/palette.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,13 +30,16 @@ #define USE_DENSE_HASH_MAP +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #ifdef USE_DENSE_HASH_MAP - #include - using rgba_hash_table = google::dense_hash_map; +#include +using rgba_hash_table = google::dense_hash_map; #else - #include - using rgba_hash_table = boost::unordered_map; +#include +using rgba_hash_table = std::unordered_map; #endif +#pragma GCC diagnostic pop // stl #include diff --git a/include/mapnik/params.hpp b/include/mapnik/params.hpp index 84076677b..fc5928900 100644 --- a/include/mapnik/params.hpp +++ b/include/mapnik/params.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/params_impl.hpp b/include/mapnik/params_impl.hpp index c262cacb6..469a9361e 100644 --- a/include/mapnik/params_impl.hpp +++ b/include/mapnik/params_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop @@ -71,7 +74,7 @@ struct extract_value return boost::optional(result); return boost::optional(); } - + static inline boost::optional do_extract_from_bool(value_bool const& source) { return boost::optional(source); @@ -150,7 +153,7 @@ struct extract_value { return boost::optional(source); } - + static inline boost::optional do_extract_from_bool(value_bool const& source) { if (source) { @@ -188,7 +191,7 @@ struct value_extractor_visitor var_ = detail::param_cast(val); } - + void operator() (value_bool const& val) const { var_ = detail::param_cast(val); diff --git a/include/mapnik/parse_path.hpp b/include/mapnik/parse_path.hpp index 0667e901a..e5b5882ab 100644 --- a/include/mapnik/parse_path.hpp +++ b/include/mapnik/parse_path.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/parse_transform.hpp b/include/mapnik/parse_transform.hpp index 7baef79d2..68e605c40 100644 --- a/include/mapnik/parse_transform.hpp +++ b/include/mapnik/parse_transform.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/path.hpp b/include/mapnik/path.hpp index b57fe509f..6d253466d 100644 --- a/include/mapnik/path.hpp +++ b/include/mapnik/path.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -124,7 +124,7 @@ struct vertex_adapter : private util::noncopyable unsigned vertex(double* x, double* y) const { - return path_.cont_.get_vertex(itr_++,x,y); + return path_.cont_.get_vertex(static_cast(itr_++),x,y); } unsigned vertex(std::size_t index, double* x, double* y) const diff --git a/include/mapnik/path_expression.hpp b/include/mapnik/path_expression.hpp index 296348bed..b3dde7dab 100644 --- a/include/mapnik/path_expression.hpp +++ b/include/mapnik/path_expression.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/path_expression_grammar.hpp b/include/mapnik/path_expression_grammar.hpp index f39947ef6..04d422aff 100644 --- a/include/mapnik/path_expression_grammar.hpp +++ b/include/mapnik/path_expression_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/path_expression_grammar_impl.hpp b/include/mapnik/path_expression_grammar_impl.hpp index 4801d2014..bc2fcfb52 100644 --- a/include/mapnik/path_expression_grammar_impl.hpp +++ b/include/mapnik/path_expression_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/pixel_position.hpp b/include/mapnik/pixel_position.hpp index 40d00ace8..93cdb4f7f 100644 --- a/include/mapnik/pixel_position.hpp +++ b/include/mapnik/pixel_position.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/pixel_types.hpp b/include/mapnik/pixel_types.hpp index 68e7ede3b..b0d6304b3 100644 --- a/include/mapnik/pixel_types.hpp +++ b/include/mapnik/pixel_types.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/plugin.hpp b/include/mapnik/plugin.hpp index 4be5f4ff3..a3428de81 100644 --- a/include/mapnik/plugin.hpp +++ b/include/mapnik/plugin.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/png_io.hpp b/include/mapnik/png_io.hpp index 9a35a291a..1b075b175 100644 --- a/include/mapnik/png_io.hpp +++ b/include/mapnik/png_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/pool.hpp b/include/mapnik/pool.hpp index 44c82941d..ecd16eb34 100644 --- a/include/mapnik/pool.hpp +++ b/include/mapnik/pool.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/proj_strategy.hpp b/include/mapnik/proj_strategy.hpp index 688e6d331..9bfd2e15e 100644 --- a/include/mapnik/proj_strategy.hpp +++ b/include/mapnik/proj_strategy.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,6 +31,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -63,7 +66,7 @@ struct proj_strategy boost::geometry::set<1>(p2, static_cast(y)); return true; } - + template inline P2 execute(P1 const& p1, bool & status) const { @@ -92,7 +95,7 @@ struct proj_backward_strategy boost::geometry::set<1>(p2, static_cast(y)); return true; } - + template inline P2 execute(P1 const& p1, bool & status) const { diff --git a/include/mapnik/proj_transform.hpp b/include/mapnik/proj_transform.hpp index fa27b6341..3247a15e3 100644 --- a/include/mapnik/proj_transform.hpp +++ b/include/mapnik/proj_transform.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/projection.hpp b/include/mapnik/projection.hpp index 5267dd702..cb4284fb0 100644 --- a/include/mapnik/projection.hpp +++ b/include/mapnik/projection.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/ptree_helpers.hpp b/include/mapnik/ptree_helpers.hpp index fe1a1de50..3062d7115 100644 --- a/include/mapnik/ptree_helpers.hpp +++ b/include/mapnik/ptree_helpers.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/quad_tree.hpp b/include/mapnik/quad_tree.hpp index d8d405434..d6575f01f 100644 --- a/include/mapnik/quad_tree.hpp +++ b/include/mapnik/quad_tree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,6 +31,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/query.hpp b/include/mapnik/query.hpp index 4c9455e16..5d5a6e7c8 100644 --- a/include/mapnik/query.hpp +++ b/include/mapnik/query.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/raster.hpp b/include/mapnik/raster.hpp index a4b26cb63..311c06cf0 100644 --- a/include/mapnik/raster.hpp +++ b/include/mapnik/raster.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/raster_colorizer.hpp b/include/mapnik/raster_colorizer.hpp index 63e2d0727..c1e83aba1 100644 --- a/include/mapnik/raster_colorizer.hpp +++ b/include/mapnik/raster_colorizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/renderer_common.hpp b/include/mapnik/renderer_common.hpp index ab74956b2..213443899 100644 --- a/include/mapnik/renderer_common.hpp +++ b/include/mapnik/renderer_common.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/renderer_common/clipping_extent.hpp b/include/mapnik/renderer_common/clipping_extent.hpp index b8dd70bfa..aabacf36f 100644 --- a/include/mapnik/renderer_common/clipping_extent.hpp +++ b/include/mapnik/renderer_common/clipping_extent.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/renderer_common/pattern_alignment.hpp b/include/mapnik/renderer_common/pattern_alignment.hpp index 53084b824..12f746d32 100644 --- a/include/mapnik/renderer_common/pattern_alignment.hpp +++ b/include/mapnik/renderer_common/pattern_alignment.hpp @@ -51,7 +51,7 @@ struct apply_local_alignment } template - void operator() (Adapter & va) + void operator() (Adapter &) { // no-op } diff --git a/include/mapnik/renderer_common/process_building_symbolizer.hpp b/include/mapnik/renderer_common/process_building_symbolizer.hpp index 809d36aba..6b0a94f79 100644 --- a/include/mapnik/renderer_common/process_building_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_building_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/renderer_common/process_group_symbolizer.hpp b/include/mapnik/renderer_common/process_group_symbolizer.hpp index 07adf5408..006d1a9f3 100644 --- a/include/mapnik/renderer_common/process_group_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_group_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -280,9 +280,9 @@ void render_group_symbolizer(group_symbolizer const& sym, // run feature or sub feature through the group rules & symbolizers // for each index value in the range - int start = get(sym, keys::start_column); - int end = start + get(sym, keys::num_columns); - for (int col_idx = start; col_idx < end; ++col_idx) + value_integer start = get(sym, keys::start_column); + value_integer end = start + get(sym, keys::num_columns); + for (value_integer col_idx = start; col_idx < end; ++col_idx) { // create sub feature with indexed column values feature_ptr sub_feature = feature_factory::create(sub_feature_ctx, col_idx); @@ -295,7 +295,7 @@ void render_group_symbolizer(group_symbolizer const& sym, if (col_name.size() == 1) { // column name is '%' by itself, so give the index as the value - sub_feature->put(col_name, (value_integer)col_idx); + sub_feature->put(col_name, col_idx); } else { @@ -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/renderer_common/process_markers_symbolizer.hpp b/include/mapnik/renderer_common/process_markers_symbolizer.hpp index 3bc1f314c..9d0852675 100644 --- a/include/mapnik/renderer_common/process_markers_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_markers_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/renderer_common/process_point_symbolizer.hpp b/include/mapnik/renderer_common/process_point_symbolizer.hpp index a67943752..12ffba508 100644 --- a/include/mapnik/renderer_common/process_point_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_point_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp index 60c781047..99f12435c 100644 --- a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/renderer_common/process_raster_symbolizer.hpp b/include/mapnik/renderer_common/process_raster_symbolizer.hpp index 3ef8b19cb..c42c15a73 100644 --- a/include/mapnik/renderer_common/process_raster_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_raster_symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -53,7 +53,8 @@ struct image_dispatcher double scale_x, double scale_y, scaling_method_e method, double filter_factor, double opacity, composite_mode_e comp_op, - raster_symbolizer const& sym, feature_impl const& feature, F & composite, boost::optional const& nodata) + raster_symbolizer const& sym, feature_impl const& feature, + F & composite, boost::optional const& nodata, bool need_scaling) : start_x_(start_x), start_y_(start_y), width_(width), @@ -67,25 +68,40 @@ struct image_dispatcher sym_(sym), feature_(feature), composite_(composite), - nodata_(nodata) {} + nodata_(nodata), + need_scaling_(need_scaling) {} void operator() (image_null const& data_in) const {} //no-op void operator() (image_rgba8 const& data_in) const { - image_rgba8 data_out(width_, height_, true, true); - scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_); - composite_(data_out, comp_op_, opacity_, start_x_, start_y_); + if (need_scaling_) + { + image_rgba8 data_out(width_, height_, true, true); + scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_); + composite_(data_out, comp_op_, opacity_, start_x_, start_y_); + } + else + { + composite_(data_in, comp_op_, opacity_, start_x_, start_y_); + } } template void operator() (T const& data_in) const { using image_type = T; - image_type data_out(width_, height_); - scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_); image_rgba8 dst(width_, height_); raster_colorizer_ptr colorizer = get(sym_, keys::colorizer); - if (colorizer) colorizer->colorize(dst, data_out, nodata_, feature_); + if (need_scaling_) + { + image_type data_out(width_, height_); + scale_image_agg(data_out, data_in, method_, scale_x_, scale_y_, 0.0, 0.0, filter_factor_); + if (colorizer) colorizer->colorize(dst, data_out, nodata_, feature_); + } + else + { + if (colorizer) colorizer->colorize(dst, data_in, nodata_, feature_); + } premultiply_alpha(dst); composite_(dst, comp_op_, opacity_, start_x_, start_y_); } @@ -104,6 +120,7 @@ private: feature_impl const& feature_; composite_function & composite_; boost::optional const& nodata_; + bool need_scaling_; }; template @@ -231,24 +248,15 @@ void render_raster_symbolizer(raster_symbolizer const& sym, double image_ratio_x = ext.width() / source->data_.width(); double image_ratio_y = ext.height() / source->data_.height(); double eps = 1e-5; - if ( (std::fabs(image_ratio_x - 1.0) <= eps) && - (std::fabs(image_ratio_y - 1.0) <= eps) && - (std::abs(start_x) <= eps) && - (std::abs(start_y) <= eps) ) - { - if (source->data_.is()) - { - composite(util::get(source->data_), comp_op, opacity, start_x, start_y); - } - } - else - { - detail::image_dispatcher dispatcher(start_x, start_y, raster_width, raster_height, - image_ratio_x, image_ratio_y, - scaling_method, source->get_filter_factor(), - opacity, comp_op, sym, feature, composite, source->nodata()); - util::apply_visitor(dispatcher, source->data_); - } + bool scale = (std::fabs(image_ratio_x - 1.0) > eps) || + (std::fabs(image_ratio_y - 1.0) > eps) || + (std::abs(start_x) > eps) || + (std::abs(start_y) > eps); + detail::image_dispatcher dispatcher(start_x, start_y, raster_width, raster_height, + image_ratio_x, image_ratio_y, + scaling_method, source->get_filter_factor(), + opacity, comp_op, sym, feature, composite, source->nodata(), scale); + util::apply_visitor(dispatcher, source->data_); } } } diff --git a/include/mapnik/renderer_common/render_pattern.hpp b/include/mapnik/renderer_common/render_pattern.hpp index ffa3140c2..acb989731 100644 --- a/include/mapnik/renderer_common/render_pattern.hpp +++ b/include/mapnik/renderer_common/render_pattern.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/request.hpp b/include/mapnik/request.hpp index e351f57f1..74c085197 100644 --- a/include/mapnik/request.hpp +++ b/include/mapnik/request.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/rule.hpp b/include/mapnik/rule.hpp index e32210e99..1c98eaf59 100644 --- a/include/mapnik/rule.hpp +++ b/include/mapnik/rule.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/rule_cache.hpp b/include/mapnik/rule_cache.hpp index 44a340659..3d6f7d025 100644 --- a/include/mapnik/rule_cache.hpp +++ b/include/mapnik/rule_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/safe_cast.hpp b/include/mapnik/safe_cast.hpp new file mode 100644 index 000000000..d8973032e --- /dev/null +++ b/include/mapnik/safe_cast.hpp @@ -0,0 +1,154 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 Artem Pavlenko + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + +#ifndef MAPNIK_SAFE_CAST_HPP +#define MAPNIK_SAFE_CAST_HPP + +#include +#include +#include + +namespace mapnik { + +namespace detail { + +template +struct numeric_compare; + +template +struct numeric_compare_same_sign +{ + using sizeup = typename std::conditional= sizeof(S), T, S>::type; + + static inline bool less(T t, S s) { + return static_cast(t) < static_cast(s); + } + + static inline bool greater(T t, S s) { + return static_cast(t) > static_cast(s); + } +}; + +template +struct numeric_compare::value && !std::is_floating_point::value && + ((std::is_unsigned::value && std::is_unsigned::value) + || (std::is_signed::value && std::is_signed::value))> + ::type> : numeric_compare_same_sign +{}; + + +template +struct numeric_compare::value && !std::is_floating_point::value && + std::is_integral::value && std::is_signed::value && std::is_unsigned::value>::type> +{ + static inline bool less(T t, S s) { + return (t < static_cast(0)) ? true : static_cast(t) < static_cast(s); + } + + static inline bool greater(T t, S s) { + return (t < static_cast(0)) ? false : static_cast(t) > static_cast(s); + } +}; + +template +struct numeric_compare::value && !std::is_floating_point::value && + std::is_integral::value && std::is_unsigned::value && std::is_signed::value>::type> +{ + static inline bool less(T t, S s) { + return (s < static_cast(0)) ? false : static_cast(t) < static_cast(s); + } + + static inline bool greater(T t, S s) { + return (s < static_cast(0)) ? true : static_cast(t) > static_cast(s); + } +}; + +template +struct numeric_compare::value && std::is_floating_point::value>::type> +{ + static inline bool less(T t, S s) { + return t < s; + } + + static inline bool greater(T t, S s) { + return t > s; + } +}; + +template +struct numeric_compare::value && std::is_integral::value) || + (std::is_integral::value && std::is_floating_point::value)>::type> +{ + static inline bool less(T t, S s) { + return numeric_compare::less(static_cast(t),static_cast(s)); + } + + static inline bool greater(T t, S s) { + return numeric_compare::greater(static_cast(t),static_cast(s)); + } +}; + +// floats +template +struct bounds +{ + static const T lowest() { return static_cast(-std::numeric_limits::max());} + static const T highest() { return std::numeric_limits::max();} +}; + +// integers +template +struct bounds::is_integer>::type > +{ + static const T lowest() { return std::numeric_limits::min();} + static const T highest() { return std::numeric_limits::max();} +}; + +} // ns detail + + +template +inline T safe_cast(S s) +{ + static const auto max_val = detail::bounds::highest(); + static const auto min_val = detail::bounds::lowest(); + + if (detail::numeric_compare::greater(s,max_val)) + { + return max_val; + } + else if (detail::numeric_compare::less(s,min_val)) + { + return min_val; + } + else + { + return static_cast(s); + } +} + +} // ns mapnik + + + +#endif // MAPNIK_SAFE_CAST_HPP diff --git a/include/mapnik/save_map.hpp b/include/mapnik/save_map.hpp index 894532062..80317b356 100644 --- a/include/mapnik/save_map.hpp +++ b/include/mapnik/save_map.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/scale_denominator.hpp b/include/mapnik/scale_denominator.hpp index e4aaee967..fb09cefd9 100644 --- a/include/mapnik/scale_denominator.hpp +++ b/include/mapnik/scale_denominator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/segment.hpp b/include/mapnik/segment.hpp index 2cf10398a..4463382b8 100644 --- a/include/mapnik/segment.hpp +++ b/include/mapnik/segment.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/simplify_converter.hpp b/include/mapnik/simplify_converter.hpp index e9a88c4cf..e217eba41 100644 --- a/include/mapnik/simplify_converter.hpp +++ b/include/mapnik/simplify_converter.hpp @@ -90,7 +90,7 @@ struct sleeve }; template -struct MAPNIK_DECL simplify_converter +struct simplify_converter { public: simplify_converter(Geometry & geom) diff --git a/include/mapnik/span_image_filter.hpp b/include/mapnik/span_image_filter.hpp index c84ee0435..d99c21ac9 100644 --- a/include/mapnik/span_image_filter.hpp +++ b/include/mapnik/span_image_filter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/sql_utils.hpp b/include/mapnik/sql_utils.hpp index f45af6ca8..d90a55f09 100644 --- a/include/mapnik/sql_utils.hpp +++ b/include/mapnik/sql_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/sse.hpp b/include/mapnik/sse.hpp index d68684cd2..603af7cd2 100644 --- a/include/mapnik/sse.hpp +++ b/include/mapnik/sse.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,7 @@ #define ROUND_DOWN(x, s) ((x) & ~((s)-1)) -typedef union +typedef union { __m128i v; int32_t i32[4]; diff --git a/include/mapnik/svg/geometry_svg_generator.hpp b/include/mapnik/svg/geometry_svg_generator.hpp index 1aa056eb9..e70166f03 100644 --- a/include/mapnik/svg/geometry_svg_generator.hpp +++ b/include/mapnik/svg/geometry_svg_generator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,6 +37,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/svg/geometry_svg_generator_impl.hpp b/include/mapnik/svg/geometry_svg_generator_impl.hpp index 4424fbe2c..57df89f96 100644 --- a/include/mapnik/svg/geometry_svg_generator_impl.hpp +++ b/include/mapnik/svg/geometry_svg_generator_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/output/svg_generator.hpp b/include/mapnik/svg/output/svg_generator.hpp index 42c4bb4f9..1b3f18dea 100644 --- a/include/mapnik/svg/output/svg_generator.hpp +++ b/include/mapnik/svg/output/svg_generator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/output/svg_output_attributes.hpp b/include/mapnik/svg/output/svg_output_attributes.hpp index 1de976969..00deeea26 100644 --- a/include/mapnik/svg/output/svg_output_attributes.hpp +++ b/include/mapnik/svg/output/svg_output_attributes.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/output/svg_output_grammars.hpp b/include/mapnik/svg/output/svg_output_grammars.hpp index f3ef886e7..3a47e4332 100644 --- a/include/mapnik/svg/output/svg_output_grammars.hpp +++ b/include/mapnik/svg/output/svg_output_grammars.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,6 +40,9 @@ 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" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #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..41f69282e 100644 --- a/include/mapnik/svg/output/svg_output_grammars_impl.hpp +++ b/include/mapnik/svg/output/svg_output_grammars_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop diff --git a/include/mapnik/svg/output/svg_path_iterator.hpp b/include/mapnik/svg/output/svg_path_iterator.hpp index a56a17538..b773888cd 100644 --- a/include/mapnik/svg/output/svg_path_iterator.hpp +++ b/include/mapnik/svg/output/svg_path_iterator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/output/svg_renderer.hpp b/include/mapnik/svg/output/svg_renderer.hpp index fe4fc65e0..037ec0ddb 100644 --- a/include/mapnik/svg/output/svg_renderer.hpp +++ b/include/mapnik/svg/output/svg_renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_converter.hpp b/include/mapnik/svg/svg_converter.hpp index ddde41d82..0066a1f29 100644 --- a/include/mapnik/svg/svg_converter.hpp +++ b/include/mapnik/svg/svg_converter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,6 +27,7 @@ #include #include #include +#include // agg #include "agg_path_storage.h" @@ -57,8 +58,8 @@ public: void begin_path() { - unsigned idx = source_.start_new_path(); - attributes_.add(path_attributes(cur_attr(), idx)); + std::size_t idx = source_.start_new_path(); + attributes_.add(path_attributes(cur_attr(), safe_cast(idx))); } void end_path() @@ -91,7 +92,7 @@ public: double y2 = 0.0; if(source_.total_vertices()) { - source_.vertex(source_.total_vertices() - 1, &x2, &y2); + source_.vertex(safe_cast(source_.total_vertices() - 1), &x2, &y2); if(rel) x += x2; source_.line_to(x, y2); } @@ -103,7 +104,7 @@ public: double y2 = 0.0; if(source_.total_vertices()) { - source_.vertex(source_.total_vertices() - 1, &x2, &y2); + source_.vertex(safe_cast(source_.total_vertices() - 1), &x2, &y2); if(rel) y += y2; source_.line_to(x2, y); } diff --git a/include/mapnik/svg/svg_parser.hpp b/include/mapnik/svg/svg_parser.hpp index 5198bfd53..57e8cf5f5 100644 --- a/include/mapnik/svg/svg_parser.hpp +++ b/include/mapnik/svg/svg_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_path_adapter.hpp b/include/mapnik/svg/svg_path_adapter.hpp index 72fa29a65..957717166 100644 --- a/include/mapnik/svg/svg_path_adapter.hpp +++ b/include/mapnik/svg/svg_path_adapter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,8 @@ // mapnik #include #include +#include + // agg #include "agg_math.h" #include "agg_array.h" @@ -53,7 +55,7 @@ public: // Make path functions //-------------------------------------------------------------------- - unsigned start_new_path(); + std::size_t start_new_path(); void move_to(double x, double y); void move_rel(double dx, double dy); @@ -112,7 +114,7 @@ public: const container_type& vertices() const { return vertices_; } container_type& vertices() { return vertices_; } - unsigned total_vertices() const; + std::size_t total_vertices() const; void rel_to_abs(double* x, double* y) const; @@ -263,7 +265,7 @@ private: //------------------------------------------------------------------------ template -unsigned path_adapter::start_new_path() +std::size_t path_adapter::start_new_path() { if(!is_stop(vertices_.last_command())) { @@ -547,7 +549,7 @@ inline void path_adapter::close_polygon(unsigned flags) //------------------------------------------------------------------------ template -inline unsigned path_adapter::total_vertices() const +inline std::size_t path_adapter::total_vertices() const { return vertices_.total_vertices(); } @@ -886,7 +888,7 @@ public: { return vertices_.size() ? vertices_[vertices_.size() - 1].cmd : - (unsigned)path_cmd_stop; + path_cmd_stop; } unsigned last_vertex(double* x, double* y) const @@ -896,7 +898,7 @@ public: *x = *y = 0.0; return path_cmd_stop; } - return vertex(vertices_.size() - 1, x, y); + return vertex(safe_cast(vertices_.size() - 1), x, y); } unsigned prev_vertex(double* x, double* y) const @@ -906,7 +908,7 @@ public: *x = *y = 0.0; return path_cmd_stop; } - return vertex(vertices_.size() - 2, x, y); + return vertex(safe_cast(vertices_.size() - 2), x, y); } double last_x() const diff --git a/include/mapnik/svg/svg_path_attributes.hpp b/include/mapnik/svg/svg_path_attributes.hpp index 29194ba70..7e180fdce 100644 --- a/include/mapnik/svg/svg_path_attributes.hpp +++ b/include/mapnik/svg/svg_path_attributes.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_path_commands.hpp b/include/mapnik/svg/svg_path_commands.hpp index 905f262a2..105b4cabc 100644 --- a/include/mapnik/svg/svg_path_commands.hpp +++ b/include/mapnik/svg/svg_path_commands.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/svg/svg_path_grammar.hpp b/include/mapnik/svg/svg_path_grammar.hpp index 1710b61dc..431bf0aed 100644 --- a/include/mapnik/svg/svg_path_grammar.hpp +++ b/include/mapnik/svg/svg_path_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_path_parser.hpp b/include/mapnik/svg/svg_path_parser.hpp index e72ad1ab4..35303f98d 100644 --- a/include/mapnik/svg/svg_path_parser.hpp +++ b/include/mapnik/svg/svg_path_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_points_grammar.hpp b/include/mapnik/svg/svg_points_grammar.hpp index e993d35ed..dbaed8480 100644 --- a/include/mapnik/svg/svg_points_grammar.hpp +++ b/include/mapnik/svg/svg_points_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_renderer_agg.hpp b/include/mapnik/svg/svg_renderer_agg.hpp index 569f3fa35..ad24cb912 100644 --- a/include/mapnik/svg/svg_renderer_agg.hpp +++ b/include/mapnik/svg/svg_renderer_agg.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -27,10 +27,16 @@ #include #include #include +#include #include #if defined(GRID_RENDERER) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include +#pragma GCC diagnostic pop #endif // agg @@ -341,7 +347,7 @@ public: void render_id(Rasterizer& ras, Scanline& sl, Renderer& ren, - int feature_id, + mapnik::value_integer feature_id, agg::trans_affine const& mtx, double /*opacity*/, box2d const& /*symbol_bbox*/) diff --git a/include/mapnik/svg/svg_storage.hpp b/include/mapnik/svg/svg_storage.hpp index c3618b625..c360ecf52 100644 --- a/include/mapnik/svg/svg_storage.hpp +++ b/include/mapnik/svg/svg_storage.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/svg/svg_transform_grammar.hpp b/include/mapnik/svg/svg_transform_grammar.hpp index ce5563df1..e0f5231aa 100644 --- a/include/mapnik/svg/svg_transform_grammar.hpp +++ b/include/mapnik/svg/svg_transform_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/symbolizer.hpp b/include/mapnik/symbolizer.hpp index 8a4745acd..40283b9d3 100644 --- a/include/mapnik/symbolizer.hpp +++ b/include/mapnik/symbolizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/symbolizer_base.hpp b/include/mapnik/symbolizer_base.hpp index 39a78a2b2..f960752c8 100644 --- a/include/mapnik/symbolizer_base.hpp +++ b/include/mapnik/symbolizer_base.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/symbolizer_default_values.hpp b/include/mapnik/symbolizer_default_values.hpp index c793acbde..b70ea194b 100644 --- a/include/mapnik/symbolizer_default_values.hpp +++ b/include/mapnik/symbolizer_default_values.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/symbolizer_dispatch.hpp b/include/mapnik/symbolizer_dispatch.hpp index ab59afa68..52f65bcfc 100644 --- a/include/mapnik/symbolizer_dispatch.hpp +++ b/include/mapnik/symbolizer_dispatch.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/symbolizer_enumerations.hpp b/include/mapnik/symbolizer_enumerations.hpp index 09ec17d25..7a3e72fd8 100644 --- a/include/mapnik/symbolizer_enumerations.hpp +++ b/include/mapnik/symbolizer_enumerations.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/symbolizer_hash.hpp b/include/mapnik/symbolizer_hash.hpp index feadf02d3..9c2baa4e4 100644 --- a/include/mapnik/symbolizer_hash.hpp +++ b/include/mapnik/symbolizer_hash.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/symbolizer_keys.hpp b/include/mapnik/symbolizer_keys.hpp index ec8649da5..15919dc1b 100644 --- a/include/mapnik/symbolizer_keys.hpp +++ b/include/mapnik/symbolizer_keys.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/symbolizer_utils.hpp b/include/mapnik/symbolizer_utils.hpp index 00a4f0208..358628bd2 100644 --- a/include/mapnik/symbolizer_utils.hpp +++ b/include/mapnik/symbolizer_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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/evaluated_format_properties_ptr.hpp b/include/mapnik/text/evaluated_format_properties_ptr.hpp index 8ead5f690..472865181 100644 --- a/include/mapnik/text/evaluated_format_properties_ptr.hpp +++ b/include/mapnik/text/evaluated_format_properties_ptr.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/face.hpp b/include/mapnik/text/face.hpp index 31dd45aa2..9c50bebcc 100644 --- a/include/mapnik/text/face.hpp +++ b/include/mapnik/text/face.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -87,7 +87,7 @@ public: void set_character_sizes(double size); void set_unscaled_character_sizes(); - unsigned size() const { return faces_.size(); } + std::size_t size() const { return faces_.size(); } iterator begin() { return faces_.begin(); } iterator end() { return faces_.end(); } private: diff --git a/include/mapnik/text/font_feature_settings.hpp b/include/mapnik/text/font_feature_settings.hpp index 9fd62596b..9d945fbe5 100644 --- a/include/mapnik/text/font_feature_settings.hpp +++ b/include/mapnik/text/font_feature_settings.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/font_library.hpp b/include/mapnik/text/font_library.hpp index fc5959a54..163aad3d6 100644 --- a/include/mapnik/text/font_library.hpp +++ b/include/mapnik/text/font_library.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/base.hpp b/include/mapnik/text/formatting/base.hpp index efda3d63e..da47d5d54 100644 --- a/include/mapnik/text/formatting/base.hpp +++ b/include/mapnik/text/formatting/base.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/format.hpp b/include/mapnik/text/formatting/format.hpp index 372598610..c540abd13 100644 --- a/include/mapnik/text/formatting/format.hpp +++ b/include/mapnik/text/formatting/format.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/layout.hpp b/include/mapnik/text/formatting/layout.hpp index 1ea1810c7..dd7f4b011 100644 --- a/include/mapnik/text/formatting/layout.hpp +++ b/include/mapnik/text/formatting/layout.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/list.hpp b/include/mapnik/text/formatting/list.hpp index 79314cfbe..45c4217db 100644 --- a/include/mapnik/text/formatting/list.hpp +++ b/include/mapnik/text/formatting/list.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/registry.hpp b/include/mapnik/text/formatting/registry.hpp index dbbce936f..7328d2b9c 100644 --- a/include/mapnik/text/formatting/registry.hpp +++ b/include/mapnik/text/formatting/registry.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/formatting/text.hpp b/include/mapnik/text/formatting/text.hpp index 214b3cf65..012288507 100644 --- a/include/mapnik/text/formatting/text.hpp +++ b/include/mapnik/text/formatting/text.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/glyph_info.hpp b/include/mapnik/text/glyph_info.hpp index 4b82ffb72..3950f9dd2 100644 --- a/include/mapnik/text/glyph_info.hpp +++ b/include/mapnik/text/glyph_info.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/glyph_positions.hpp b/include/mapnik/text/glyph_positions.hpp index c75cea3a4..554e40667 100644 --- a/include/mapnik/text/glyph_positions.hpp +++ b/include/mapnik/text/glyph_positions.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/harfbuzz_shaper.hpp b/include/mapnik/text/harfbuzz_shaper.hpp index 8bb37b180..8c4b8309f 100644 --- a/include/mapnik/text/harfbuzz_shaper.hpp +++ b/include/mapnik/text/harfbuzz_shaper.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,6 +28,7 @@ #include #include #include +#include // stl #include @@ -66,7 +67,7 @@ static void shape_text(text_line & line, { unsigned start = line.first_char(); unsigned end = line.last_char(); - size_t length = end - start; + std::size_t length = end - start; if (!length) return; std::list const& list = itemizer.itemize(start, end); @@ -75,7 +76,7 @@ static void shape_text(text_line & line, auto hb_buffer_deleter = [](hb_buffer_t * buffer) { hb_buffer_destroy(buffer);}; const std::unique_ptr buffer(hb_buffer_create(),hb_buffer_deleter); - hb_buffer_pre_allocate(buffer.get(), length); + hb_buffer_pre_allocate(buffer.get(), safe_cast(length)); mapnik::value_unicode_string const& text = itemizer.text(); for (auto const& text_item : list) @@ -86,15 +87,16 @@ static void shape_text(text_line & line, std::size_t num_faces = face_set->size(); std::size_t pos = 0; font_feature_settings const& ff_settings = text_item.format_->ff_settings; + int ff_count = safe_cast(ff_settings.count()); for (auto const& face : *face_set) { ++pos; hb_buffer_clear_contents(buffer.get()); - hb_buffer_add_utf16(buffer.get(), uchar_to_utf16(text.getBuffer()), text.length(), text_item.start, text_item.end - text_item.start); + hb_buffer_add_utf16(buffer.get(), uchar_to_utf16(text.getBuffer()), text.length(), text_item.start, static_cast(text_item.end - text_item.start)); hb_buffer_set_direction(buffer.get(), (text_item.dir == UBIDI_RTL)?HB_DIRECTION_RTL:HB_DIRECTION_LTR); hb_buffer_set_script(buffer.get(), _icu_script_to_script(text_item.script)); hb_font_t *font(hb_ft_font_create(face->get_face(), nullptr)); - hb_shape(font, buffer.get(), ff_settings.get_features(), ff_settings.count()); + hb_shape(font, buffer.get(), ff_settings.get_features(), ff_count); hb_font_destroy(font); unsigned num_glyphs = hb_buffer_get_length(buffer.get()); @@ -121,7 +123,7 @@ static void shape_text(text_line & line, double max_glyph_height = 0; for (unsigned i=0; iget_face()->units_per_EM; //Overwrite default advance with better value provided by HarfBuzz - g.unscaled_advance = pos.x_advance; - g.offset.set(pos.x_offset * g.scale_multiplier, pos.y_offset * g.scale_multiplier); + g.unscaled_advance = gpos.x_advance; + g.offset.set(gpos.x_offset * g.scale_multiplier, gpos.y_offset * g.scale_multiplier); double tmp_height = g.height(); if (tmp_height > max_glyph_height) max_glyph_height = tmp_height; width_map[char_index] += g.advance(); diff --git a/include/mapnik/text/icu_shaper.hpp b/include/mapnik/text/icu_shaper.hpp index e672eaade..dedeafd81 100644 --- a/include/mapnik/text/icu_shaper.hpp +++ b/include/mapnik/text/icu_shaper.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/itemizer.hpp b/include/mapnik/text/itemizer.hpp index 0b28bc34d..fe036ad24 100644 --- a/include/mapnik/text/itemizer.hpp +++ b/include/mapnik/text/itemizer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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/text/placement_finder.hpp b/include/mapnik/text/placement_finder.hpp index 9a6c439e4..f3ffd512a 100644 --- a/include/mapnik/text/placement_finder.hpp +++ b/include/mapnik/text/placement_finder.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -99,8 +99,8 @@ private: box2d marker_box_; bool marker_unlocked_; pixel_position marker_displacement_; - double move_dx_ = 0.0; - horizontal_alignment_e horizontal_alignment_ = H_LEFT; + double move_dx_; + horizontal_alignment_e horizontal_alignment_; }; }//ns mapnik diff --git a/include/mapnik/text/placement_finder_impl.hpp b/include/mapnik/text/placement_finder_impl.hpp index 9bf7256cf..739238924 100644 --- a/include/mapnik/text/placement_finder_impl.hpp +++ b/include/mapnik/text/placement_finder_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/placements/base.hpp b/include/mapnik/text/placements/base.hpp index 06c6cce20..f83a54748 100644 --- a/include/mapnik/text/placements/base.hpp +++ b/include/mapnik/text/placements/base.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/placements/dummy.hpp b/include/mapnik/text/placements/dummy.hpp index 18d81fea6..036c5bde9 100644 --- a/include/mapnik/text/placements/dummy.hpp +++ b/include/mapnik/text/placements/dummy.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/placements/list.hpp b/include/mapnik/text/placements/list.hpp index 1fa4c8712..c21a4d87c 100644 --- a/include/mapnik/text/placements/list.hpp +++ b/include/mapnik/text/placements/list.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,7 +38,7 @@ public: virtual void add_expressions(expression_set & output) const; text_symbolizer_properties & add(); text_symbolizer_properties & get(unsigned i); - unsigned size() const; + std::size_t size() const; static text_placements_ptr from_xml(xml_node const& xml, fontset_map const& fontsets, bool is_shield); private: std::vector list_; diff --git a/include/mapnik/text/placements/registry.hpp b/include/mapnik/text/placements/registry.hpp index 2f833709d..f8d8aefb1 100644 --- a/include/mapnik/text/placements/registry.hpp +++ b/include/mapnik/text/placements/registry.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/placements/simple.hpp b/include/mapnik/text/placements/simple.hpp index 2a9b983d7..a489bea6f 100644 --- a/include/mapnik/text/placements/simple.hpp +++ b/include/mapnik/text/placements/simple.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/properties_util.hpp b/include/mapnik/text/properties_util.hpp index a28a23fb2..0fff84e7b 100644 --- a/include/mapnik/text/properties_util.hpp +++ b/include/mapnik/text/properties_util.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/renderer.hpp b/include/mapnik/text/renderer.hpp index ac8bcb45a..a0b521d30 100644 --- a/include/mapnik/text/renderer.hpp +++ b/include/mapnik/text/renderer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/scrptrun.hpp b/include/mapnik/text/scrptrun.hpp index c8acec63b..e4c607f6c 100644 --- a/include/mapnik/text/scrptrun.hpp +++ b/include/mapnik/text/scrptrun.hpp @@ -23,15 +23,15 @@ struct ScriptRecord { - UChar32 startChar; - UChar32 endChar; - UScriptCode scriptCode; + UChar32 startChar = 0; + UChar32 endChar = 0; + UScriptCode scriptCode = USCRIPT_INVALID_CODE; }; struct ParenStackEntry { - int32_t pairIndex; - UScriptCode scriptCode; + int32_t pairIndex = 0; + UScriptCode scriptCode = USCRIPT_INVALID_CODE; }; class ScriptRun : public UObject { diff --git a/include/mapnik/text/symbolizer_helpers.hpp b/include/mapnik/text/symbolizer_helpers.hpp index ce31a04b7..714d566ba 100644 --- a/include/mapnik/text/symbolizer_helpers.hpp +++ b/include/mapnik/text/symbolizer_helpers.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -90,7 +90,7 @@ protected: view_transform const& t_; box2d dims_; box2d const& query_extent_; - float scale_factor_; + double scale_factor_; //Processing // Remaining geometries to be processed. diff --git a/include/mapnik/text/text_layout.hpp b/include/mapnik/text/text_layout.hpp index 360c518eb..2e59cdc8b 100644 --- a/include/mapnik/text/text_layout.hpp +++ b/include/mapnik/text/text_layout.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/text_line.hpp b/include/mapnik/text/text_line.hpp index dd3cfee1c..1bd02db66 100644 --- a/include/mapnik/text/text_line.hpp +++ b/include/mapnik/text/text_line.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/text/text_properties.hpp b/include/mapnik/text/text_properties.hpp index 90711a4e8..654921eb2 100644 --- a/include/mapnik/text/text_properties.hpp +++ b/include/mapnik/text/text_properties.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/tiff_io.hpp b/include/mapnik/tiff_io.hpp index fd3a7534b..df2b25a7a 100644 --- a/include/mapnik/tiff_io.hpp +++ b/include/mapnik/tiff_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/timer.hpp b/include/mapnik/timer.hpp index 22a67a339..8111ff645 100644 --- a/include/mapnik/timer.hpp +++ b/include/mapnik/timer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/tolerance_iterator.hpp b/include/mapnik/tolerance_iterator.hpp index 041cb114a..2b9512c8b 100644 --- a/include/mapnik/tolerance_iterator.hpp +++ b/include/mapnik/tolerance_iterator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/transform_expression.hpp b/include/mapnik/transform_expression.hpp index d73554b5a..9714b1eeb 100644 --- a/include/mapnik/transform_expression.hpp +++ b/include/mapnik/transform_expression.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -53,9 +53,6 @@ struct matrix_node expr_node e_; expr_node f_; - explicit matrix_node(double const* m) - : a_(m[0]), b_(m[1]), c_(m[2]), d_(m[3]), e_(m[4]), f_(m[5]) {} - template explicit matrix_node(T const& m) : a_(m.sx), b_(m.shy), c_(m.shx), d_(m.sy), e_(m.tx), f_(m.ty) {} diff --git a/include/mapnik/transform_expression_grammar.hpp b/include/mapnik/transform_expression_grammar.hpp index 6772c80cd..f3945f39b 100644 --- a/include/mapnik/transform_expression_grammar.hpp +++ b/include/mapnik/transform_expression_grammar.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/transform_expression_grammar_impl.hpp b/include/mapnik/transform_expression_grammar_impl.hpp index 59ca57a33..f72126eb7 100644 --- a/include/mapnik/transform_expression_grammar_impl.hpp +++ b/include/mapnik/transform_expression_grammar_impl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/transform_path_adapter.hpp b/include/mapnik/transform_path_adapter.hpp index bf056a127..cb68e9139 100644 --- a/include/mapnik/transform_path_adapter.hpp +++ b/include/mapnik/transform_path_adapter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/transform_processor.hpp b/include/mapnik/transform_processor.hpp index 58f7e7c09..fd45ecc38 100644 --- a/include/mapnik/transform_processor.hpp +++ b/include/mapnik/transform_processor.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/unicode.hpp b/include/mapnik/unicode.hpp index 89526f5d4..59401abfa 100644 --- a/include/mapnik/unicode.hpp +++ b/include/mapnik/unicode.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/const_rendering_buffer.hpp b/include/mapnik/util/const_rendering_buffer.hpp new file mode 100644 index 000000000..360eea564 --- /dev/null +++ b/include/mapnik/util/const_rendering_buffer.hpp @@ -0,0 +1,58 @@ +/***************************************************************************** + * + * This file is part of Mapnik (c++ mapping toolkit) + * + * Copyright (C) 2015 Artem Pavlenko + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + *****************************************************************************/ + +#ifndef MAPNIK_CONST_RENDERING_BUFFER_HPP +#define MAPNIK_CONST_RENDERING_BUFFER_HPP + +#include + +#include "agg_basics.h" + +#include + +namespace mapnik { namespace util { + +// non-mutable rendering_buffer implementation +template +struct rendering_buffer +{ + using image_type = T; + using pixel_type = typename image_type::pixel_type; + using row_data = agg::const_row_info; + + rendering_buffer(T const& data) + : data_(data) {} + + uint8_t const* buf() const { return data_.bytes(); } + std::size_t width() const { return data_.width();} + std::size_t height() const { return data_.height();} + int stride() const { return data_.row_size();} + uint8_t const* row_ptr(int, int y, unsigned) {return row_ptr(y);} + uint8_t const* row_ptr(int y) const { return reinterpret_cast(data_.get_row(static_cast(y))); } + row_data row (int y) const { return row_data(0, safe_cast(data_.width() - 1), row_ptr(y)); } + image_type const& data_; +}; + + +}} + +#endif // MAPNIK_CONST_RENDERING_BUFFER_HPP \ No newline at end of file diff --git a/include/mapnik/util/container_adapter.hpp b/include/mapnik/util/container_adapter.hpp index 5ebf09ba6..e07d7091f 100644 --- a/include/mapnik/util/container_adapter.hpp +++ b/include/mapnik/util/container_adapter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,6 +31,9 @@ // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop diff --git a/include/mapnik/util/conversions.hpp b/include/mapnik/util/conversions.hpp index bf59b25e4..284d20e03 100644 --- a/include/mapnik/util/conversions.hpp +++ b/include/mapnik/util/conversions.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/dasharray_parser.hpp b/include/mapnik/util/dasharray_parser.hpp index e5079b2b1..0ef1ae887 100644 --- a/include/mapnik/util/dasharray_parser.hpp +++ b/include/mapnik/util/dasharray_parser.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/feature_to_geojson.hpp b/include/mapnik/util/feature_to_geojson.hpp index fbf2aa5dd..ad3c0a7d4 100644 --- a/include/mapnik/util/feature_to_geojson.hpp +++ b/include/mapnik/util/feature_to_geojson.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/featureset_buffer.hpp b/include/mapnik/util/featureset_buffer.hpp index 842cc8e1e..8689a41e9 100644 --- a/include/mapnik/util/featureset_buffer.hpp +++ b/include/mapnik/util/featureset_buffer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/file_io.hpp b/include/mapnik/util/file_io.hpp index ff6f4e3c5..d3ffe9034 100644 --- a/include/mapnik/util/file_io.hpp +++ b/include/mapnik/util/file_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,7 +24,6 @@ #define MAPNIK_FILE_IO_HPP // mapnik -#include #include #include #include diff --git a/include/mapnik/util/fs.hpp b/include/mapnik/util/fs.hpp index 3e01b9694..03905cb45 100644 --- a/include/mapnik/util/fs.hpp +++ b/include/mapnik/util/fs.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/geometry_to_ds_type.hpp b/include/mapnik/util/geometry_to_ds_type.hpp index 4d89cc018..58fc89df2 100644 --- a/include/mapnik/util/geometry_to_ds_type.hpp +++ b/include/mapnik/util/geometry_to_ds_type.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/geometry_to_geojson.hpp b/include/mapnik/util/geometry_to_geojson.hpp index beffda79f..5cccb0950 100644 --- a/include/mapnik/util/geometry_to_geojson.hpp +++ b/include/mapnik/util/geometry_to_geojson.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/geometry_to_svg.hpp b/include/mapnik/util/geometry_to_svg.hpp index af5589763..9efb55134 100644 --- a/include/mapnik/util/geometry_to_svg.hpp +++ b/include/mapnik/util/geometry_to_svg.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/geometry_to_wkt.hpp b/include/mapnik/util/geometry_to_wkt.hpp index 70b122f63..3c81ef440 100644 --- a/include/mapnik/util/geometry_to_wkt.hpp +++ b/include/mapnik/util/geometry_to_wkt.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/hsl.hpp b/include/mapnik/util/hsl.hpp index e0b2d598a..d060da92f 100644 --- a/include/mapnik/util/hsl.hpp +++ b/include/mapnik/util/hsl.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -59,7 +59,7 @@ inline double hue_to_rgb(double m1, double m2, double h) inline void hsl2rgb(double h, double s, double l, double & r, double & g, double & b) { - if (!s) { + if (s == 0.0) { r = g = b = l; } else diff --git a/include/mapnik/util/noncopyable.hpp b/include/mapnik/util/noncopyable.hpp index e80fb4eb2..1cd4a4a31 100644 --- a/include/mapnik/util/noncopyable.hpp +++ b/include/mapnik/util/noncopyable.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/path_iterator.hpp b/include/mapnik/util/path_iterator.hpp index 840e63ac4..319c3461a 100644 --- a/include/mapnik/util/path_iterator.hpp +++ b/include/mapnik/util/path_iterator.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -111,7 +111,7 @@ private: void increment() { - std::get<0>(v_) = vertices_->cont_.get_vertex(pos_++, &std::get<1>(v_), &std::get<2>(v_)); + std::get<0>(v_) = vertices_->cont_.get_vertex(static_cast(pos_++), &std::get<1>(v_), &std::get<2>(v_)); } bool equal( path_iterator const& other) const diff --git a/include/mapnik/util/recursive_wrapper.hpp b/include/mapnik/util/recursive_wrapper.hpp index 7a212e8fb..16a670f1e 100644 --- a/include/mapnik/util/recursive_wrapper.hpp +++ b/include/mapnik/util/recursive_wrapper.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/timer.hpp b/include/mapnik/util/timer.hpp index 8f7487812..e29a8eae1 100644 --- a/include/mapnik/util/timer.hpp +++ b/include/mapnik/util/timer.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/trim.hpp b/include/mapnik/util/trim.hpp index cc4816dd4..60320331b 100644 --- a/include/mapnik/util/trim.hpp +++ b/include/mapnik/util/trim.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/util/variant_io.hpp b/include/mapnik/util/variant_io.hpp index cf080794d..8839a7e22 100644 --- a/include/mapnik/util/variant_io.hpp +++ b/include/mapnik/util/variant_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 4702cc24e..c4c37b446 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -990,4 +990,18 @@ inline bool value::is_null() const } // namespace mapnik +// support for std::unordered_xxx +namespace std +{ +template <> +struct hash +{ + size_t operator()(mapnik::value const& val) const + { + return mapnik::mapnik_hash_value(val); + } +}; + +} + #endif // MAPNIK_VALUE_HPP diff --git a/include/mapnik/value_error.hpp b/include/mapnik/value_error.hpp index 1edc5419b..68df62255 100644 --- a/include/mapnik/value_error.hpp +++ b/include/mapnik/value_error.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/value_hash.hpp b/include/mapnik/value_hash.hpp index 0933f06d3..e0aec264e 100644 --- a/include/mapnik/value_hash.hpp +++ b/include/mapnik/value_hash.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,6 +29,7 @@ // stl #include +#include // icu #include @@ -51,7 +52,8 @@ struct value_hasher std::size_t operator() (value_unicode_string const& val) const { - return val.hashCode(); + assert(val.hashCode() > 0); + return static_cast(val.hashCode()); } template diff --git a/include/mapnik/value_types.hpp b/include/mapnik/value_types.hpp index fdaa99ee4..a250b49b4 100644 --- a/include/mapnik/value_types.hpp +++ b/include/mapnik/value_types.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/version.hpp b/include/mapnik/version.hpp index 8030c5c92..6ed43f574 100644 --- a/include/mapnik/version.hpp +++ b/include/mapnik/version.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/vertex.hpp b/include/mapnik/vertex.hpp index 597526d7b..b05f362a5 100644 --- a/include/mapnik/vertex.hpp +++ b/include/mapnik/vertex.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/vertex_cache.hpp b/include/mapnik/vertex_cache.hpp index 094101a85..a0a32e96b 100644 --- a/include/mapnik/vertex_cache.hpp +++ b/include/mapnik/vertex_cache.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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..f10f720dc 100644 --- a/include/mapnik/vertex_converters.hpp +++ b/include/mapnik/vertex_converters.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -278,7 +278,7 @@ template struct converters_helper { template - static void set(Dispatcher & disp, int state) + static void set(Dispatcher & disp, std::size_t state) { if (std::is_same::value) { @@ -323,15 +323,15 @@ template struct converters_helper { template - static void set(Dispatcher &, int) {} + static void set(Dispatcher &, std::size_t) {} template - static void forward(Dispatcher & disp, Geometry & geom, Processor & proc) + static void forward(Dispatcher &, Geometry & geom, Processor & proc) { proc.add_path(geom); } }; -template +template struct dispatcher : util::noncopyable { using this_type = dispatcher; @@ -345,23 +345,23 @@ struct dispatcher : util::noncopyable std::fill(vec_.begin(), vec_.end(), 0); } - std::array vec_; + std::array vec_; args_type args_; }; 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/vertex_vector.hpp b/include/mapnik/vertex_vector.hpp index a25afc22e..67e30fc54 100644 --- a/include/mapnik/vertex_vector.hpp +++ b/include/mapnik/vertex_vector.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/view_strategy.hpp b/include/mapnik/view_strategy.hpp index 7bddb9b18..0d1125b97 100644 --- a/include/mapnik/view_strategy.hpp +++ b/include/mapnik/view_strategy.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,11 +25,11 @@ // mapnik #include - +#include // boost #include #include -#include + namespace mapnik { @@ -46,8 +46,8 @@ struct view_strategy double x = boost::geometry::get<0>(p1); double y = boost::geometry::get<1>(p1); tr_.forward(&x,&y); - boost::geometry::set<0>(p2, boost::numeric_cast(x)); - boost::geometry::set<1>(p2, boost::numeric_cast(y)); + boost::geometry::set<0>(p2, safe_cast(x)); + boost::geometry::set<1>(p2, safe_cast(y)); return true; } diff --git a/include/mapnik/view_transform.hpp b/include/mapnik/view_transform.hpp index e293eb608..2f5108c5f 100644 --- a/include/mapnik/view_transform.hpp +++ b/include/mapnik/view_transform.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/warp.hpp b/include/mapnik/warp.hpp index 262164ea7..0bf3332b6 100644 --- a/include/mapnik/warp.hpp +++ b/include/mapnik/warp.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/webp_io.hpp b/include/mapnik/webp_io.hpp index 3caf281ba..4b5c54105 100644 --- a/include/mapnik/webp_io.hpp +++ b/include/mapnik/webp_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/well_known_srs.hpp b/include/mapnik/well_known_srs.hpp index 41d4cac57..eeb478ee3 100644 --- a/include/mapnik/well_known_srs.hpp +++ b/include/mapnik/well_known_srs.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -92,7 +92,7 @@ static inline bool merc2lonlat(double * x, double * y , int point_count) static inline bool lonlat2merc(geometry::line_string & ls) { - for(auto & p : ls) + for(auto & p : ls) { if (p.x > 180) p.x = 180; else if (p.x < -180) p.x = -180; diff --git a/include/mapnik/wkb.hpp b/include/mapnik/wkb.hpp index 32478041a..ac90df7b3 100644 --- a/include/mapnik/wkb.hpp +++ b/include/mapnik/wkb.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/wkt/wkt_factory.hpp b/include/mapnik/wkt/wkt_factory.hpp index 3e2ece1e7..14f509dda 100644 --- a/include/mapnik/wkt/wkt_factory.hpp +++ b/include/mapnik/wkt/wkt_factory.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/wkt/wkt_generator_grammar.hpp b/include/mapnik/wkt/wkt_generator_grammar.hpp index 1a0b558c8..e4a396959 100644 --- a/include/mapnik/wkt/wkt_generator_grammar.hpp +++ b/include/mapnik/wkt/wkt_generator_grammar.hpp @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #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..43c5334a1 100644 --- a/include/mapnik/wkt/wkt_grammar.hpp +++ b/include/mapnik/wkt/wkt_grammar.hpp @@ -29,6 +29,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/include/mapnik/xml_attribute_cast.hpp b/include/mapnik/xml_attribute_cast.hpp index 1a3cb98f2..5140fde3c 100644 --- a/include/mapnik/xml_attribute_cast.hpp +++ b/include/mapnik/xml_attribute_cast.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,7 +37,10 @@ #include // boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #include +#pragma GCC diagnostic pop // stl #include @@ -109,8 +112,8 @@ struct do_xml_attribute_cast static inline boost::optional xml_attribute_cast_impl(xml_tree const& /*tree*/, std::string const& source) { int result; - if (mapnik::util::string2int(source, result)) - return boost::optional(result); + if (mapnik::util::string2int(source, result) && result >= 0) + return boost::optional(static_cast(result)); return boost::optional(); } }; @@ -166,7 +169,7 @@ struct do_xml_attribute_cast > template <> struct do_xml_attribute_cast { - static inline boost::optional xml_attribute_cast_impl(xml_tree const& tree, std::string const& source) + static inline boost::optional xml_attribute_cast_impl(xml_tree const&, std::string const& source) { return parse_color(source); } @@ -176,7 +179,7 @@ struct do_xml_attribute_cast template <> struct do_xml_attribute_cast { - static inline boost::optional xml_attribute_cast_impl(xml_tree const& /*tree*/, std::string const& source) + static inline boost::optional xml_attribute_cast_impl(xml_tree const&, std::string const& source) { return boost::optional(source); } @@ -206,7 +209,7 @@ struct do_xml_attribute_cast template <> struct do_xml_attribute_cast { - static inline boost::optional xml_attribute_cast_impl(xml_tree const& tree, std::string const& source) + static inline boost::optional xml_attribute_cast_impl(xml_tree const&, std::string const& source) { return mapnik::font_feature_settings(source); } diff --git a/include/mapnik/xml_loader.hpp b/include/mapnik/xml_loader.hpp index 1991fa685..5fe98af0c 100644 --- a/include/mapnik/xml_loader.hpp +++ b/include/mapnik/xml_loader.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/xml_node.hpp b/include/mapnik/xml_node.hpp index 106bbc673..1c3602134 100644 --- a/include/mapnik/xml_node.hpp +++ b/include/mapnik/xml_node.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/include/mapnik/xml_tree.hpp b/include/mapnik/xml_tree.hpp index f13cd4170..535d96763 100644 --- a/include/mapnik/xml_tree.hpp +++ b/include/mapnik/xml_tree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,7 +36,7 @@ namespace mapnik class MAPNIK_DECL xml_tree { public: - xml_tree(std::string const& encoding="utf8"); + xml_tree(); void set_filename(std::string const& fn); std::string const& filename() const; xml_node &root(); diff --git a/mason_latest.sh b/mason_latest.sh index cc4a970aa..62a0c94f0 100755 --- a/mason_latest.sh +++ b/mason_latest.sh @@ -24,11 +24,9 @@ function mason_compile { done; fi; python -c "data=open('$MASON_PREFIX/bin/mapnik-config','r').read();open('$MASON_PREFIX/bin/mapnik-config','w').write(data.replace('$HERE','.'))" - mkdir -p ${MASON_PREFIX}/share/gdal - mkdir -p ${MASON_PREFIX}/share/proj mkdir -p ${MASON_PREFIX}/share/icu - cp -r $GDAL_DATA/ ${MASON_PREFIX}/share/gdal/ - cp -r $PROJ_LIB/ ${MASON_PREFIX}/share/proj/ + cp -r $GDAL_DATA ${MASON_PREFIX}/share/ + cp -r $PROJ_LIB ${MASON_PREFIX}/share/ cp -r $ICU_DATA/*dat ${MASON_PREFIX}/share/icu/ find ${MASON_PREFIX} -name "*.pyc" -exec rm {} \; } diff --git a/plugins/input/csv/build.py b/plugins/input/csv/build.py index 174deda55..d1f3716d5 100644 --- a/plugins/input/csv/build.py +++ b/plugins/input/csv/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/csv/csv_datasource.cpp b/plugins/input/csv/csv_datasource.cpp index 81aeaf3ef..d6774088d 100644 --- a/plugins/input/csv/csv_datasource.cpp +++ b/plugins/input/csv/csv_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/csv/csv_datasource.hpp b/plugins/input/csv/csv_datasource.hpp index f8af14675..c057d0832 100644 --- a/plugins/input/csv/csv_datasource.hpp +++ b/plugins/input/csv/csv_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/csv/csv_utils.hpp b/plugins/input/csv/csv_utils.hpp index 3ec8c9fcb..c55065e9a 100644 --- a/plugins/input/csv/csv_utils.hpp +++ b/plugins/input/csv/csv_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #pragma GCC diagnostic pop diff --git a/plugins/input/gdal/build.py b/plugins/input/gdal/build.py index 506385a99..6c80de24b 100644 --- a/plugins/input/gdal/build.py +++ b/plugins/input/gdal/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# Import ('plugin_base') Import ('env') diff --git a/plugins/input/gdal/gdal_datasource.cpp b/plugins/input/gdal/gdal_datasource.cpp index 187d6aa0b..8a06a92c4 100644 --- a/plugins/input/gdal/gdal_datasource.cpp +++ b/plugins/input/gdal/gdal_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/gdal/gdal_datasource.hpp b/plugins/input/gdal/gdal_datasource.hpp index f2403c32d..7e7b22164 100644 --- a/plugins/input/gdal/gdal_datasource.hpp +++ b/plugins/input/gdal/gdal_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index 514b9791a..968fc6df1 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/gdal/gdal_featureset.hpp b/plugins/input/gdal/gdal_featureset.hpp index 04f24ed0f..b90921149 100644 --- a/plugins/input/gdal/gdal_featureset.hpp +++ b/plugins/input/gdal/gdal_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/geojson/build.py b/plugins/input/geojson/build.py index faa3e9ff4..7435be5fa 100644 --- a/plugins/input/geojson/build.py +++ b/plugins/input/geojson/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/geojson/geojson_datasource.cpp b/plugins/input/geojson/geojson_datasource.cpp index 8d82f4266..739ef733e 100644 --- a/plugins/input/geojson/geojson_datasource.cpp +++ b/plugins/input/geojson/geojson_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,6 +30,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include #pragma GCC diagnostic pop @@ -55,7 +58,11 @@ #include #if defined(SHAPE_MEMORY_MAPPED_FILE) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include +#pragma GCC diagnostic pop #include #endif @@ -210,12 +217,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 +357,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..870f64985 100644 --- a/plugins/input/geojson/geojson_datasource.hpp +++ b/plugins/input/geojson/geojson_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -39,6 +39,9 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop diff --git a/plugins/input/geojson/geojson_featureset.cpp b/plugins/input/geojson/geojson_featureset.cpp index 20fb415f1..1976f03ba 100644 --- a/plugins/input/geojson/geojson_featureset.cpp +++ b/plugins/input/geojson/geojson_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/geojson/geojson_featureset.hpp b/plugins/input/geojson/geojson_featureset.hpp index 1af2da7ae..e055b9777 100644 --- a/plugins/input/geojson/geojson_featureset.hpp +++ b/plugins/input/geojson/geojson_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/geojson/large_geojson_featureset.cpp b/plugins/input/geojson/large_geojson_featureset.cpp index 158455ef7..1df7dce4a 100644 --- a/plugins/input/geojson/large_geojson_featureset.cpp +++ b/plugins/input/geojson/large_geojson_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/geojson/large_geojson_featureset.hpp b/plugins/input/geojson/large_geojson_featureset.hpp index 71116aee1..a67eec5bf 100644 --- a/plugins/input/geojson/large_geojson_featureset.hpp +++ b/plugins/input/geojson/large_geojson_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/occi/build.py b/plugins/input/occi/build.py index 4db36eb6d..e0aeb7b4b 100644 --- a/plugins/input/occi/build.py +++ b/plugins/input/occi/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/occi/occi_datasource.cpp b/plugins/input/occi/occi_datasource.cpp index fcfe78578..1c2809239 100644 --- a/plugins/input/occi/occi_datasource.cpp +++ b/plugins/input/occi/occi_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/occi/occi_datasource.hpp b/plugins/input/occi/occi_datasource.hpp index 27151ff43..0affc339e 100644 --- a/plugins/input/occi/occi_datasource.hpp +++ b/plugins/input/occi/occi_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/occi/occi_featureset.cpp b/plugins/input/occi/occi_featureset.cpp index 1c01140fd..0a0b942eb 100644 --- a/plugins/input/occi/occi_featureset.cpp +++ b/plugins/input/occi/occi_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/occi/occi_featureset.hpp b/plugins/input/occi/occi_featureset.hpp index 9203423e5..13445dd96 100644 --- a/plugins/input/occi/occi_featureset.hpp +++ b/plugins/input/occi/occi_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/occi/occi_types.cpp b/plugins/input/occi/occi_types.cpp index 6fb69aa3e..439670680 100644 --- a/plugins/input/occi/occi_types.cpp +++ b/plugins/input/occi/occi_types.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software, you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/occi/occi_types.hpp b/plugins/input/occi/occi_types.hpp index c405fd525..cc8cd41fa 100644 --- a/plugins/input/occi/occi_types.hpp +++ b/plugins/input/occi/occi_types.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software, you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/ogr/build.py b/plugins/input/ogr/build.py index 9c4101bc2..908cf1940 100644 --- a/plugins/input/ogr/build.py +++ b/plugins/input/ogr/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/ogr/ogr_converter.cpp b/plugins/input/ogr/ogr_converter.cpp index 939807da7..f2eb60294 100644 --- a/plugins/input/ogr/ogr_converter.cpp +++ b/plugins/input/ogr/ogr_converter.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/ogr/ogr_converter.hpp b/plugins/input/ogr/ogr_converter.hpp index e3e2bb335..8b7f909af 100644 --- a/plugins/input/ogr/ogr_converter.hpp +++ b/plugins/input/ogr/ogr_converter.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/ogr/ogr_datasource.cpp b/plugins/input/ogr/ogr_datasource.cpp index 2c0d90aac..9e2b081bb 100644 --- a/plugins/input/ogr/ogr_datasource.cpp +++ b/plugins/input/ogr/ogr_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -330,7 +330,6 @@ void ogr_datasource::init(mapnik::parameters const& params) const std::string fld_name = fld->GetNameRef(); const OGRFieldType type_oid = fld->GetType(); - switch (type_oid) { case OFTInteger: diff --git a/plugins/input/ogr/ogr_datasource.hpp b/plugins/input/ogr/ogr_datasource.hpp index ddd74b717..f98aebfaa 100644 --- a/plugins/input/ogr/ogr_datasource.hpp +++ b/plugins/input/ogr/ogr_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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.cpp b/plugins/input/ogr/ogr_featureset.cpp index 1a50024a0..3d46fcf87 100644 --- a/plugins/input/ogr/ogr_featureset.cpp +++ b/plugins/input/ogr/ogr_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -125,6 +125,9 @@ feature_ptr ogr_featureset::next() switch (type_oid) { case OFTInteger: +#if GDAL_VERSION_MAJOR >= 2 + case OFTInteger64: +#endif { feature->put( fld_name, poFeature->GetFieldAsInteger(i)); break; @@ -144,6 +147,9 @@ feature_ptr ogr_featureset::next() } case OFTIntegerList: +#if GDAL_VERSION_MAJOR >= 2 + case OFTInteger64List: +#endif case OFTRealList: case OFTStringList: case OFTWideStringList: // deprecated ! diff --git a/plugins/input/ogr/ogr_featureset.hpp b/plugins/input/ogr/ogr_featureset.hpp index 9dfd7290c..ca7a57ab6 100644 --- a/plugins/input/ogr/ogr_featureset.hpp +++ b/plugins/input/ogr/ogr_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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.hpp b/plugins/input/ogr/ogr_index.hpp index b30c92a35..e661d21b0 100644 --- a/plugins/input/ogr/ogr_index.hpp +++ b/plugins/input/ogr/ogr_index.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/ogr/ogr_index_featureset.cpp b/plugins/input/ogr/ogr_index_featureset.cpp index 265ded381..c59ef29fa 100644 --- a/plugins/input/ogr/ogr_index_featureset.cpp +++ b/plugins/input/ogr/ogr_index_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,8 +35,12 @@ // boost #ifdef SHAPE_MEMORY_MAPPED_FILE #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include +#pragma GCC diagnostic pop #endif // ogr diff --git a/plugins/input/ogr/ogr_index_featureset.hpp b/plugins/input/ogr/ogr_index_featureset.hpp index 440743e31..93d3a327f 100644 --- a/plugins/input/ogr/ogr_index_featureset.hpp +++ b/plugins/input/ogr/ogr_index_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/ogr/ogr_layer_ptr.hpp b/plugins/input/ogr/ogr_layer_ptr.hpp index 07c55c352..28df28b21 100644 --- a/plugins/input/ogr/ogr_layer_ptr.hpp +++ b/plugins/input/ogr/ogr_layer_ptr.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/basiccurl.cpp b/plugins/input/osm/basiccurl.cpp index 77cab5eba..fd8361453 100755 --- a/plugins/input/osm/basiccurl.cpp +++ b/plugins/input/osm/basiccurl.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/build.py b/plugins/input/osm/build.py index 3a0dffe4e..061fc859c 100644 --- a/plugins/input/osm/build.py +++ b/plugins/input/osm/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/dataset_deliverer.cpp b/plugins/input/osm/dataset_deliverer.cpp index 4920cab90..6d7fe31d9 100644 --- a/plugins/input/osm/dataset_deliverer.cpp +++ b/plugins/input/osm/dataset_deliverer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/osm.cpp b/plugins/input/osm/osm.cpp index f822a3177..76d3bac18 100644 --- a/plugins/input/osm/osm.cpp +++ b/plugins/input/osm/osm.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/osm_datasource.cpp b/plugins/input/osm/osm_datasource.cpp index 3f52897c9..4bbe1bfde 100644 --- a/plugins/input/osm/osm_datasource.cpp +++ b/plugins/input/osm/osm_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/osm_datasource.hpp b/plugins/input/osm/osm_datasource.hpp index 3a2f0aff0..1bd8bb387 100644 --- a/plugins/input/osm/osm_datasource.hpp +++ b/plugins/input/osm/osm_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/osm_featureset.cpp b/plugins/input/osm/osm_featureset.cpp index 71c44ec6a..46e796681 100644 --- a/plugins/input/osm/osm_featureset.cpp +++ b/plugins/input/osm/osm_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/osm/osm_featureset.hpp b/plugins/input/osm/osm_featureset.hpp index 48c0ff508..7eed2e636 100644 --- a/plugins/input/osm/osm_featureset.hpp +++ b/plugins/input/osm/osm_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/build.py b/plugins/input/pgraster/build.py index 9f1f40fe2..9d2666588 100644 --- a/plugins/input/pgraster/build.py +++ b/plugins/input/pgraster/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/pgraster_datasource.cpp b/plugins/input/pgraster/pgraster_datasource.cpp index 9e393bcbb..fb2c4b0ea 100644 --- a/plugins/input/pgraster/pgraster_datasource.cpp +++ b/plugins/input/pgraster/pgraster_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/pgraster_datasource.hpp b/plugins/input/pgraster/pgraster_datasource.hpp index 9d1931ffc..221f196e4 100644 --- a/plugins/input/pgraster/pgraster_datasource.hpp +++ b/plugins/input/pgraster/pgraster_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/pgraster_featureset.cpp b/plugins/input/pgraster/pgraster_featureset.cpp index 3ab87bba4..e2d4ccb50 100644 --- a/plugins/input/pgraster/pgraster_featureset.cpp +++ b/plugins/input/pgraster/pgraster_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/pgraster_featureset.hpp b/plugins/input/pgraster/pgraster_featureset.hpp index 55aba597a..25319b31a 100644 --- a/plugins/input/pgraster/pgraster_featureset.hpp +++ b/plugins/input/pgraster/pgraster_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/pgraster_wkb_reader.cpp b/plugins/input/pgraster/pgraster_wkb_reader.cpp index 11860b8c0..0320fe106 100644 --- a/plugins/input/pgraster/pgraster_wkb_reader.cpp +++ b/plugins/input/pgraster/pgraster_wkb_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/pgraster/pgraster_wkb_reader.hpp b/plugins/input/pgraster/pgraster_wkb_reader.hpp index b0ec7f8f9..02a22bc4a 100644 --- a/plugins/input/pgraster/pgraster_wkb_reader.hpp +++ b/plugins/input/pgraster/pgraster_wkb_reader.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/asyncresultset.hpp b/plugins/input/postgis/asyncresultset.hpp index b1bc9126d..9c30d57f3 100644 --- a/plugins/input/postgis/asyncresultset.hpp +++ b/plugins/input/postgis/asyncresultset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/build.py b/plugins/input/postgis/build.py index 676fbf29c..9b8ecd9a9 100644 --- a/plugins/input/postgis/build.py +++ b/plugins/input/postgis/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/connection.hpp b/plugins/input/postgis/connection.hpp index 18009e581..3d33a2d67 100644 --- a/plugins/input/postgis/connection.hpp +++ b/plugins/input/postgis/connection.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/connection_manager.hpp b/plugins/input/postgis/connection_manager.hpp index c1b6dc456..37c547f02 100644 --- a/plugins/input/postgis/connection_manager.hpp +++ b/plugins/input/postgis/connection_manager.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/cursorresultset.hpp b/plugins/input/postgis/cursorresultset.hpp index fa071b3a5..63bb9429c 100644 --- a/plugins/input/postgis/cursorresultset.hpp +++ b/plugins/input/postgis/cursorresultset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/numeric2string.hpp b/plugins/input/postgis/numeric2string.hpp index 0f988c9c6..76c204f0c 100644 --- a/plugins/input/postgis/numeric2string.hpp +++ b/plugins/input/postgis/numeric2string.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/postgis_datasource.cpp b/plugins/input/postgis/postgis_datasource.cpp index acb9655d3..9477c0488 100644 --- a/plugins/input/postgis/postgis_datasource.cpp +++ b/plugins/input/postgis/postgis_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/postgis_datasource.hpp b/plugins/input/postgis/postgis_datasource.hpp index 7537bf626..84bcfe555 100644 --- a/plugins/input/postgis/postgis_datasource.hpp +++ b/plugins/input/postgis/postgis_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/postgis_featureset.cpp b/plugins/input/postgis/postgis_featureset.cpp index d256e86f8..9dda45db9 100644 --- a/plugins/input/postgis/postgis_featureset.cpp +++ b/plugins/input/postgis/postgis_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/postgis_featureset.hpp b/plugins/input/postgis/postgis_featureset.hpp index 6f5fff44a..1dc2b3ff8 100644 --- a/plugins/input/postgis/postgis_featureset.hpp +++ b/plugins/input/postgis/postgis_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/postgis/resultset.hpp b/plugins/input/postgis/resultset.hpp index b93ce64dd..915a5962d 100644 --- a/plugins/input/postgis/resultset.hpp +++ b/plugins/input/postgis/resultset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/build.py b/plugins/input/raster/build.py index 20f65b2d2..324a2a908 100644 --- a/plugins/input/raster/build.py +++ b/plugins/input/raster/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/raster_datasource.cpp b/plugins/input/raster/raster_datasource.cpp index e1a7c2966..96f59387d 100644 --- a/plugins/input/raster/raster_datasource.cpp +++ b/plugins/input/raster/raster_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/raster_datasource.hpp b/plugins/input/raster/raster_datasource.hpp index 0cb7ad45f..7ff099086 100644 --- a/plugins/input/raster/raster_datasource.hpp +++ b/plugins/input/raster/raster_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/raster_featureset.cpp b/plugins/input/raster/raster_featureset.cpp index 4bf95571e..93f4b8d36 100644 --- a/plugins/input/raster/raster_featureset.cpp +++ b/plugins/input/raster/raster_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/raster_featureset.hpp b/plugins/input/raster/raster_featureset.hpp index fed7bbaea..007689275 100644 --- a/plugins/input/raster/raster_featureset.hpp +++ b/plugins/input/raster/raster_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/raster_info.cpp b/plugins/input/raster/raster_info.cpp index 9b04983e7..54b17c412 100644 --- a/plugins/input/raster/raster_info.cpp +++ b/plugins/input/raster/raster_info.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/raster/raster_info.hpp b/plugins/input/raster/raster_info.hpp index 2bf5ba96c..f0208425a 100644 --- a/plugins/input/raster/raster_info.hpp +++ b/plugins/input/raster/raster_info.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/rasterlite/build.py b/plugins/input/rasterlite/build.py index 7100b1e5f..779a48908 100644 --- a/plugins/input/rasterlite/build.py +++ b/plugins/input/rasterlite/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/rasterlite/rasterlite_datasource.cpp b/plugins/input/rasterlite/rasterlite_datasource.cpp index f370f19d0..026101865 100644 --- a/plugins/input/rasterlite/rasterlite_datasource.cpp +++ b/plugins/input/rasterlite/rasterlite_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/rasterlite/rasterlite_datasource.hpp b/plugins/input/rasterlite/rasterlite_datasource.hpp index dcb1a1319..dd304465b 100644 --- a/plugins/input/rasterlite/rasterlite_datasource.hpp +++ b/plugins/input/rasterlite/rasterlite_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/rasterlite/rasterlite_featureset.cpp b/plugins/input/rasterlite/rasterlite_featureset.cpp index 97912b77a..270a87e53 100644 --- a/plugins/input/rasterlite/rasterlite_featureset.cpp +++ b/plugins/input/rasterlite/rasterlite_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/rasterlite/rasterlite_featureset.hpp b/plugins/input/rasterlite/rasterlite_featureset.hpp index cf7973f15..cb251c86a 100644 --- a/plugins/input/rasterlite/rasterlite_featureset.hpp +++ b/plugins/input/rasterlite/rasterlite_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/rasterlite/rasterlite_include.hpp b/plugins/input/rasterlite/rasterlite_include.hpp index 4662e845d..b6a9dd274 100644 --- a/plugins/input/rasterlite/rasterlite_include.hpp +++ b/plugins/input/rasterlite/rasterlite_include.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/build.py b/plugins/input/shape/build.py index 4ef33687a..097d602e6 100644 --- a/plugins/input/shape/build.py +++ b/plugins/input/shape/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/dbf_test.cpp b/plugins/input/shape/dbf_test.cpp index b9917a931..c5e22f576 100644 --- a/plugins/input/shape/dbf_test.cpp +++ b/plugins/input/shape/dbf_test.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/dbfile.cpp b/plugins/input/shape/dbfile.cpp index 2da4978a6..921165757 100644 --- a/plugins/input/shape/dbfile.cpp +++ b/plugins/input/shape/dbfile.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,6 +32,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #ifdef SHAPE_MEMORY_MAPPED_FILE #include @@ -190,7 +193,7 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat const char *itr = record_+fields_[col].offset_; const char *end = itr + fields_[col].length_; ascii::space_type space; - qi::double_type double_; + static qi::double_type double_; if (qi::phrase_parse(itr,end,double_,space,val)) { f.put(name,val); @@ -202,8 +205,8 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat const char *itr = record_+fields_[col].offset_; const char *end = itr + fields_[col].length_; ascii::space_type space; - qi::int_type int_; - if (qi::phrase_parse(itr,end,int_,space,val)) + static qi::int_parser numeric_parser; + if (qi::phrase_parse(itr, end, numeric_parser, space, val)) { f.put(name,val); } diff --git a/plugins/input/shape/dbfile.hpp b/plugins/input/shape/dbfile.hpp index 75e77d323..358d737f7 100644 --- a/plugins/input/shape/dbfile.hpp +++ b/plugins/input/shape/dbfile.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,11 +29,11 @@ #include #ifdef SHAPE_MEMORY_MAPPED_FILE #include -#endif - - -// boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #include +#pragma GCC diagnostic pop +#endif // stl #include diff --git a/plugins/input/shape/shape_datasource.cpp b/plugins/input/shape/shape_datasource.cpp index 8cf8ba09d..05e24a48e 100644 --- a/plugins/input/shape/shape_datasource.cpp +++ b/plugins/input/shape/shape_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_datasource.hpp b/plugins/input/shape/shape_datasource.hpp index 586496b87..f702036eb 100644 --- a/plugins/input/shape/shape_datasource.hpp +++ b/plugins/input/shape/shape_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_featureset.cpp b/plugins/input/shape/shape_featureset.cpp index 6367cbfec..8a2b164f6 100644 --- a/plugins/input/shape/shape_featureset.cpp +++ b/plugins/input/shape/shape_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_featureset.hpp b/plugins/input/shape/shape_featureset.hpp index 4ce235e8e..a047bae80 100644 --- a/plugins/input/shape/shape_featureset.hpp +++ b/plugins/input/shape/shape_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_index_featureset.cpp b/plugins/input/shape/shape_index_featureset.cpp index 89628fa99..fdd75137c 100644 --- a/plugins/input/shape/shape_index_featureset.cpp +++ b/plugins/input/shape/shape_index_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_index_featureset.hpp b/plugins/input/shape/shape_index_featureset.hpp index d62d8ed6a..cf52aa0c2 100644 --- a/plugins/input/shape/shape_index_featureset.hpp +++ b/plugins/input/shape/shape_index_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_io.cpp b/plugins/input/shape/shape_io.cpp index cce40a9f0..7f149823c 100644 --- a/plugins/input/shape/shape_io.cpp +++ b/plugins/input/shape/shape_io.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_io.hpp b/plugins/input/shape/shape_io.hpp index ebf31dacf..497dbdabd 100644 --- a/plugins/input/shape/shape_io.hpp +++ b/plugins/input/shape/shape_io.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_utils.cpp b/plugins/input/shape/shape_utils.cpp index 9495fda87..af7aa536c 100644 --- a/plugins/input/shape/shape_utils.cpp +++ b/plugins/input/shape/shape_utils.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shape_utils.hpp b/plugins/input/shape/shape_utils.hpp index eda62a8b2..edb22225b 100644 --- a/plugins/input/shape/shape_utils.hpp +++ b/plugins/input/shape/shape_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/shape/shapefile.hpp b/plugins/input/shape/shapefile.hpp index 78b2deb1b..3f70e3a7f 100644 --- a/plugins/input/shape/shapefile.hpp +++ b/plugins/input/shape/shapefile.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -34,9 +34,13 @@ #include #include #ifdef SHAPE_MEMORY_MAPPED_FILE +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include -#include #include +#pragma GCC diagnostic pop +#include #endif #include diff --git a/plugins/input/shape/shp_index.hpp b/plugins/input/shape/shp_index.hpp index bb033e95f..6c32305b8 100644 --- a/plugins/input/shape/shp_index.hpp +++ b/plugins/input/shape/shp_index.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/build.py b/plugins/input/sqlite/build.py index 3136dcae7..b3a4a3e8b 100644 --- a/plugins/input/sqlite/build.py +++ b/plugins/input/sqlite/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_connection.hpp b/plugins/input/sqlite/sqlite_connection.hpp index c7bd11fb7..27a2fe210 100644 --- a/plugins/input/sqlite/sqlite_connection.hpp +++ b/plugins/input/sqlite/sqlite_connection.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_datasource.cpp b/plugins/input/sqlite/sqlite_datasource.cpp index 9c837bd2b..036e31aa2 100644 --- a/plugins/input/sqlite/sqlite_datasource.cpp +++ b/plugins/input/sqlite/sqlite_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_datasource.hpp b/plugins/input/sqlite/sqlite_datasource.hpp index ae2132667..eab71e9e3 100644 --- a/plugins/input/sqlite/sqlite_datasource.hpp +++ b/plugins/input/sqlite/sqlite_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_featureset.cpp b/plugins/input/sqlite/sqlite_featureset.cpp index e6ee0d425..99a44db54 100644 --- a/plugins/input/sqlite/sqlite_featureset.cpp +++ b/plugins/input/sqlite/sqlite_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_featureset.hpp b/plugins/input/sqlite/sqlite_featureset.hpp index 12f3ee0ee..dc168676e 100644 --- a/plugins/input/sqlite/sqlite_featureset.hpp +++ b/plugins/input/sqlite/sqlite_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_prepared.hpp b/plugins/input/sqlite/sqlite_prepared.hpp index cf81842ab..db1355d67 100644 --- a/plugins/input/sqlite/sqlite_prepared.hpp +++ b/plugins/input/sqlite/sqlite_prepared.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_resultset.hpp b/plugins/input/sqlite/sqlite_resultset.hpp index aebd031a1..6046387f9 100644 --- a/plugins/input/sqlite/sqlite_resultset.hpp +++ b/plugins/input/sqlite/sqlite_resultset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/sqlite/sqlite_utils.hpp b/plugins/input/sqlite/sqlite_utils.hpp index fe055ac5e..c96f64005 100644 --- a/plugins/input/sqlite/sqlite_utils.hpp +++ b/plugins/input/sqlite/sqlite_utils.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/topojson/build.py b/plugins/input/topojson/build.py index 19abd869d..9f7b95529 100644 --- a/plugins/input/topojson/build.py +++ b/plugins/input/topojson/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/topojson/topojson_datasource.cpp b/plugins/input/topojson/topojson_datasource.cpp index cd9c327b1..225a767a1 100644 --- a/plugins/input/topojson/topojson_datasource.cpp +++ b/plugins/input/topojson/topojson_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/plugins/input/topojson/topojson_datasource.hpp b/plugins/input/topojson/topojson_datasource.hpp index fff936d3a..214d40e09 100644 --- a/plugins/input/topojson/topojson_datasource.hpp +++ b/plugins/input/topojson/topojson_datasource.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -39,6 +39,9 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/plugins/input/topojson/topojson_featureset.cpp b/plugins/input/topojson/topojson_featureset.cpp index ed53932e8..b82304b71 100644 --- a/plugins/input/topojson/topojson_featureset.cpp +++ b/plugins/input/topojson/topojson_featureset.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -132,8 +132,8 @@ struct feature_generator { index_type index = line.ring; index_type arc_index = index < 0 ? std::abs(index) - 1 : index; - if (arc_index < num_arcs_) - { + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) + { auto const& arcs = topo_.arcs[arc_index]; double px = 0, py = 0; mapnik::geometry::line_string line_string; @@ -168,7 +168,7 @@ struct feature_generator for (auto const& index : multi_line.rings) { index_type arc_index = index < 0 ? std::abs(index) - 1 : index; - if (arc_index < num_arcs_) + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { hit = true; double px = 0, py = 0; @@ -192,7 +192,7 @@ struct feature_generator if (hit) { feature->set_geometry(std::move(multi_line_string)); - assign_properties(*feature, multi_line, tr_); + assign_properties(*feature, multi_line, tr_); } } return feature; @@ -216,7 +216,7 @@ struct feature_generator double px = 0, py = 0; bool reverse = index < 0; index_type arc_index = reverse ? std::abs(index) - 1 : index; - if (arc_index < num_arcs_) + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { hit = true; auto const& arcs = topo_.arcs[arc_index]; @@ -267,7 +267,7 @@ struct feature_generator { mapnik::geometry::correct(polygon); feature->set_geometry(std::move(polygon)); - assign_properties(*feature, poly, tr_); + assign_properties(*feature, poly, tr_); } } return feature; @@ -296,7 +296,7 @@ struct feature_generator double px = 0, py = 0; bool reverse = index < 0; index_type arc_index = reverse ? std::abs(index) - 1 : index; - if (arc_index < num_arcs_) + if (arc_index >= 0 && arc_index < static_cast(num_arcs_)) { hit = true; auto const& arcs = topo_.arcs[arc_index]; @@ -350,7 +350,7 @@ struct feature_generator { mapnik::geometry::correct(multi_polygon); feature->set_geometry(std::move(multi_polygon)); - assign_properties(*feature, multi_poly, tr_); + assign_properties(*feature, multi_poly, tr_); } } return feature; diff --git a/plugins/input/topojson/topojson_featureset.hpp b/plugins/input/topojson/topojson_featureset.hpp index f6dc224c6..44f833512 100644 --- a/plugins/input/topojson/topojson_featureset.hpp +++ b/plugins/input/topojson/topojson_featureset.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/agg/agg_renderer.cpp b/src/agg/agg_renderer.cpp index 67723d064..56e171048 100644 --- a/src/agg/agg_renderer.cpp +++ b/src/agg/agg_renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -128,16 +128,16 @@ struct setup_agg_bg_visitor void operator() (marker_rgba8 const& marker) { mapnik::image_rgba8 const& bg_image = marker.get_data(); - int w = bg_image.width(); - int h = bg_image.height(); + std::size_t w = bg_image.width(); + std::size_t h = bg_image.height(); if ( w > 0 && h > 0) { // repeat background-image both vertically and horizontally - unsigned x_steps = static_cast(std::ceil(common_.width_/double(w))); - unsigned y_steps = static_cast(std::ceil(common_.height_/double(h))); - for (unsigned x=0;x(std::ceil(common_.width_/double(w))); + std::size_t y_steps = static_cast(std::ceil(common_.height_/double(h))); + for (std::size_t x=0;x::process(debug_symbolizer const& sym, debug_symbolizer_mode_enum mode = get(sym, keys::mode, feature, common_.vars_, DEBUG_SYM_MODE_COLLISION); + ras_ptr->reset(); + if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0) + { + ras_ptr->gamma(agg::gamma_power()); + gamma_method_ = GAMMA_POWER; + gamma_ = 1.0; + } + if (mode == DEBUG_SYM_MODE_RINGS) { RingRenderer renderer(*ras_ptr,*current_buffer_,common_.t_,prj_trans); diff --git a/src/agg/process_dot_symbolizer.cpp b/src/agg/process_dot_symbolizer.cpp index 8e19aa997..322bfeaf4 100644 --- a/src/agg/process_dot_symbolizer.cpp +++ b/src/agg/process_dot_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -111,6 +111,12 @@ void agg_renderer::process(dot_symbolizer const& sym, double opacity = get(sym, keys::opacity, feature, common_.vars_, 1.0); color const& fill = get(sym, keys::fill, feature, common_.vars_, mapnik::color(128,128,128)); ras_ptr->reset(); + if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0) + { + ras_ptr->gamma(agg::gamma_power()); + gamma_method_ = GAMMA_POWER; + gamma_ = 1.0; + } agg::rendering_buffer buf(current_buffer_->bytes(),current_buffer_->width(),current_buffer_->height(),current_buffer_->row_size()); using blender_type = agg::comp_op_adaptor_rgba_pre; using pixfmt_comp_type = agg::pixfmt_custom_blend_rgba; diff --git a/src/agg/process_group_symbolizer.cpp b/src/agg/process_group_symbolizer.cpp index a0cf894db..836e13533 100644 --- a/src/agg/process_group_symbolizer.cpp +++ b/src/agg/process_group_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/agg/process_line_pattern_symbolizer.cpp b/src/agg/process_line_pattern_symbolizer.cpp index b5df95380..7cdd16648 100644 --- a/src/agg/process_line_pattern_symbolizer.cpp +++ b/src/agg/process_line_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -237,6 +237,13 @@ void agg_renderer::process(line_pattern_symbolizer const& sym, std::string filename = get(sym, feature, common_.vars_); if (filename.empty()) return; + ras_ptr->reset(); + if (gamma_method_ != GAMMA_POWER || gamma_ != 1.0) + { + ras_ptr->gamma(agg::gamma_power()); + gamma_method_ = GAMMA_POWER; + gamma_ = 1.0; + } std::shared_ptr marker = marker_cache::instance().find(filename, true); agg_renderer_process_visitor_l visitor(common_, pixmap_, diff --git a/src/agg/process_line_symbolizer.cpp b/src/agg/process_line_symbolizer.cpp index 7397141ce..e2004e921 100644 --- a/src/agg/process_line_symbolizer.cpp +++ b/src/agg/process_line_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/agg/process_markers_symbolizer.cpp b/src/agg/process_markers_symbolizer.cpp index 27489d315..ab06ed30c 100644 --- a/src/agg/process_markers_symbolizer.cpp +++ b/src/agg/process_markers_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/agg/process_point_symbolizer.cpp b/src/agg/process_point_symbolizer.cpp index cabae6dc5..8dc40f1af 100644 --- a/src/agg/process_point_symbolizer.cpp +++ b/src/agg/process_point_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/agg/process_polygon_pattern_symbolizer.cpp b/src/agg/process_polygon_pattern_symbolizer.cpp index a69d26652..386adee16 100644 --- a/src/agg/process_polygon_pattern_symbolizer.cpp +++ b/src/agg/process_polygon_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/agg/process_polygon_symbolizer.cpp b/src/agg/process_polygon_symbolizer.cpp index 31a61d357..9af6d4ac5 100644 --- a/src/agg/process_polygon_symbolizer.cpp +++ b/src/agg/process_polygon_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/agg/process_raster_symbolizer.cpp b/src/agg/process_raster_symbolizer.cpp index 7d5cd4b93..0105e9bc3 100644 --- a/src/agg/process_raster_symbolizer.cpp +++ b/src/agg/process_raster_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -51,7 +51,7 @@ void agg_renderer::process(raster_symbolizer const& sym, { render_raster_symbolizer( sym, feature, prj_trans, common_, - [&](image_rgba8 & target, composite_mode_e comp_op, double opacity, + [&](image_rgba8 const & target, composite_mode_e comp_op, double opacity, int start_x, int start_y) { composite(*current_buffer_, target, comp_op, opacity, start_x, start_y); diff --git a/src/agg/process_shield_symbolizer.cpp b/src/agg/process_shield_symbolizer.cpp index 1327be4a2..e8d1cc5c5 100644 --- a/src/agg/process_shield_symbolizer.cpp +++ b/src/agg/process_shield_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/agg/process_text_symbolizer.cpp b/src/agg/process_text_symbolizer.cpp index c697d0521..c30566d61 100644 --- a/src/agg/process_text_symbolizer.cpp +++ b/src/agg/process_text_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -58,14 +58,12 @@ void agg_renderer::process(text_symbolizer const& sym, common_.scale_factor_, common_.font_manager_.get_stroker()); - { // halo transform - agg::trans_affine halo_transform; - auto transform = get_optional(sym, keys::halo_transform); - if (transform) - { - evaluate_transform(halo_transform, feature, common_.vars_, *transform); - ren.set_halo_transform(halo_transform); - } + auto halo_transform = get_optional(sym, keys::halo_transform); + if (halo_transform) + { + agg::trans_affine halo_affine_transform; + evaluate_transform(halo_affine_transform, feature, common_.vars_, *halo_transform); + ren.set_halo_transform(halo_affine_transform); } placements_list const& placements = helper.get(); diff --git a/src/box2d.cpp b/src/box2d.cpp index edea1b5a8..a39857d24 100644 --- a/src/box2d.cpp +++ b/src/box2d.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,6 +22,7 @@ // mapnik #include +#include // stl #include @@ -32,6 +33,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -43,10 +46,10 @@ BOOST_FUSION_ADAPT_TPL_ADT( (T), (mapnik::box2d)(T), - (T, T, obj.minx(), obj.set_minx(val)) - (T, T, obj.miny(), obj.set_miny(val)) - (T, T, obj.maxx(), obj.set_maxx(val)) - (T, T, obj.maxy(), obj.set_maxy(val))) + (T, T, obj.minx(), obj.set_minx(mapnik::safe_cast(val))) + (T, T, obj.miny(), obj.set_miny(mapnik::safe_cast(val))) + (T, T, obj.maxx(), obj.set_maxx(mapnik::safe_cast(val))) + (T, T, obj.maxy(), obj.set_maxy(mapnik::safe_cast(val)))) namespace mapnik { diff --git a/src/build.py b/src/build.py index 2b7f0e0b0..520a34710 100644 --- a/src/build.py +++ b/src/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/cairo_context.cpp b/src/cairo/cairo_context.cpp index fe35c3a9f..1a20e90f0 100644 --- a/src/cairo/cairo_context.cpp +++ b/src/cairo/cairo_context.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -230,7 +230,7 @@ void cairo_context::set_dash(dash_array const& dashes, double scale_factor) std::valarray d(dashes.size() * 2); dash_array::const_iterator itr = dashes.begin(); dash_array::const_iterator end = dashes.end(); - int index = 0; + std::size_t index = 0; for (; itr != end; ++itr) { @@ -465,8 +465,8 @@ void cairo_context::add_text(glyph_positions const& pos, matrix.y0 = 0; set_font_matrix(matrix); set_font_face(manager, glyph.face); - pixel_position pos = glyph_pos.pos + glyph.offset.rotate(glyph_pos.rot); - glyph_path(glyph.glyph_index, pixel_position(sx + pos.x, sy - pos.y)); + pixel_position new_pos = glyph_pos.pos + glyph.offset.rotate(glyph_pos.rot); + glyph_path(glyph.glyph_index, pixel_position(sx + new_pos.x, sy - new_pos.y)); set_line_width(2.0 * halo_radius); set_line_join(ROUND_JOIN); set_color(glyph.format->halo_fill, glyph.format->halo_opacity); @@ -486,9 +486,9 @@ void cairo_context::add_text(glyph_positions const& pos, matrix.y0 = 0; set_font_matrix(matrix); set_font_face(manager, glyph.face); - pixel_position pos = glyph_pos.pos + glyph.offset.rotate(glyph_pos.rot); + pixel_position new_pos = glyph_pos.pos + glyph.offset.rotate(glyph_pos.rot); set_color(glyph.format->fill, glyph.format->text_opacity); - show_glyph(glyph.glyph_index, pixel_position(sx + pos.x, sy - pos.y)); + show_glyph(glyph.glyph_index, pixel_position(sx + new_pos.x, sy - new_pos.y)); } } diff --git a/src/cairo/cairo_render_vector.cpp b/src/cairo/cairo_render_vector.cpp index cfe86d6a4..160002dd2 100644 --- a/src/cairo/cairo_render_vector.cpp +++ b/src/cairo/cairo_render_vector.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/cairo_renderer.cpp b/src/cairo/cairo_renderer.cpp index b4293afac..17723071c 100644 --- a/src/cairo/cairo_renderer.cpp +++ b/src/cairo/cairo_renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -110,16 +110,16 @@ struct setup_marker_visitor void operator() (marker_rgba8 const& marker) { mapnik::image_rgba8 const& bg_image = marker.get_data(); - int w = bg_image.width(); - int h = bg_image.height(); + std::size_t w = bg_image.width(); + std::size_t h = bg_image.height(); if ( w > 0 && h > 0) { // repeat background-image both vertically and horizontally - unsigned x_steps = unsigned(std::ceil(common_.width_/double(w))); - unsigned y_steps = unsigned(std::ceil(common_.height_/double(h))); - for (unsigned x=0;x::end_layer_processing(layer const&) } template -void cairo_renderer::start_style_processing(feature_type_style const& st) +void cairo_renderer::start_style_processing(feature_type_style const&) { MAPNIK_LOG_DEBUG(cairo_renderer) << "cairo_renderer:start style processing"; } template -void cairo_renderer::end_style_processing(feature_type_style const& st) +void cairo_renderer::end_style_processing(feature_type_style const&) { MAPNIK_LOG_DEBUG(cairo_renderer) << "cairo_renderer:end style processing"; } diff --git a/src/cairo/process_building_symbolizer.cpp b/src/cairo/process_building_symbolizer.cpp index edb647b18..544414374 100644 --- a/src/cairo/process_building_symbolizer.cpp +++ b/src/cairo/process_building_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/process_debug_symbolizer.cpp b/src/cairo/process_debug_symbolizer.cpp index ff84dc8e8..b1e2b27ec 100644 --- a/src/cairo/process_debug_symbolizer.cpp +++ b/src/cairo/process_debug_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/process_group_symbolizer.cpp b/src/cairo/process_group_symbolizer.cpp index ef688b6cc..79338664d 100644 --- a/src/cairo/process_group_symbolizer.cpp +++ b/src/cairo/process_group_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/process_line_pattern_symbolizer.cpp b/src/cairo/process_line_pattern_symbolizer.cpp index ff7dd018e..4ec63570a 100644 --- a/src/cairo/process_line_pattern_symbolizer.cpp +++ b/src/cairo/process_line_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,8 +43,8 @@ struct cairo_renderer_process_visitor_l cairo_renderer_process_visitor_l(renderer_common const& common, line_pattern_symbolizer const& sym, mapnik::feature_impl & feature, - unsigned & width, - unsigned & height) + std::size_t & width, + std::size_t & height) : common_(common), sym_(sym), feature_(feature), @@ -81,8 +81,8 @@ struct cairo_renderer_process_visitor_l renderer_common const& common_; line_pattern_symbolizer const& sym_; mapnik::feature_impl & feature_; - unsigned & width_; - unsigned & height_; + std::size_t & width_; + std::size_t & height_; }; template @@ -106,8 +106,8 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, if (marker->is()) return; - unsigned width = marker->width(); - unsigned height = marker->height(); + std::size_t width = marker->width(); + std::size_t height = marker->height(); cairo_save_restore guard(context_); context_.set_operator(comp_op); diff --git a/src/cairo/process_line_symbolizer.cpp b/src/cairo/process_line_symbolizer.cpp index 6021bbf22..1510547e4 100644 --- a/src/cairo/process_line_symbolizer.cpp +++ b/src/cairo/process_line_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/process_markers_symbolizer.cpp b/src/cairo/process_markers_symbolizer.cpp index 3cfb39496..faffd3d6a 100644 --- a/src/cairo/process_markers_symbolizer.cpp +++ b/src/cairo/process_markers_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -59,7 +59,7 @@ struct vector_markers_dispatch_cairo : public vector_markers_dispatch double scale_factor, feature_impl & feature, mapnik::attributes const& vars, - bool snap_to_pixels, + bool /* snap_to_pixels */, // only used in agg renderer currently RendererContext const& renderer_context) : vector_markers_dispatch(src, marker_trans, sym, detector, scale_factor, feature, vars), path_(path), diff --git a/src/cairo/process_point_symbolizer.cpp b/src/cairo/process_point_symbolizer.cpp index 349a198f2..b0ffefb80 100644 --- a/src/cairo/process_point_symbolizer.cpp +++ b/src/cairo/process_point_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/process_polygon_pattern_symbolizer.cpp b/src/cairo/process_polygon_pattern_symbolizer.cpp index 08030f703..760a42524 100644 --- a/src/cairo/process_polygon_pattern_symbolizer.cpp +++ b/src/cairo/process_polygon_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/process_polygon_symbolizer.cpp b/src/cairo/process_polygon_symbolizer.cpp index 90ca5c96a..b2558a46a 100644 --- a/src/cairo/process_polygon_symbolizer.cpp +++ b/src/cairo/process_polygon_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo/process_raster_symbolizer.cpp b/src/cairo/process_raster_symbolizer.cpp index 7915ebbdd..2b6fdc5c2 100644 --- a/src/cairo/process_raster_symbolizer.cpp +++ b/src/cairo/process_raster_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -43,7 +43,7 @@ void cairo_renderer::process(raster_symbolizer const& sym, cairo_save_restore guard(context_); render_raster_symbolizer( sym, feature, prj_trans, common_, - [&](image_rgba8 &target, composite_mode_e comp_op, double opacity, + [&](image_rgba8 const & target, composite_mode_e comp_op, double opacity, int start_x, int start_y) { context_.set_operator(comp_op); context_.add_image(start_x, start_y, target, opacity); diff --git a/src/cairo/process_text_symbolizer.cpp b/src/cairo/process_text_symbolizer.cpp index 197511494..176b6c635 100644 --- a/src/cairo/process_text_symbolizer.cpp +++ b/src/cairo/process_text_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/cairo_io.cpp b/src/cairo_io.cpp index d8e965584..96152cc92 100644 --- a/src/cairo_io.cpp +++ b/src/cairo_io.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/color.cpp b/src/color.cpp index 75204ce7f..b385877f5 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,6 +32,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/src/color_factory.cpp b/src/color_factory.cpp index 38257ec22..d13a89562 100644 --- a/src/color_factory.cpp +++ b/src/color_factory.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/conversions.cpp b/src/conversions.cpp index 83bdd5fae..995d0f439 100644 --- a/src/conversions.cpp +++ b/src/conversions.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,6 +33,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #ifdef MAPNIK_KARMA_TO_STRING #include diff --git a/src/css_color_grammar.cpp b/src/css_color_grammar.cpp index a08e12922..2e9f60c92 100644 --- a/src/css_color_grammar.cpp +++ b/src/css_color_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/dasharray_parser.cpp b/src/dasharray_parser.cpp index 6d432dea6..489931954 100644 --- a/src/dasharray_parser.cpp +++ b/src/dasharray_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -26,6 +26,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include diff --git a/src/datasource_cache.cpp b/src/datasource_cache.cpp index a83f15797..eb2cfd0d7 100644 --- a/src/datasource_cache.cpp +++ b/src/datasource_cache.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,6 @@ #include #include #include -#include // boost #pragma GCC diagnostic push diff --git a/src/datasource_cache_static.cpp b/src/datasource_cache_static.cpp index 15f76bf6d..ba79d1d01 100644 --- a/src/datasource_cache_static.cpp +++ b/src/datasource_cache_static.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,12 +28,12 @@ #include // boost -#include #include #endif // stl #include +#include // static plugin linkage #ifdef MAPNIK_STATIC_PLUGINS @@ -88,7 +88,7 @@ datasource_ptr ds_generator(parameters const& params) } typedef datasource_ptr (*ds_generator_ptr)(parameters const& params); -using datasource_map = boost::unordered_map; +using datasource_map = std::unordered_map; static datasource_map ds_map = boost::assign::map_list_of #if defined(MAPNIK_STATIC_PLUGIN_CSV) diff --git a/src/debug.cpp b/src/debug.cpp index 4a519cd71..1a90df57f 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/expression.cpp b/src/expression.cpp index b8f430a0d..f4bdeeb84 100644 --- a/src/expression.cpp +++ b/src/expression.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/expression_grammar.cpp b/src/expression_grammar.cpp index 2aa47e66d..09234a07f 100644 --- a/src/expression_grammar.cpp +++ b/src/expression_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/expression_node.cpp b/src/expression_node.cpp index 3eef36057..43a4059b9 100644 --- a/src/expression_node.cpp +++ b/src/expression_node.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,12 +23,16 @@ #include #include #include +#include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" #if defined(BOOST_REGEX_HAS_ICU) #include #else #include #endif +#pragma GCC diagnostic pop namespace mapnik { @@ -91,7 +95,7 @@ std::string regex_match_node::to_string() const auto const& pattern = impl_.get()->pattern_; #if defined(BOOST_REGEX_HAS_ICU) std::string utf8; - value_unicode_string ustr = value_unicode_string::fromUTF32( &pattern.str()[0], pattern.str().length()); + value_unicode_string ustr = value_unicode_string::fromUTF32( &pattern.str()[0], safe_cast(pattern.str().length())); to_utf8(ustr,utf8); str_ += utf8; #else @@ -138,7 +142,7 @@ std::string regex_replace_node::to_string() const auto const& format = impl_.get()->format_; #if defined(BOOST_REGEX_HAS_ICU) std::string utf8; - value_unicode_string ustr = value_unicode_string::fromUTF32( &pattern.str()[0], pattern.str().length()); + value_unicode_string ustr = value_unicode_string::fromUTF32( &pattern.str()[0], safe_cast(pattern.str().length())); to_utf8(ustr,utf8); str_ += utf8; str_ +="','"; diff --git a/src/expression_string.cpp b/src/expression_string.cpp index 6fe39209e..0f904ee68 100644 --- a/src/expression_string.cpp +++ b/src/expression_string.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/feature_kv_iterator.cpp b/src/feature_kv_iterator.cpp index ae2543d93..8fdba826b 100644 --- a/src/feature_kv_iterator.cpp +++ b/src/feature_kv_iterator.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/feature_style_processor.cpp b/src/feature_style_processor.cpp index 94bfa6bbb..c041016d6 100644 --- a/src/feature_style_processor.cpp +++ b/src/feature_style_processor.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/feature_type_style.cpp b/src/feature_type_style.cpp index 4ee54e200..a2ddb33ba 100644 --- a/src/feature_type_style.cpp +++ b/src/feature_type_style.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/font_engine_freetype.cpp b/src/font_engine_freetype.cpp index ac78916ba..8f62842cb 100644 --- a/src/font_engine_freetype.cpp +++ b/src/font_engine_freetype.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/font_set.cpp b/src/font_set.cpp index 89f46b0fb..9236cac32 100644 --- a/src/font_set.cpp +++ b/src/font_set.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/fs.cpp b/src/fs.cpp index 0a129e4a6..9c87d97be 100644 --- a/src/fs.cpp +++ b/src/fs.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/function_call.cpp b/src/function_call.cpp index 99b1435d7..e813deef7 100644 --- a/src/function_call.cpp +++ b/src/function_call.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/geometry_reprojection.cpp b/src/geometry_reprojection.cpp index 0bdde2ff5..7cd3ff08d 100644 --- a/src/geometry_reprojection.cpp +++ b/src/geometry_reprojection.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/gradient.cpp b/src/gradient.cpp index 912739eba..ddf665870 100644 --- a/src/gradient.cpp +++ b/src/gradient.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/grid.cpp b/src/grid/grid.cpp index 279ac4c6e..b0d3d598d 100644 --- a/src/grid/grid.cpp +++ b/src/grid/grid.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/grid_renderer.cpp b/src/grid/grid_renderer.cpp index e48444242..93afb5b03 100644 --- a/src/grid/grid_renderer.cpp +++ b/src/grid/grid_renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -131,9 +131,9 @@ struct grid_render_marker_visitor grid_render_marker_visitor(buffer_type & pixmap, std::unique_ptr const& ras_ptr, renderer_common const& common, - mapnik::feature_impl const& feature, - pixel_position const& pos, - agg::trans_affine const& tr, + mapnik::feature_impl const& feature, + pixel_position const& pos, + agg::trans_affine const& tr, double opacity) : pixmap_(pixmap), ras_ptr_(ras_ptr), @@ -208,23 +208,23 @@ struct grid_render_marker_visitor boost::math::iround(pos_.y - cy)); } } - + private: buffer_type & pixmap_; std::unique_ptr const& ras_ptr_; renderer_common const& common_; - mapnik::feature_impl const& feature_; + mapnik::feature_impl const& feature_; pixel_position const& pos_; agg::trans_affine const& tr_; double opacity_; }; template -void grid_renderer::render_marker(mapnik::feature_impl const& feature, - pixel_position const& pos, - marker const& marker, - agg::trans_affine const& tr, - double opacity, +void grid_renderer::render_marker(mapnik::feature_impl const& feature, + pixel_position const& pos, + marker const& marker, + agg::trans_affine const& tr, + double opacity, composite_mode_e /*comp_op*/) { grid_render_marker_visitor visitor(pixmap_, diff --git a/src/grid/process_building_symbolizer.cpp b/src/grid/process_building_symbolizer.cpp index 48c2320a9..e6649da53 100644 --- a/src/grid/process_building_symbolizer.cpp +++ b/src/grid/process_building_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_group_symbolizer.cpp b/src/grid/process_group_symbolizer.cpp index e74140dc8..25c360027 100644 --- a/src/grid/process_group_symbolizer.cpp +++ b/src/grid/process_group_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -120,7 +120,7 @@ struct thunk_renderer render_raster_marker(ren, ras_, thunk.src_, feature_, offset_tr, thunk.opacity_); pixmap_.add_feature(feature_); } - + void operator()(text_render_thunk const &thunk) const { text_renderer_type ren(pixmap_, thunk.comp_op_, common_.scale_factor_); diff --git a/src/grid/process_line_pattern_symbolizer.cpp b/src/grid/process_line_pattern_symbolizer.cpp index 0b86c789b..d34f6e861 100644 --- a/src/grid/process_line_pattern_symbolizer.cpp +++ b/src/grid/process_line_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -82,7 +82,7 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, ras_ptr->reset(); - int stroke_width = mark->width(); + std::size_t stroke_width = mark->width(); agg::trans_affine tr; auto transform = get_optional(sym, keys::geometry_transform); diff --git a/src/grid/process_line_symbolizer.cpp b/src/grid/process_line_symbolizer.cpp index bbb540333..0dc6f3f6a 100644 --- a/src/grid/process_line_symbolizer.cpp +++ b/src/grid/process_line_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_markers_symbolizer.cpp b/src/grid/process_markers_symbolizer.cpp index cda2c7deb..b79807ec0 100644 --- a/src/grid/process_markers_symbolizer.cpp +++ b/src/grid/process_markers_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_point_symbolizer.cpp b/src/grid/process_point_symbolizer.cpp index ded85034a..731291d78 100644 --- a/src/grid/process_point_symbolizer.cpp +++ b/src/grid/process_point_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_polygon_pattern_symbolizer.cpp b/src/grid/process_polygon_pattern_symbolizer.cpp index cdd5affae..604c0c253 100644 --- a/src/grid/process_polygon_pattern_symbolizer.cpp +++ b/src/grid/process_polygon_pattern_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_polygon_symbolizer.cpp b/src/grid/process_polygon_symbolizer.cpp index 30f072f53..3e1f08932 100644 --- a/src/grid/process_polygon_symbolizer.cpp +++ b/src/grid/process_polygon_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_raster_symbolizer.cpp b/src/grid/process_raster_symbolizer.cpp index aff12a419..9e392a720 100644 --- a/src/grid/process_raster_symbolizer.cpp +++ b/src/grid/process_raster_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_shield_symbolizer.cpp b/src/grid/process_shield_symbolizer.cpp index 68935c6ba..ae4ffa2d1 100644 --- a/src/grid/process_shield_symbolizer.cpp +++ b/src/grid/process_shield_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/grid/process_text_symbolizer.cpp b/src/grid/process_text_symbolizer.cpp index 921ce1d71..a615a5db6 100644 --- a/src/grid/process_text_symbolizer.cpp +++ b/src/grid/process_text_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -54,14 +54,13 @@ void grid_renderer::process(text_symbolizer const& sym, grid_text_renderer ren(pixmap_, comp_op, common_.scale_factor_); - { // halo transform - agg::trans_affine halo_transform; - auto transform = get_optional(sym, keys::halo_transform); - if (transform) - { - evaluate_transform(halo_transform, feature, common_.vars_, *transform); - ren.set_halo_transform(halo_transform); - } + + auto halo_transform = get_optional(sym, keys::halo_transform); + if (halo_transform) + { + agg::trans_affine halo_affine_transform; + evaluate_transform(halo_affine_transform, feature, common_.vars_, *halo_transform); + ren.set_halo_transform(halo_affine_transform); } placements_list const& placements = helper.get(); diff --git a/src/group/group_layout_manager.cpp b/src/group/group_layout_manager.cpp index 7c6f7b8c6..fe00e7d02 100644 --- a/src/group/group_layout_manager.cpp +++ b/src/group/group_layout_manager.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,6 +23,7 @@ // mapnik #include #include +#include // std #include @@ -85,7 +86,7 @@ struct process_layout } bound_box layout_box; - size_t middle_ifirst = (member_boxes_.size() - 1) >> 1; + int middle_ifirst = safe_cast((member_boxes_.size() - 1) >> 1); int top_i = 0; int bottom_i = 0; if (middle_ifirst % 2 == 0) @@ -102,8 +103,8 @@ struct process_layout while (bottom_i >= 0 && top_i >= 0 && top_i < static_cast(member_offsets_.size())) { - layout_box.expand_to_include(make_horiz_pair(top_i, layout_box.miny() - y_margin, -1, x_margin, layout.get_max_difference())); - layout_box.expand_to_include(make_horiz_pair(bottom_i, layout_box.maxy() + y_margin, 1, x_margin, layout.get_max_difference())); + layout_box.expand_to_include(make_horiz_pair(static_cast(top_i), layout_box.miny() - y_margin, -1, x_margin, layout.get_max_difference())); + layout_box.expand_to_include(make_horiz_pair(static_cast(bottom_i), layout_box.maxy() + y_margin, 1, x_margin, layout.get_max_difference())); top_i -= 2; bottom_i += 2; } diff --git a/src/group/group_rule.cpp b/src/group/group_rule.cpp index 4ea7d9c34..a1a6bf940 100644 --- a/src/group/group_rule.cpp +++ b/src/group/group_rule.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/group/group_symbolizer_helper.cpp b/src/group/group_symbolizer_helper.cpp index 338e5410e..a8e453a69 100644 --- a/src/group/group_symbolizer_helper.cpp +++ b/src/group/group_symbolizer_helper.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/image.cpp b/src/image.cpp index 408b29c84..caa0a8fc1 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/image_any.cpp b/src/image_any.cpp index bfa3478ba..5ba0c3947 100644 --- a/src/image_any.cpp +++ b/src/image_any.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/image_compositing.cpp b/src/image_compositing.cpp index 548332591..83684e442 100644 --- a/src/image_compositing.cpp +++ b/src/image_compositing.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,11 +24,15 @@ #include #include #include +#include +#include // boost #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wredeclared-class-member" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop @@ -123,31 +127,6 @@ For example, if you generate some pattern with AGG (premultiplied) and would lik */ -namespace detail { - -// non-mutable rendering_buffer implementation -template -struct rendering_buffer -{ - using image_type = T; - using pixel_type = typename image_type::pixel_type; - using row_data = agg::const_row_info; - - rendering_buffer(T const& data) - : data_(data) {} - - uint8_t const* buf() const { return data_.bytes(); } - unsigned width() const { return data_.width();} - unsigned height() const { return data_.height();} - int stride() const { return data_.row_size();} - uint8_t const* row_ptr(int, int y, unsigned) {return row_ptr(y);} - uint8_t const* row_ptr(int y) const { return reinterpret_cast(data_.get_row(y)); } - row_data row (int y) const { return row_data(0, data_.width() - 1, row_ptr(y)); } - image_type const& data_; -}; - -} // end detail ns - template <> MAPNIK_DECL void composite(image_rgba8 & dst, image_rgba8 const& src, composite_mode_e mode, float opacity, @@ -156,16 +135,16 @@ MAPNIK_DECL void composite(image_rgba8 & dst, image_rgba8 const& src, composite_ { using color = agg::rgba8; using order = agg::order_rgba; - using const_rendering_buffer = detail::rendering_buffer; + using const_rendering_buffer = util::rendering_buffer; using blender_type = agg::comp_op_adaptor_rgba_pre; using pixfmt_type = agg::pixfmt_custom_blend_rgba; using renderer_type = agg::renderer_base; - agg::rendering_buffer dst_buffer(dst.bytes(),dst.width(),dst.height(),dst.row_size()); + agg::rendering_buffer dst_buffer(dst.bytes(),safe_cast(dst.width()),safe_cast(dst.height()),safe_cast(dst.row_size())); const_rendering_buffer src_buffer(src); pixfmt_type pixf(dst_buffer); pixf.comp_op(static_cast(mode)); - agg::pixfmt_alpha_blend_rgba pixf_mask(src_buffer); + agg::pixfmt_alpha_blend_rgba pixf_mask(src_buffer); #ifdef MAPNIK_DEBUG if (!src.get_premultiplied()) { @@ -177,21 +156,21 @@ MAPNIK_DECL void composite(image_rgba8 & dst, image_rgba8 const& src, composite_ } #endif renderer_type ren(pixf); - ren.blend_from(pixf_mask,0,dx,dy,unsigned(255*opacity)); + ren.blend_from(pixf_mask,0,dx,dy,safe_cast(255*opacity)); } template <> -MAPNIK_DECL void composite(image_gray32f & dst, image_gray32f const& src, composite_mode_e mode, - float opacity, +MAPNIK_DECL void composite(image_gray32f & dst, image_gray32f const& src, composite_mode_e /*mode*/, + float /*opacity*/, int dx, int dy) { - using const_rendering_buffer = detail::rendering_buffer; + using const_rendering_buffer = util::rendering_buffer; using src_pixfmt_type = agg::pixfmt_alpha_blend_gray, const_rendering_buffer, 1, 0>; using dst_pixfmt_type = agg::pixfmt_alpha_blend_gray, agg::rendering_buffer, 1, 0>; using renderer_type = agg::renderer_base; - agg::rendering_buffer dst_buffer(dst.bytes(),dst.width(),dst.height(),dst.width()); + agg::rendering_buffer dst_buffer(dst.bytes(),safe_cast(dst.width()),safe_cast(dst.height()),safe_cast(dst.width())); const_rendering_buffer src_buffer(src); dst_pixfmt_type pixf(dst_buffer); src_pixfmt_type pixf_mask(src_buffer); diff --git a/src/image_copy.cpp b/src/image_copy.cpp index 123806a15..01225c25b 100644 --- a/src/image_copy.cpp +++ b/src/image_copy.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,13 +24,7 @@ #include #include #include - -// boost -#include - -using boost::numeric_cast; -using boost::numeric::positive_overflow; -using boost::numeric::negative_overflow; +#include namespace mapnik { @@ -56,23 +50,12 @@ struct visitor_image_copy template T0 operator() (T1 const& src) { - T0 dst(src.width(), src.height(), false); - for (unsigned y = 0; y < dst.height(); ++y) + T0 dst(safe_cast(src.width()), safe_cast(src.height()), false); + for (std::size_t y = 0; y < dst.height(); ++y) { - for (unsigned x = 0; x < dst.width(); ++x) + for (std::size_t x = 0; x < dst.width(); ++x) { - try - { - dst(x,y) = numeric_cast(src(x,y)); - } - catch(negative_overflow&) - { - dst(x,y) = std::numeric_limits::min(); - } - catch(positive_overflow&) - { - dst(x,y) = std::numeric_limits::max(); - } + dst(x,y) = safe_cast(src(x,y)); } } return T0(std::move(dst)); @@ -112,27 +95,16 @@ struct visitor_image_copy_so { double src_offset = src.get_offset(); double src_scaling = src.get_scaling(); - T0 dst(src.width(), src.height(), false); + T0 dst(safe_cast(src.width()), safe_cast(src.height()), false); dst.set_scaling(scaling_); dst.set_offset(offset_); - for (unsigned y = 0; y < dst.height(); ++y) + for (std::size_t y = 0; y < dst.height(); ++y) { - for (unsigned x = 0; x < dst.width(); ++x) + for (std::size_t x = 0; x < dst.width(); ++x) { - double scaled_src_val = (numeric_cast(src(x,y)) * src_scaling) + src_offset; + double scaled_src_val = (safe_cast(src(x,y)) * src_scaling) + src_offset; double dst_val = (scaled_src_val - offset_) / scaling_; - try - { - dst(x,y) = numeric_cast(dst_val); - } - catch(negative_overflow&) - { - dst(x,y) = std::numeric_limits::min(); - } - catch(positive_overflow&) - { - dst(x,y) = std::numeric_limits::max(); - } + dst(x,y) = safe_cast(dst_val); } } return T0(std::move(dst)); diff --git a/src/image_filter_types.cpp b/src/image_filter_types.cpp index 0b28b07c0..2212db998 100644 --- a/src/image_filter_types.cpp +++ b/src/image_filter_types.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,6 +29,9 @@ #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" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #pragma GCC diagnostic pop diff --git a/src/image_options.cpp b/src/image_options.cpp index 0c102aeb1..3b1b1fe07 100644 --- a/src/image_options.cpp +++ b/src/image_options.cpp @@ -21,8 +21,16 @@ *****************************************************************************/ #include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include +#pragma GCC diagnostic pop namespace mapnik { namespace detail { diff --git a/src/image_reader.cpp b/src/image_reader.cpp index e3e708b31..d0ec815b9 100644 --- a/src/image_reader.cpp +++ b/src/image_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/image_scaling.cpp b/src/image_scaling.cpp index 6b9f9bcef..dd3dcebf2 100644 --- a/src/image_scaling.cpp +++ b/src/image_scaling.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,6 +31,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wredeclared-class-member" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop diff --git a/src/image_util.cpp b/src/image_util.cpp index 0f3951ab3..63d544088 100644 --- a/src/image_util.cpp +++ b/src/image_util.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef SSE_MATH #include @@ -51,16 +52,9 @@ #include #include -// boost -#include - namespace mapnik { -using boost::numeric_cast; -using boost::numeric::positive_overflow; -using boost::numeric::negative_overflow; - template MAPNIK_DECL std::string save_to_string(T const& image, std::string const& type, @@ -495,7 +489,7 @@ struct premultiply_visitor { if (!data.get_premultiplied()) { - agg::rendering_buffer buffer(data.bytes(),data.width(),data.height(),data.row_size()); + agg::rendering_buffer buffer(data.bytes(),safe_cast(data.width()),safe_cast(data.height()),safe_cast(data.row_size())); agg::pixfmt_rgba32 pixf(buffer); pixf.premultiply(); data.set_premultiplied(true); @@ -517,7 +511,7 @@ struct demultiply_visitor { if (data.get_premultiplied()) { - agg::rendering_buffer buffer(data.bytes(),data.width(),data.height(),data.row_size()); + agg::rendering_buffer buffer(data.bytes(),safe_cast(data.width()),safe_cast(data.height()),safe_cast(data.row_size())); agg::pixfmt_rgba32_pre pixf(buffer); pixf.demultiply(); data.set_premultiplied(false); @@ -647,12 +641,12 @@ struct visitor_apply_opacity for (std::size_t x = 0; x < data.width(); ++x) { pixel_type rgba = row_to[x]; - pixel_type a = static_cast(((rgba >> 24) & 0xff) * opacity_); + pixel_type a = static_cast(((rgba >> 24u) & 0xff) * opacity_); pixel_type r = rgba & 0xff; - pixel_type g = (rgba >> 8 ) & 0xff; - pixel_type b = (rgba >> 16) & 0xff; + pixel_type g = (rgba >> 8u ) & 0xff; + pixel_type b = (rgba >> 16u) & 0xff; - row_to[x] = (a << 24)| (b << 16) | (g << 8) | (r) ; + row_to[x] = (a << 24u) | (b << 16u) | (g << 8u) | (r) ; } } } @@ -719,13 +713,13 @@ struct visitor_set_grayscale_to_alpha { pixel_type rgba = row_from[x]; pixel_type r = rgba & 0xff; - pixel_type g = (rgba >> 8 ) & 0xff; - pixel_type b = (rgba >> 16) & 0xff; + pixel_type g = (rgba >> 8u) & 0xff; + pixel_type b = (rgba >> 16u) & 0xff; // magic numbers for grayscale pixel_type a = static_cast(std::ceil((r * .3) + (g * .59) + (b * .11))); - row_from[x] = (a << 24)| (255 << 16) | (255 << 8) | (255) ; + row_from[x] = (a << 24u) | (255 << 16u) | (255 << 8u) | (255u) ; } } } @@ -758,7 +752,10 @@ struct visitor_set_grayscale_to_alpha_c // magic numbers for grayscale pixel_type a = static_cast(std::ceil((r * .3) + (g * .59) + (b * .11))); - row_from[x] = (a << 24)| (c_.blue() << 16) | (c_.green() << 8) | (c_.red()) ; + row_from[x] = static_cast(a << 24u) | + static_cast(c_.blue() << 16u) | + static_cast(c_.green() << 8u) | + static_cast(c_.red() ); } } } @@ -936,20 +933,7 @@ struct visitor_fill void operator() (T2 & data) const { using pixel_type = typename T2::pixel_type; - pixel_type val; - try - { - val = numeric_cast(val_); - } - catch(negative_overflow&) - { - val = std::numeric_limits::min(); - } - catch(positive_overflow&) - { - val = std::numeric_limits::max(); - } - data.set(val); + data.set(safe_cast(val_)); } private: @@ -1211,99 +1195,6 @@ template MAPNIK_DECL void fill(image_gray64f &, int8_t const&); template MAPNIK_DECL void fill(image_gray64f &, float const&); template MAPNIK_DECL void fill(image_gray64f &, double const&); -namespace detail { - -struct visitor_set_rectangle -{ - visitor_set_rectangle(image_any const & src, std::size_t x0, std::size_t y0) - : src_(src), x0_(x0), y0_(y0) {} - - void operator()(image_rgba8 & dst) const - { - using pixel_type = image_rgba8::pixel_type; - image_rgba8 src = util::get(src_); - box2d ext0(0,0,dst.width(),dst.height()); - box2d ext1(x0_,y0_,x0_+src.width(),y0_+src.height()); - - if (ext0.intersects(ext1)) - { - box2d box = ext0.intersect(ext1); - for (std::size_t y = box.miny(); y < box.maxy(); ++y) - { - pixel_type* row_to = dst.get_row(y); - pixel_type const * row_from = src.get_row(y-y0_); - - for (std::size_t x = box.minx(); x < box.maxx(); ++x) - { - if (row_from[x-x0_] & 0xff000000) // Don't change if alpha == 0 - { - row_to[x] = row_from[x-x0_]; - } - } - } - } - } - - void operator() (image_null &) const - { - throw std::runtime_error("Set rectangle not support for null images"); - } - - template - void operator() (T & dst) const - { - using pixel_type = typename T::pixel_type; - T src = util::get(src_); - box2d ext0(0,0,dst.width(),dst.height()); - box2d ext1(x0_,y0_,x0_+src.width(),y0_+src.height()); - - if (ext0.intersects(ext1)) - { - box2d box = ext0.intersect(ext1); - for (std::size_t y = box.miny(); y < box.maxy(); ++y) - { - pixel_type* row_to = dst.get_row(y); - pixel_type const * row_from = src.get_row(y-y0_); - - for (std::size_t x = box.minx(); x < box.maxx(); ++x) - { - row_to[x] = row_from[x-x0_]; - } - } - } - } -private: - image_any const& src_; - std::size_t x0_; - std::size_t y0_; -}; - -} // end detail ns - -MAPNIK_DECL void set_rectangle(image_any & dst, image_any const& src, std::size_t x, std::size_t y) -{ - util::apply_visitor(detail::visitor_set_rectangle(src, x, y), dst); -} - -template -MAPNIK_DECL void set_rectangle (T & dst, T const& src, std::size_t x, std::size_t y) -{ - detail::visitor_set_rectangle visit(src, x, y); - visit(dst); -} - -template MAPNIK_DECL void set_rectangle(image_rgba8 &, image_rgba8 const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray8 &, image_gray8 const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray8s &, image_gray8s const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray16 &, image_gray16 const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray16s &, image_gray16s const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray32 &, image_gray32 const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray32s &, image_gray32s const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray32f &, image_gray32f const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray64 &, image_gray64 const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray64s &, image_gray64s const&, std::size_t, std::size_t); -template MAPNIK_DECL void set_rectangle(image_gray64f &, image_gray64f const&, std::size_t, std::size_t); - namespace detail { @@ -1329,9 +1220,10 @@ struct visitor_composite_pixel if (mapnik::check_bounds(data, x_, y_)) { image_rgba8::pixel_type rgba = data(x_,y_); - value_type ca = static_cast(((c_ >> 24) & 0xff) * opacity_); - value_type cb = (c_ >> 16 ) & 0xff; - value_type cg = (c_ >> 8) & 0xff; + // TODO use std::round for consistent rounding + value_type ca = safe_cast(((c_ >> 24u) & 0xff) * opacity_); + value_type cb = (c_ >> 16u) & 0xff; + value_type cg = (c_ >> 8u) & 0xff; value_type cr = (c_ & 0xff); blender_type::blend_pix(comp_op_, reinterpret_cast(&rgba), cr, cg, cb, ca, cover_); data(x_,y_) = rgba; @@ -1339,7 +1231,7 @@ struct visitor_composite_pixel } template - void operator() (T & data) const + void operator() (T &) const { throw std::runtime_error("Composite pixel is not supported for this data type"); } @@ -1349,7 +1241,7 @@ private: composite_mode_e comp_op_; std::size_t const x_; std::size_t const y_; - int const c_; + unsigned const c_; unsigned const cover_; }; @@ -1392,22 +1284,9 @@ struct visitor_set_pixel void operator() (T2 & data) const { using pixel_type = typename T2::pixel_type; - pixel_type val; - try - { - val = numeric_cast(val_); - } - catch(negative_overflow&) - { - val = std::numeric_limits::min(); - } - catch(positive_overflow&) - { - val = std::numeric_limits::max(); - } if (check_bounds(data, x_, y_)) { - data(x_, y_) = val; + data(x_, y_) = safe_cast(val_); } } @@ -1699,20 +1578,7 @@ struct visitor_get_pixel using pixel_type = T1; if (check_bounds(data, x_, y_)) { - T1 val; - try - { - val = numeric_cast(data(x_,y_)); - } - catch(negative_overflow&) - { - val = std::numeric_limits::min(); - } - catch(positive_overflow&) - { - val = std::numeric_limits::max(); - } - return val; + return safe_cast(data(x_, y_)); } else { @@ -2220,7 +2086,7 @@ struct visitor_view_to_stream for (std::size_t i=0;i(view.get_row(i)), - view.row_size()); + safe_cast(view.row_size())); } } @@ -2389,11 +2255,11 @@ MAPNIK_DECL std::size_t compare(image_rgba8 const& im1, image_rgba8 unsigned rgba = row_from[x]; unsigned rgba2 = row_from2[x]; unsigned r = rgba & 0xff; - unsigned g = (rgba >> 8 ) & 0xff; - unsigned b = (rgba >> 16) & 0xff; + unsigned g = (rgba >> 8u) & 0xff; + unsigned b = (rgba >> 16u) & 0xff; unsigned r2 = rgba2 & 0xff; - unsigned g2 = (rgba2 >> 8 ) & 0xff; - unsigned b2 = (rgba2 >> 16) & 0xff; + unsigned g2 = (rgba2 >> 8u) & 0xff; + unsigned b2 = (rgba2 >> 16u) & 0xff; if (std::abs(static_cast(r - r2)) > static_cast(threshold) || std::abs(static_cast(g - g2)) > static_cast(threshold) || std::abs(static_cast(b - b2)) > static_cast(threshold)) { @@ -2401,8 +2267,8 @@ MAPNIK_DECL std::size_t compare(image_rgba8 const& im1, image_rgba8 continue; } if (alpha) { - unsigned a = (rgba >> 24) & 0xff; - unsigned a2 = (rgba2 >> 24) & 0xff; + unsigned a = (rgba >> 24u) & 0xff; + unsigned a2 = (rgba2 >> 24u) & 0xff; if (std::abs(static_cast(a - a2)) > static_cast(threshold)) { ++difference; continue; @@ -2427,11 +2293,11 @@ MAPNIK_DECL std::size_t compare(image_rgba8 const& im1, image_rgba8 unsigned rgba = row_from[x]; unsigned rgba2 = row_from2[x]; unsigned r = rgba & 0xff; - unsigned g = (rgba >> 8 ) & 0xff; - unsigned b = (rgba >> 16) & 0xff; + unsigned g = (rgba >> 8u) & 0xff; + unsigned b = (rgba >> 16u) & 0xff; unsigned r2 = rgba2 & 0xff; - unsigned g2 = (rgba2 >> 8 ) & 0xff; - unsigned b2 = (rgba2 >> 16) & 0xff; + unsigned g2 = (rgba2 >> 8u) & 0xff; + unsigned b2 = (rgba2 >> 16u) & 0xff; if (std::abs(static_cast(r - r2)) > static_cast(threshold) || std::abs(static_cast(g - g2)) > static_cast(threshold) || std::abs(static_cast(b - b2)) > static_cast(threshold)) { @@ -2439,8 +2305,8 @@ MAPNIK_DECL std::size_t compare(image_rgba8 const& im1, image_rgba8 continue; } if (alpha) { - unsigned a = (rgba >> 24) & 0xff; - unsigned a2 = (rgba2 >> 24) & 0xff; + unsigned a = (rgba >> 24u) & 0xff; + unsigned a2 = (rgba2 >> 24u) & 0xff; if (std::abs(static_cast(a - a2)) > static_cast(threshold)) { ++difference; continue; diff --git a/src/image_util_jpeg.cpp b/src/image_util_jpeg.cpp index 14fbd0f15..22d6ed480 100644 --- a/src/image_util_jpeg.cpp +++ b/src/image_util_jpeg.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/image_util_png.cpp b/src/image_util_png.cpp index 8c11f2a0a..f2b051717 100644 --- a/src/image_util_png.cpp +++ b/src/image_util_png.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -216,8 +216,6 @@ void process_rgba8_png_pal(T const& image, handle_png_options(t, opts); if (pal.valid()) { - png_options opts; - handle_png_options(t,opts); save_as_png8_pal(stream, image, pal, opts); } else if (opts.paletted) diff --git a/src/image_util_tiff.cpp b/src/image_util_tiff.cpp index 3ac72fc95..68ef9d9f8 100644 --- a/src/image_util_tiff.cpp +++ b/src/image_util_tiff.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/image_util_webp.cpp b/src/image_util_webp.cpp index c521e1c20..c7b96aca5 100644 --- a/src/image_util_webp.cpp +++ b/src/image_util_webp.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/image_view.cpp b/src/image_view.cpp index 680e54ef5..44e4d7716 100644 --- a/src/image_view.cpp +++ b/src/image_view.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/image_view_any.cpp b/src/image_view_any.cpp index 8bf89b45b..6fbbd7be4 100644 --- a/src/image_view_any.cpp +++ b/src/image_view_any.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -47,7 +47,7 @@ struct get_view_height_visitor struct get_view_size_visitor { template - unsigned operator()(T const& data) const + std::size_t operator()(T const& data) const { return data.size(); } @@ -65,7 +65,7 @@ struct get_view_dtype_visitor struct get_view_row_size_visitor { template - unsigned operator()(T const& data) const + std::size_t operator()(T const& data) const { return data.row_size(); } diff --git a/src/jpeg_reader.cpp b/src/jpeg_reader.cpp index 213469403..4a6284cb8 100644 --- a/src/jpeg_reader.cpp +++ b/src/jpeg_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -206,8 +206,11 @@ void jpeg_reader::attach_stream (j_decompress_ptr cinfo, input_stream* in) } template -void jpeg_reader::on_error(j_common_ptr /*cinfo*/) +void jpeg_reader::on_error(j_common_ptr cinfo) { + char buffer[JMSG_LENGTH_MAX]; + (*cinfo->err->format_message)(cinfo, buffer); + throw image_reader_exception(std::string("JPEG Reader: libjpeg could not read image: ") + buffer); } template diff --git a/src/json/build.py b/src/json/build.py index 2e6902fc5..390465df5 100644 --- a/src/json/build.py +++ b/src/json/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2014 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/src/json/mapnik_json_feature_collection_grammar.cpp b/src/json/mapnik_json_feature_collection_grammar.cpp index 9e13d9423..5f598f54b 100644 --- a/src/json/mapnik_json_feature_collection_grammar.cpp +++ b/src/json/mapnik_json_feature_collection_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/json/mapnik_json_feature_grammar.cpp b/src/json/mapnik_json_feature_grammar.cpp index 3742dfd30..1aa6c7e9e 100644 --- a/src/json/mapnik_json_feature_grammar.cpp +++ b/src/json/mapnik_json_feature_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/json/mapnik_json_generator_grammar.cpp b/src/json/mapnik_json_generator_grammar.cpp index 10b13829a..2b0171f98 100644 --- a/src/json/mapnik_json_generator_grammar.cpp +++ b/src/json/mapnik_json_generator_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/json/mapnik_json_geometry_grammar.cpp b/src/json/mapnik_json_geometry_grammar.cpp index 73456fac0..f2b96f230 100644 --- a/src/json/mapnik_json_geometry_grammar.cpp +++ b/src/json/mapnik_json_geometry_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/json/mapnik_topojson_grammar.cpp b/src/json/mapnik_topojson_grammar.cpp index 81d6552f4..e70f7c590 100644 --- a/src/json/mapnik_topojson_grammar.cpp +++ b/src/json/mapnik_topojson_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/layer.cpp b/src/layer.cpp index 1a9cf8387..442026b4d 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/libxml2_loader.cpp b/src/libxml2_loader.cpp index 70ca728e8..3c904074c 100644 --- a/src/libxml2_loader.cpp +++ b/src/libxml2_loader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/load_map.cpp b/src/load_map.cpp index fc38407ab..44d1276db 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -80,7 +80,7 @@ using boost::optional; constexpr unsigned name2int(const char *str, int off = 0) { - return !str[off] ? 5381 : (name2int(str, off+1)*33) ^ str[off]; + return !str[off] ? 5381 : (name2int(str, off+1)*33) ^ static_cast(str[off]); } class map_parser : util::noncopyable @@ -147,8 +147,7 @@ private: void load_map(Map & map, std::string const& filename, bool strict, std::string base_path) { - // TODO - use xml encoding? - xml_tree tree("utf8"); + xml_tree tree; tree.set_filename(filename); read_xml(filename, tree.root()); map_parser parser(map, strict, filename); @@ -157,8 +156,7 @@ void load_map(Map & map, std::string const& filename, bool strict, std::string b void load_map_string(Map & map, std::string const& str, bool strict, std::string base_path) { - // TODO - use xml encoding? - xml_tree tree("utf8"); + xml_tree tree; if (!base_path.empty()) { read_xml_string(str, tree.root(), base_path); // accept base_path passed into function @@ -237,7 +235,7 @@ void map_parser::parse_map(Map & map, xml_node const& node, std::string const& b } map.set_srs(srs); - optional buffer_size = map_node.get_opt_attr("buffer-size"); + optional buffer_size = map_node.get_opt_attr("buffer-size"); if (buffer_size) { map.set_buffer_size(*buffer_size); @@ -648,7 +646,7 @@ void map_parser::parse_layer(Map & map, xml_node const& node) lyr.set_group_by(* group_by); } - optional buffer_size = node.get_opt_attr("buffer-size"); + optional buffer_size = node.get_opt_attr("buffer-size"); if (buffer_size) { lyr.set_buffer_size(*buffer_size); diff --git a/src/map.cpp b/src/map.cpp index 5b9bc7867..a891ebd73 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/mapped_memory_cache.cpp b/src/mapped_memory_cache.cpp index c589681e8..abe08d1b9 100644 --- a/src/mapped_memory_cache.cpp +++ b/src/mapped_memory_cache.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -29,8 +29,12 @@ // boost #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include +#pragma GCC diagnostic pop namespace mapnik { diff --git a/src/marker_cache.cpp b/src/marker_cache.cpp index 0f63c6d62..3f8f9396b 100644 --- a/src/marker_cache.cpp +++ b/src/marker_cache.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -72,8 +72,7 @@ void marker_cache::clear() #ifdef MAPNIK_THREADSAFE std::lock_guard lock(mutex_); #endif - using iterator_type = boost::unordered_map >::const_iterator; - iterator_type itr = marker_cache_.begin(); + auto itr = marker_cache_.begin(); while(itr != marker_cache_.end()) { if (!is_uri(itr->first)) @@ -100,8 +99,7 @@ bool marker_cache::is_image_uri(std::string const& path) bool marker_cache::insert_svg(std::string const& name, std::string const& svg_string) { std::string key = known_svg_prefix_ + name; - using iterator_type = boost::unordered_map::const_iterator; - iterator_type itr = svg_cache_.find(key); + auto itr = svg_cache_.find(key); if (itr == svg_cache_.end()) { return svg_cache_.emplace(key,svg_string).second; @@ -128,13 +126,13 @@ struct visitor_create_marker return mapnik::marker(mapnik::marker_rgba8(data)); } - marker operator() (image_null & data) + marker operator() (image_null &) { throw std::runtime_error("Can not make marker from null image data type"); } template - marker operator() (T & data) + marker operator() (T &) { throw std::runtime_error("Can not make marker from this data type"); } @@ -153,8 +151,7 @@ std::shared_ptr marker_cache::find(std::string const& uri, #ifdef MAPNIK_THREADSAFE std::lock_guard lock(mutex_); #endif - using iterator_type = boost::unordered_map >::const_iterator; - iterator_type itr = marker_cache_.find(uri); + auto itr = marker_cache_.find(uri); if (itr != marker_cache_.end()) { return itr->second; @@ -165,7 +162,7 @@ std::shared_ptr marker_cache::find(std::string const& uri, // if uri references a built-in marker if (is_svg_uri(uri)) { - boost::unordered_map::const_iterator mark_itr = svg_cache_.find(uri); + auto mark_itr = svg_cache_.find(uri); if (mark_itr == svg_cache_.end()) { MAPNIK_LOG_ERROR(marker_cache) << "Marker does not exist: " << uri; diff --git a/src/marker_helpers.cpp b/src/marker_helpers.cpp index 57c32705a..cf37cdbe4 100644 --- a/src/marker_helpers.cpp +++ b/src/marker_helpers.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/memory_datasource.cpp b/src/memory_datasource.cpp index eb107d394..c30f6745f 100644 --- a/src/memory_datasource.cpp +++ b/src/memory_datasource.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/miniz_png.cpp b/src/miniz_png.cpp index 183730185..fb2658545 100644 --- a/src/miniz_png.cpp +++ b/src/miniz_png.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -30,9 +30,14 @@ #define MINIZ_NO_ARCHIVE_APIS #define MINIZ_NO_ZLIB_COMPATIBLE_NAMES +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" extern "C" { #include "miniz.c" } +#pragma GCC diagnostic pop + // zlib #include diff --git a/src/palette.cpp b/src/palette.cpp index 803e0efe2..54e4346b5 100644 --- a/src/palette.cpp +++ b/src/palette.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/params.cpp b/src/params.cpp index 014a5c272..8d3a2c859 100644 --- a/src/params.cpp +++ b/src/params.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/parse_path.cpp b/src/parse_path.cpp index 0064f3ab3..a3d67c2cb 100644 --- a/src/parse_path.cpp +++ b/src/parse_path.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/parse_transform.cpp b/src/parse_transform.cpp index c9403014c..e2daaf480 100644 --- a/src/parse_transform.cpp +++ b/src/parse_transform.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/plugin.cpp b/src/plugin.cpp index b803a502f..7b057284e 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/png_reader.cpp b/src/png_reader.cpp index 08619ec57..03968c051 100644 --- a/src/png_reader.cpp +++ b/src/png_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/proj_transform.cpp b/src/proj_transform.cpp index f929a7ac9..a08b4d7dd 100644 --- a/src/proj_transform.cpp +++ b/src/proj_transform.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -163,6 +163,13 @@ bool proj_transform::forward (double * x, double * y , double * z, int point_cou return false; } + for(int j=0; j -#include #include #include diff --git a/src/rapidxml_loader.cpp b/src/rapidxml_loader.cpp index 97bcc503b..c0a631f69 100644 --- a/src/rapidxml_loader.cpp +++ b/src/rapidxml_loader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/raster_colorizer.cpp b/src/raster_colorizer.cpp index a48dbdf6c..22d3ee88a 100644 --- a/src/raster_colorizer.cpp +++ b/src/raster_colorizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/renderer_common.cpp b/src/renderer_common.cpp index ecba13655..37223e35d 100644 --- a/src/renderer_common.cpp +++ b/src/renderer_common.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ #include #include #include +#include namespace mapnik { diff --git a/src/renderer_common/process_group_symbolizer.cpp b/src/renderer_common/process_group_symbolizer.cpp index 33a8c2ba9..9f80b5010 100644 --- a/src/renderer_common/process_group_symbolizer.cpp +++ b/src/renderer_common/process_group_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/renderer_common/render_pattern.cpp b/src/renderer_common/render_pattern.cpp index 67ddbe55e..06477d460 100644 --- a/src/renderer_common/render_pattern.cpp +++ b/src/renderer_common/render_pattern.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/request.cpp b/src/request.cpp index 46fc220cc..f74f62c38 100644 --- a/src/request.cpp +++ b/src/request.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/rule.cpp b/src/rule.cpp index 55a1ba256..2fec472a0 100644 --- a/src/rule.cpp +++ b/src/rule.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/save_map.cpp b/src/save_map.cpp index 42314d011..d757f9e7f 100644 --- a/src/save_map.cpp +++ b/src/save_map.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -52,11 +52,12 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" #include +#pragma GCC diagnostic ignored "-Wsign-conversion" +#include +#include #pragma GCC diagnostic pop #include #include -#include -#include // stl #include @@ -87,12 +88,12 @@ void serialize_text_placements(ptree & node, text_placements_ptr const& p, bool { set_attr(node, "placement-type", "list"); //dfl = last properties passed as default so only attributes that change are actually written - text_symbolizer_properties *dfl = &(list->defaults); + text_symbolizer_properties *dfl2 = &(list->defaults); for (unsigned i=0; i < list->size(); ++i) { ptree & placement_node = node.push_back(ptree::value_type("Placement", ptree()))->second; - list->get(i).to_xml(placement_node, explicit_defaults, *dfl); - dfl = &(list->get(i)); + list->get(i).to_xml(placement_node, explicit_defaults, *dfl2); + dfl2 = &(list->get(i)); } } } @@ -464,13 +465,12 @@ void serialize_fontset( ptree & map_node, std::string const& name, font_set cons set_attr(fontset_node, "name", name); - for (auto const& name : fontset.get_face_names()) + for (auto const& face_name : fontset.get_face_names()) { ptree & font_node = fontset_node.push_back( ptree::value_type("Font", ptree()))->second; - set_attr(font_node, "face-name", name); + set_attr(font_node, "face-name", face_name); } - } void serialize_datasource( ptree & layer_node, datasource_ptr datasource) @@ -506,63 +506,63 @@ void serialize_parameters( ptree & map_node, mapnik::parameters const& params) } } -void serialize_layer( ptree & map_node, const layer & layer, bool explicit_defaults ) +void serialize_layer( ptree & map_node, layer const& lyr, bool explicit_defaults ) { ptree & layer_node = map_node.push_back( ptree::value_type("Layer", ptree()))->second; - if ( layer.name() != "" ) + if ( lyr.name() != "" ) { - set_attr( layer_node, "name", layer.name() ); + set_attr( layer_node, "name", lyr.name() ); } - if ( layer.srs() != "" ) + if ( lyr.srs() != "" ) { - set_attr( layer_node, "srs", layer.srs() ); + set_attr( layer_node, "srs", lyr.srs() ); } - if ( !layer.active() || explicit_defaults ) + if ( !lyr.active() || explicit_defaults ) { - set_attr/**/( layer_node, "status", layer.active() ); + set_attr/**/( layer_node, "status", lyr.active() ); } - if ( layer.clear_label_cache() || explicit_defaults ) + if ( lyr.clear_label_cache() || explicit_defaults ) { - set_attr/**/( layer_node, "clear-label-cache", layer.clear_label_cache() ); + set_attr/**/( layer_node, "clear-label-cache", lyr.clear_label_cache() ); } - if ( layer.minimum_scale_denominator() ) + if ( lyr.minimum_scale_denominator() != 0 || explicit_defaults ) { - set_attr( layer_node, "minimum_scale_denominator", layer.minimum_scale_denominator() ); + set_attr( layer_node, "minimum_scale_denominator", lyr.minimum_scale_denominator() ); } - if ( layer.maximum_scale_denominator() != std::numeric_limits::max() ) + if ( lyr.maximum_scale_denominator() != std::numeric_limits::max() || explicit_defaults ) { - set_attr( layer_node, "maximum_scale_denominator", layer.maximum_scale_denominator() ); + set_attr( layer_node, "maximum_scale_denominator", lyr.maximum_scale_denominator() ); } - if ( layer.queryable() || explicit_defaults ) + if ( lyr.queryable() || explicit_defaults ) { - set_attr( layer_node, "queryable", layer.queryable() ); + set_attr( layer_node, "queryable", lyr.queryable() ); } - if ( layer.cache_features() || explicit_defaults ) + if ( lyr.cache_features() || explicit_defaults ) { - set_attr/**/( layer_node, "cache-features", layer.cache_features() ); + set_attr/**/( layer_node, "cache-features", lyr.cache_features() ); } - if ( layer.group_by() != "" || explicit_defaults ) + if ( lyr.group_by() != "" || explicit_defaults ) { - set_attr( layer_node, "group-by", layer.group_by() ); + set_attr( layer_node, "group-by", lyr.group_by() ); } - boost::optional const& buffer_size = layer.buffer_size(); + boost::optional const& buffer_size = lyr.buffer_size(); if ( buffer_size || explicit_defaults) { set_attr( layer_node, "buffer-size", *buffer_size ); } - optional > const& maximum_extent = layer.maximum_extent(); + optional > const& maximum_extent = lyr.maximum_extent(); if ( maximum_extent) { std::ostringstream s; @@ -572,7 +572,7 @@ void serialize_layer( ptree & map_node, const layer & layer, bool explicit_defau set_attr( layer_node, "maximum-extent", s.str() ); } - for (auto const& name : layer.styles()) + for (auto const& name : lyr.styles()) { boost::property_tree::ptree & style_node = layer_node.push_back( boost::property_tree::ptree::value_type("StyleName", @@ -580,7 +580,7 @@ void serialize_layer( ptree & map_node, const layer & layer, bool explicit_defau style_node.put_value(name); } - datasource_ptr datasource = layer.datasource(); + datasource_ptr datasource = lyr.datasource(); if ( datasource ) { serialize_datasource( layer_node, datasource ); diff --git a/src/scale_denominator.cpp b/src/scale_denominator.cpp index f7a622088..7e7b2f14d 100644 --- a/src/scale_denominator.cpp +++ b/src/scale_denominator.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/simplify.cpp b/src/simplify.cpp index e50136781..97eae9257 100644 --- a/src/simplify.cpp +++ b/src/simplify.cpp @@ -5,6 +5,8 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wredeclared-class-member" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #pragma GCC diagnostic pop diff --git a/src/svg/output/process_line_symbolizer.cpp b/src/svg/output/process_line_symbolizer.cpp index 4640a370d..5db205eff 100644 --- a/src/svg/output/process_line_symbolizer.cpp +++ b/src/svg/output/process_line_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/output/process_polygon_symbolizer.cpp b/src/svg/output/process_polygon_symbolizer.cpp index 18bfaae1a..aaf82d3aa 100644 --- a/src/svg/output/process_polygon_symbolizer.cpp +++ b/src/svg/output/process_polygon_symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/output/process_symbolizers.cpp b/src/svg/output/process_symbolizers.cpp index a7ca1c001..6ff486f7f 100644 --- a/src/svg/output/process_symbolizers.cpp +++ b/src/svg/output/process_symbolizers.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,7 +35,7 @@ #include #include #include - +#include // boost #include @@ -59,8 +59,8 @@ struct coord_transformer calc_type z = 0.0; if (!prj_trans_.backward(x, y, z)) return false; tr_.forward(&x,&y); - boost::geometry::set<0>(p2, boost::numeric_cast(x)); - boost::geometry::set<1>(p2, boost::numeric_cast(y)); + boost::geometry::set<0>(p2, safe_cast(x)); + boost::geometry::set<1>(p2, safe_cast(y)); return true; } diff --git a/src/svg/output/svg_generator.cpp b/src/svg/output/svg_generator.cpp index d6556eabf..419696191 100644 --- a/src/svg/output/svg_generator.cpp +++ b/src/svg/output/svg_generator.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,14 @@ #include // boost +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include +#pragma GCC diagnostic pop namespace mapnik { namespace svg { diff --git a/src/svg/output/svg_output_attributes.cpp b/src/svg/output/svg_output_attributes.cpp index fb0b6a783..bf05d874b 100644 --- a/src/svg/output/svg_output_attributes.cpp +++ b/src/svg/output/svg_output_attributes.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/output/svg_output_grammars.cpp b/src/svg/output/svg_output_grammars.cpp index cc0d51439..398c41a7e 100644 --- a/src/svg/output/svg_output_grammars.cpp +++ b/src/svg/output/svg_output_grammars.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/output/svg_renderer.cpp b/src/svg/output/svg_renderer.cpp index 4525caead..c110e5e8c 100644 --- a/src/svg/output/svg_renderer.cpp +++ b/src/svg/output/svg_renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index a6fa1ee5b..1ef103c3b 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ #include #include #include +#include #include "agg_ellipse.h" #include "agg_rounded_rect.h" @@ -34,6 +35,7 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include #include @@ -1075,7 +1077,7 @@ void svg_parser::parse(std::string const& filename) void svg_parser::parse_from_string(std::string const& svg) { - xmlTextReaderPtr reader = xmlReaderForMemory(svg.c_str(),svg.size(),nullptr,nullptr, + xmlTextReaderPtr reader = xmlReaderForMemory(svg.c_str(),safe_cast(svg.size()),nullptr,nullptr, (XML_PARSE_NOBLANKS | XML_PARSE_NOCDATA | XML_PARSE_NOERROR | XML_PARSE_NOWARNING)); if (reader == nullptr) { diff --git a/src/svg/svg_path_parser.cpp b/src/svg/svg_path_parser.cpp index d69473425..ba0ce07aa 100644 --- a/src/svg/svg_path_parser.cpp +++ b/src/svg/svg_path_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/svg_points_parser.cpp b/src/svg/svg_points_parser.cpp index b02dafac7..99de4c905 100644 --- a/src/svg/svg_points_parser.cpp +++ b/src/svg/svg_points_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/svg/svg_transform_parser.cpp b/src/svg/svg_transform_parser.cpp index ed6e7f6bb..f41b7b11e 100644 --- a/src/svg/svg_transform_parser.cpp +++ b/src/svg/svg_transform_parser.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/symbolizer.cpp b/src/symbolizer.cpp index bce44a161..6d3109f8e 100644 --- a/src/symbolizer.cpp +++ b/src/symbolizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/symbolizer_enumerations.cpp b/src/symbolizer_enumerations.cpp index e17fa1b12..94227dfd2 100644 --- a/src/symbolizer_enumerations.cpp +++ b/src/symbolizer_enumerations.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/symbolizer_keys.cpp b/src/symbolizer_keys.cpp index 099832df9..fa5c73d32 100644 --- a/src/symbolizer_keys.cpp +++ b/src/symbolizer_keys.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/face.cpp b/src/text/face.cpp index 3e14aa62b..10afa65ae 100644 --- a/src/text/face.cpp +++ b/src/text/face.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/font_feature_settings.cpp b/src/text/font_feature_settings.cpp index 67473b509..581c08501 100644 --- a/src/text/font_feature_settings.cpp +++ b/src/text/font_feature_settings.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -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 "-Wsign-conversion" #include #include #pragma GCC diagnostic pop diff --git a/src/text/font_library.cpp b/src/text/font_library.cpp index 0e19b8c85..873c25380 100644 --- a/src/text/font_library.cpp +++ b/src/text/font_library.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,6 +22,7 @@ // mapnik #include +#include // stl #include @@ -37,19 +38,19 @@ extern "C" namespace { -void* _Alloc_Func(FT_Memory memory, long size) +void* _Alloc_Func(FT_Memory, long size) { - return std::malloc(size); + return std::malloc(mapnik::safe_cast(size)); } -void _Free_Func(FT_Memory memory, void *block) +void _Free_Func(FT_Memory, void *block) { std::free(block); } -void* _Realloc_Func(FT_Memory memory, long cur_size, long new_size, void* block) +void* _Realloc_Func(FT_Memory, long /*cur_size*/, long new_size, void* block) { - return std::realloc(block, new_size); + return std::realloc(block, mapnik::safe_cast(new_size)); } } diff --git a/src/text/formatting/base.cpp b/src/text/formatting/base.cpp index a1e16db38..8d8f0a1bb 100644 --- a/src/text/formatting/base.cpp +++ b/src/text/formatting/base.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/format.cpp b/src/text/formatting/format.cpp index e8c14e10b..8e0fef52d 100644 --- a/src/text/formatting/format.cpp +++ b/src/text/formatting/format.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/layout.cpp b/src/text/formatting/layout.cpp index a5b59a85a..19da033fc 100644 --- a/src/text/formatting/layout.cpp +++ b/src/text/formatting/layout.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/list.cpp b/src/text/formatting/list.cpp index c8f444fe7..89e9d2373 100644 --- a/src/text/formatting/list.cpp +++ b/src/text/formatting/list.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/registry.cpp b/src/text/formatting/registry.cpp index bf49c5653..6114f97e5 100644 --- a/src/text/formatting/registry.cpp +++ b/src/text/formatting/registry.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/formatting/text.cpp b/src/text/formatting/text.cpp index 8247bd26a..c24aab123 100644 --- a/src/text/formatting/text.cpp +++ b/src/text/formatting/text.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -46,7 +46,7 @@ void text_node::to_xml(ptree & xml) const new_node.put_value(to_expression_string(*text_)); } -node_ptr text_node::from_xml(xml_node const& xml, fontset_map const& fontsets) +node_ptr text_node::from_xml(xml_node const& xml, fontset_map const&) { return std::make_shared(xml.get_value()); } diff --git a/src/text/glyph_positions.cpp b/src/text/glyph_positions.cpp index e950f4e08..da3b30084 100644 --- a/src/text/glyph_positions.cpp +++ b/src/text/glyph_positions.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/itemizer.cpp b/src/text/itemizer.cpp index 5058bfde4..9f01035f1 100644 --- a/src/text/itemizer.cpp +++ b/src/text/itemizer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/placement_finder.cpp b/src/text/placement_finder.cpp index ff44147d2..c4e0866a5 100644 --- a/src/text/placement_finder.cpp +++ b/src/text/placement_finder.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -59,7 +59,11 @@ placement_finder::placement_finder(feature_impl const& feature, placements_(), has_marker_(false), marker_(), - marker_box_() {} + marker_box_(), + marker_unlocked_(false), + marker_displacement_(), + move_dx_(0.0), + horizontal_alignment_(H_LEFT) {} bool placement_finder::next_position() { diff --git a/src/text/placements/base.cpp b/src/text/placements/base.cpp index 0e70b1cf8..861c5664a 100644 --- a/src/text/placements/base.cpp +++ b/src/text/placements/base.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/placements/dummy.cpp b/src/text/placements/dummy.cpp index 569b5df48..dd51db8b8 100644 --- a/src/text/placements/dummy.cpp +++ b/src/text/placements/dummy.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,7 +33,7 @@ bool text_placement_info_dummy::next() const } text_placement_info_ptr text_placements_dummy::get_placement_info( - double scale_factor, feature_impl const& feature, attributes const& vars) const + double scale_factor, feature_impl const&, attributes const&) const { return std::make_shared(this, scale_factor); } diff --git a/src/text/placements/list.cpp b/src/text/placements/list.cpp index 1c40b68cf..65c729b84 100644 --- a/src/text/placements/list.cpp +++ b/src/text/placements/list.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -65,7 +65,7 @@ text_symbolizer_properties & text_placements_list::get(unsigned i) } -text_placement_info_ptr text_placements_list::get_placement_info(double scale_factor, feature_impl const& feature, attributes const& vars) const +text_placement_info_ptr text_placements_list::get_placement_info(double scale_factor, feature_impl const&, attributes const&) const { return std::make_shared(this, scale_factor); } @@ -83,7 +83,7 @@ void text_placements_list::add_expressions(expression_set & output) const } } -unsigned text_placements_list::size() const +std::size_t text_placements_list::size() const { return list_.size(); } diff --git a/src/text/placements/registry.cpp b/src/text/placements/registry.cpp index c7a655b6b..e24131d03 100644 --- a/src/text/placements/registry.cpp +++ b/src/text/placements/registry.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/placements/simple.cpp b/src/text/placements/simple.cpp index 693b0bacd..59e44071b 100644 --- a/src/text/placements/simple.cpp +++ b/src/text/placements/simple.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -35,6 +35,8 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" #pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" #include #include #include @@ -185,7 +187,7 @@ namespace detail { } template - std::string operator() (T const& val) const + std::string operator() (T const&) const { return ""; } diff --git a/src/text/properties_util.cpp b/src/text/properties_util.cpp index ca76efd02..e08d4fd55 100644 --- a/src/text/properties_util.cpp +++ b/src/text/properties_util.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/renderer.cpp b/src/text/renderer.cpp index 25566e9c4..05a460631 100644 --- a/src/text/renderer.cpp +++ b/src/text/renderer.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/text/symbolizer_helpers.cpp b/src/text/symbolizer_helpers.cpp index 9890189ff..635606c58 100644 --- a/src/text/symbolizer_helpers.cpp +++ b/src/text/symbolizer_helpers.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -342,7 +342,7 @@ public: } template - bool operator()(T const & geo) const + bool operator()(T const&) const { return false; } diff --git a/src/text/text_layout.cpp b/src/text/text_layout.cpp index fd2fdc56d..ff37d28e2 100644 --- a/src/text/text_layout.cpp +++ b/src/text/text_layout.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -214,12 +214,12 @@ void text_layout::break_line_icu(std::pair && line_limits) shape_text(line); double scaled_wrap_width = wrap_width_ * scale_factor_; - if (!scaled_wrap_width || line.width() < scaled_wrap_width) + if (scaled_wrap_width <= 0 || line.width() < scaled_wrap_width) { add_line(std::move(line)); return; } - if (text_ratio_) + if (text_ratio_ > 0) { double wrap_at; double string_width = line.width(); diff --git a/src/text/text_line.cpp b/src/text/text_line.cpp index f66af1b78..f228e5b93 100644 --- a/src/text/text_line.cpp +++ b/src/text/text_line.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -59,7 +59,7 @@ void text_line::add_glyph(glyph_info && glyph, double scale_factor_) glyphs_width_ = advance; space_count_ = 0; } - else if (advance) + else if (advance > 0) { // Only add character spacing if the character is not a zero-width part of a cluster. width_ += advance + glyphs_.back().format->character_spacing * scale_factor_; diff --git a/src/text/text_properties.cpp b/src/text/text_properties.cpp index b1e9dd748..4b08c106b 100644 --- a/src/text/text_properties.cpp +++ b/src/text/text_properties.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/tiff_reader.cpp b/src/tiff_reader.cpp index e2577235d..dbafdf025 100644 --- a/src/tiff_reader.cpp +++ b/src/tiff_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -169,14 +169,14 @@ private: tiff_reader(const tiff_reader&); tiff_reader& operator=(const tiff_reader&); void init(); - void read_generic(unsigned x,unsigned y,image_rgba8& image); - void read_stripped(unsigned x,unsigned y,image_rgba8& image); + void read_generic(std::size_t x,std::size_t y,image_rgba8& image); + void read_stripped(std::size_t x,std::size_t y,image_rgba8& image); template - void read_tiled(unsigned x,unsigned y, ImageData & image); + void read_tiled(std::size_t x,std::size_t y, ImageData & image); template - image_any read_any_gray(unsigned x, unsigned y, unsigned width, unsigned height); + image_any read_any_gray(std::size_t x, std::size_t y, std::size_t width, std::size_t height); TIFF* open(std::istream & input); }; @@ -379,21 +379,21 @@ void tiff_reader::read(unsigned x,unsigned y,image_rgba8& image) { if (read_method_==stripped) { - read_stripped(x,y,image); + read_stripped(static_cast(x),static_cast(y),image); } else if (read_method_==tiled) { - read_tiled(x,y,image); + read_tiled(static_cast(x),static_cast(y),image); } else { - read_generic(x,y,image); + read_generic(static_cast(x),static_cast(y),image); } } template template -image_any tiff_reader::read_any_gray(unsigned x0, unsigned y0, unsigned width, unsigned height) +image_any tiff_reader::read_any_gray(std::size_t x0, std::size_t y0, std::size_t width, std::size_t height) { using image_type = ImageData; using pixel_type = typename image_type::pixel_type; @@ -410,10 +410,10 @@ image_any tiff_reader::read_any_gray(unsigned x0, unsigned y0, unsigned width { image_type data(width, height); std::size_t block_size = rows_per_strip_ > 0 ? rows_per_strip_ : tile_height_ ; - std::ptrdiff_t start_y = y0 - y0 % block_size; - std::ptrdiff_t end_y = std::min(y0 + height, static_cast(height_)); - std::ptrdiff_t start_x = x0; - std::ptrdiff_t end_x = std::min(x0 + width, static_cast(width_)); + std::size_t start_y = y0 - y0 % block_size; + std::size_t end_y = std::min(y0 + height, height_); + std::size_t start_x = x0; + std::size_t end_x = std::min(x0 + width, width_); std::size_t element_size = sizeof(pixel_type); std::size_t size_to_allocate = (TIFFScanlineSize(tif) + element_size - 1)/element_size; const std::unique_ptr scanline(new pixel_type[size_to_allocate]); @@ -454,7 +454,7 @@ struct tiff_reader_traits { using image_type = T; using pixel_type = typename image_type::pixel_type; - static bool read_tile(TIFF * tif, unsigned x, unsigned y, pixel_type* buf, std::size_t tile_width, std::size_t tile_height) + static bool read_tile(TIFF * tif, std::size_t x, std::size_t y, pixel_type* buf, std::size_t tile_width, std::size_t tile_height) { return (TIFFReadEncodedTile(tif, TIFFComputeTile(tif, x,y,0,0), buf, tile_width * tile_height * sizeof(pixel_type)) != -1); } @@ -465,11 +465,11 @@ template <> struct tiff_reader_traits { using pixel_type = std::uint32_t; - static bool read_tile(TIFF * tif, unsigned x0, unsigned y0, pixel_type* buf, std::size_t tile_width, std::size_t tile_height) + static bool read_tile(TIFF * tif, std::size_t x0, std::size_t y0, pixel_type* buf, std::size_t tile_width, std::size_t tile_height) { if (TIFFReadRGBATile(tif, x0, y0, buf) != -1) { - for (unsigned y = 0; y < tile_height/2; ++y) + for (std::size_t y = 0; y < tile_height/2; ++y) { std::swap_ranges(buf + y * tile_width, buf + (y + 1) * tile_width, buf + (tile_height - y - 1) * tile_width); } @@ -482,12 +482,14 @@ struct tiff_reader_traits } template -image_any tiff_reader::read(unsigned x0, unsigned y0, unsigned width, unsigned height) +image_any tiff_reader::read(unsigned x, unsigned y, unsigned width, unsigned height) { if (width > 10000 || height > 10000) { throw image_reader_exception("Can't allocate tiff > 10000x10000"); } + std::size_t x0 = static_cast(x); + std::size_t y0 = static_cast(y); switch (photometric_) { case PHOTOMETRIC_MINISBLACK: @@ -597,7 +599,7 @@ image_any tiff_reader::read(unsigned x0, unsigned y0, unsigned width, unsigne } template -void tiff_reader::read_generic(unsigned, unsigned, image_rgba8& image) +void tiff_reader::read_generic(std::size_t, std::size_t, image_rgba8& image) { TIFF* tif = open(stream_); if (tif) @@ -608,7 +610,7 @@ void tiff_reader::read_generic(unsigned, unsigned, image_rgba8& image) template template -void tiff_reader::read_tiled(unsigned x0,unsigned y0, ImageData & image) +void tiff_reader::read_tiled(std::size_t x0,std::size_t y0, ImageData & image) { using pixel_type = typename detail::tiff_reader_traits::pixel_type; @@ -616,31 +618,31 @@ void tiff_reader::read_tiled(unsigned x0,unsigned y0, ImageData & image) if (tif) { std::unique_ptr buf(new pixel_type[tile_width_*tile_height_]); - int width = image.width(); - int height = image.height(); - int start_y = (y0 / tile_height_) * tile_height_; - int end_y = ((y0 + height) / tile_height_ + 1) * tile_height_; - int start_x = (x0 / tile_width_) * tile_width_; - int end_x = ((x0 + width) / tile_width_ + 1) * tile_width_; - end_y = std::min(end_y, int(height_)); - end_x = std::min(end_x, int(width_)); + std::size_t width = image.width(); + std::size_t height = image.height(); + std::size_t start_y = (y0 / tile_height_) * tile_height_; + std::size_t end_y = ((y0 + height) / tile_height_ + 1) * tile_height_; + std::size_t start_x = (x0 / tile_width_) * tile_width_; + std::size_t end_x = ((x0 + width) / tile_width_ + 1) * tile_width_; + end_y = std::min(end_y, height_); + end_x = std::min(end_x, width_); - for (int y = start_y; y < end_y; y += tile_height_) + for (std::size_t y = start_y; y < end_y; y += tile_height_) { - int ty0 = std::max(y0, static_cast(y)) - y; - int ty1 = std::min(height + y0, static_cast(y + tile_height_)) - y; + std::size_t ty0 = std::max(y0, y) - y; + std::size_t ty1 = std::min(height + y0, y + tile_height_) - y; - for (int x = start_x; x < end_x; x += tile_width_) + for (std::size_t x = start_x; x < end_x; x += tile_width_) { if (!detail::tiff_reader_traits::read_tile(tif, x, y, buf.get(), tile_width_, tile_height_)) { MAPNIK_LOG_DEBUG(tiff_reader) << "read_tile(...) failed at " << x << "/" << y << " for " << width_ << "/" << height_ << "\n"; break; } - int tx0 = std::max(x0, static_cast(x)); - int tx1 = std::min(width + x0, static_cast(x + tile_width_)); - int row = y + ty0 - y0; - for (int ty = ty0; ty < ty1; ++ty, ++row) + std::size_t tx0 = std::max(x0, x); + std::size_t tx1 = std::min(width + x0, x + tile_width_); + std::size_t row = y + ty0 - y0; + for (std::size_t ty = ty0; ty < ty1; ++ty, ++row) { image.set_row(row, tx0 - x0, tx1 - x0, &buf[ty * tile_width_ + tx0 - x]); } @@ -651,23 +653,23 @@ void tiff_reader::read_tiled(unsigned x0,unsigned y0, ImageData & image) template -void tiff_reader::read_stripped(unsigned x0,unsigned y0,image_rgba8& image) +void tiff_reader::read_stripped(std::size_t x0,std::size_t y0,image_rgba8& image) { TIFF* tif = open(stream_); if (tif) { image_rgba8 strip(width_,rows_per_strip_,false); - int width=image.width(); - int height=image.height(); + std::size_t width=image.width(); + std::size_t height=image.height(); - unsigned start_y=(y0/rows_per_strip_)*rows_per_strip_; - unsigned end_y=std::min(y0+height, static_cast(height_)); - int tx0,tx1,ty0,ty1; + std::size_t start_y=(y0/rows_per_strip_)*rows_per_strip_; + std::size_t end_y=std::min(y0+height, height_); + std::size_t tx0,tx1,ty0,ty1; tx0=x0; - tx1=std::min(width+x0,static_cast(width_)); - int row = 0; - for (unsigned y=start_y; y < end_y; y+=rows_per_strip_) + tx1=std::min(width+x0,width_); + std::size_t row = 0; + for (std::size_t y=start_y; y < end_y; y+=rows_per_strip_) { ty0 = std::max(y0,y)-y; ty1 = std::min(end_y,y+rows_per_strip_)-y; @@ -677,8 +679,8 @@ void tiff_reader::read_stripped(unsigned x0,unsigned y0,image_rgba8& image) MAPNIK_LOG_DEBUG(tiff_reader) << "TIFFReadRGBAStrip failed at " << y << " for " << width_ << "/" << height_ << "\n"; break; } - // This is in reverse becauase the TIFFReadRGBAStrip reads inverted - for (unsigned ty = ty1; ty > ty0; --ty) + // This is in reverse because the TIFFReadRGBAStrip reads inverted + for (std::size_t ty = ty1; ty > ty0; --ty) { image.set_row(row,tx0-x0,tx1-x0,&strip.data()[(ty-1)*width_+tx0]); ++row; diff --git a/src/transform_expression.cpp b/src/transform_expression.cpp index e065ddc7e..34c704866 100644 --- a/src/transform_expression.cpp +++ b/src/transform_expression.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/transform_expression_grammar.cpp b/src/transform_expression_grammar.cpp index 767730de4..170b0a823 100644 --- a/src/transform_expression_grammar.cpp +++ b/src/transform_expression_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/unicode.cpp b/src/unicode.cpp index f6c059f60..cf36f555f 100644 --- a/src/unicode.cpp +++ b/src/unicode.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/vertex_cache.cpp b/src/vertex_cache.cpp index d5a18a316..071b8d08b 100644 --- a/src/vertex_cache.cpp +++ b/src/vertex_cache.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/warp.cpp b/src/warp.cpp index f3c168c68..572974834 100644 --- a/src/warp.cpp +++ b/src/warp.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/webp_reader.cpp b/src/webp_reader.cpp index b13627ea1..fbd046064 100644 --- a/src/webp_reader.cpp +++ b/src/webp_reader.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/well_known_srs.cpp b/src/well_known_srs.cpp index 8aaf7ab18..d3296effa 100644 --- a/src/well_known_srs.cpp +++ b/src/well_known_srs.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/wkb.cpp b/src/wkb.cpp index f877d7c69..19b31ca5c 100644 --- a/src/wkb.cpp +++ b/src/wkb.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/wkt/build.py b/src/wkt/build.py index 88ac36a9c..e925cf497 100644 --- a/src/wkt/build.py +++ b/src/wkt/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2014 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os from glob import glob diff --git a/src/wkt/mapnik_wkt_generator_grammar.cpp b/src/wkt/mapnik_wkt_generator_grammar.cpp index a94358dca..07813fcc8 100644 --- a/src/wkt/mapnik_wkt_generator_grammar.cpp +++ b/src/wkt/mapnik_wkt_generator_grammar.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/src/xml_tree.cpp b/src/xml_tree.cpp index 410a2bcf0..e342e6861 100644 --- a/src/xml_tree.cpp +++ b/src/xml_tree.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -68,6 +68,7 @@ struct name_trait DEFINE_NAME_TRAIT( double, "double") DEFINE_NAME_TRAIT( float, "float") DEFINE_NAME_TRAIT( unsigned, "unsigned") +DEFINE_NAME_TRAIT( int, "int") DEFINE_NAME_TRAIT( boolean_type, "boolean_type") #ifdef BIGINT DEFINE_NAME_TRAIT( mapnik::value_integer, "long long" ) @@ -98,7 +99,7 @@ struct name_trait< mapnik::enumeration > } }; -xml_tree::xml_tree(std::string const& encoding) +xml_tree::xml_tree() : node_(*this, ""), file_() { @@ -413,6 +414,7 @@ std::string xml_node::line_to_string() const compile_get_opt_attr(boolean_type); compile_get_opt_attr(std::string); +compile_get_opt_attr(int); compile_get_opt_attr(unsigned); compile_get_opt_attr(mapnik::value_integer); compile_get_opt_attr(float); diff --git a/test/cleanup.hpp b/test/cleanup.hpp new file mode 100644 index 000000000..264a6b559 --- /dev/null +++ b/test/cleanup.hpp @@ -0,0 +1,53 @@ +#ifndef TEST_MEMORY_CLEANUP +#define TEST_MEMORY_CLEANUP + +#include +#include +#include + +#if defined(HAVE_CAIRO) +#include +#endif + +#include +#ifdef MAPNIK_USE_PROJ4 +#include +#endif + +namespace testing { + +inline void run_cleanup() +{ + // only call this once, on exit + // to make sure valgrind output is clean + // http://xmlsoft.org/xmlmem.html + xmlCleanupCharEncodingHandlers(); + xmlCleanupEncodingAliases(); + xmlCleanupGlobals(); + xmlCleanupParser(); + xmlCleanupThreads(); + xmlCleanupInputCallbacks(); + xmlCleanupOutputCallbacks(); + xmlCleanupMemory(); + +#if defined(HAVE_CAIRO) + // http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data + cairo_debug_reset_static_data(); +#endif + + // http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920 + u_cleanup(); + +#ifdef MAPNIK_USE_PROJ4 + // http://trac.osgeo.org/proj/ticket/149 + #if PJ_VERSION >= 480 + pj_clear_initcache(); + #endif + // https://trac.osgeo.org/proj/wiki/ProjAPI#EnvironmentFunctions + pj_deallocate_grids(); +#endif +} + +} + +#endif \ No newline at end of file diff --git a/test/data b/test/data index 977c6fc1e..a6838f99a 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit 977c6fc1efd8bf44e9d15862a067f1406e39e29d +Subproject commit a6838f99a4c4be37989cea6718442cf4b53bd616 diff --git a/test/data-visual b/test/data-visual index cdb6afca7..bdbab2064 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit cdb6afca7b517c1fdda824fcee4abb60ed525331 +Subproject commit bdbab20649674eec2c793b83dd05bbfb379321f8 diff --git a/test/standalone/csv_test.cpp b/test/standalone/csv_test.cpp index 497815563..0a78d493e 100644 --- a/test/standalone/csv_test.cpp +++ b/test/standalone/csv_test.cpp @@ -31,15 +31,6 @@ void add_csv_files(bfs::path dir, std::vector &csv_files) { } } -bool operator==(mapnik::attribute_descriptor const &a, - mapnik::attribute_descriptor const &b) { - return ((a.get_name() == b.get_name()) && - (a.get_type() == b.get_type()) && - (a.is_primary_key() == b.is_primary_key()) & - (a.get_size() == b.get_size()) && - (a.get_precision() == b.get_precision())); -} - mapnik::datasource_ptr get_csv_ds(std::string const &file_name, bool strict = true) { mapnik::parameters params; params["type"] = std::string("csv"); diff --git a/test/unit/color/css_color.cpp b/test/unit/color/css_color.cpp new file mode 100644 index 000000000..38e151890 --- /dev/null +++ b/test/unit/color/css_color.cpp @@ -0,0 +1,38 @@ +#include "catch.hpp" +#include +#include + +TEST_CASE("css color") { + + SECTION("conversions") + { + mapnik::percent_conv_impl conv; + CHECK( conv(1.0) == 3 ); + CHECK( conv(60.0) == 153 ); + // should not overflow on invalid input + CHECK( conv(100000.0) == 255 ); + CHECK( conv(-100000.0) == 0 ); + + mapnik::alpha_conv_impl conv2; + CHECK( conv2(0.5) == 128 ); + CHECK( conv2(1.0) == 255 ); + // should not overflow on invalid input + CHECK( conv2(60.0) == 255 ); + CHECK( conv2(100000.0) == 255 ); + CHECK( conv2(-100000.0) == 0 ); + + mapnik::hsl_conv_impl conv3; + mapnik::color c; + conv3(c, 1.0, 1.0, 1.0); + CHECK( c.alpha() == 255 ); + CHECK( c.red() == 3 ); + CHECK( c.green() == 3 ); + CHECK( c.blue() == 3 ); + // invalid + conv3(c, -1, -1, -1); + CHECK( c.alpha() == 255 ); // should not be touched by hsl converter + CHECK( c.red() == 0 ); + CHECK( c.green() == 0 ); + CHECK( c.blue() == 0 ); + } +} \ No newline at end of file diff --git a/test/unit/core/conversions_test.cpp b/test/unit/core/conversions_test.cpp index 08819b2d0..e9f758aff 100644 --- a/test/unit/core/conversions_test.cpp +++ b/test/unit/core/conversions_test.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #if defined(_MSC_VER) && _MSC_VER < 1900 #include @@ -283,7 +283,7 @@ SECTION("to string") { REQUIRE( val == true ); // mapnik::value hashability - using values_container = boost::unordered_map; + using values_container = std::unordered_map; values_container vc; mapnik::value val2(1); vc[val2] = 1; @@ -297,4 +297,4 @@ SECTION("to string") { } } -} \ No newline at end of file +} diff --git a/test/unit/imaging/image_io_test.cpp b/test/unit/imaging/image_io_test.cpp index 8772ef3cd..d0a984d7d 100644 --- a/test/unit/imaging/image_io_test.cpp +++ b/test/unit/imaging/image_io_test.cpp @@ -26,6 +26,21 @@ SECTION("readers") { type = mapnik::type_from_filename(should_throw); REQUIRE( type ); REQUIRE_THROWS(std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type))); + + // actually a png so jpeg reader should throw + should_throw = "./test/data/images/landusepattern.jpg"; + REQUIRE( mapnik::util::exists( should_throw ) ); + type = mapnik::type_from_filename(should_throw); + REQUIRE( type ); + try + { + std::unique_ptr reader(mapnik::get_image_reader(should_throw,*type)); + REQUIRE(false); + } + catch (std::exception const& ex) + { + REQUIRE( std::string(ex.what()) == std::string("JPEG Reader: libjpeg could not read image: Not a JPEG file: starts with 0x89 0x50") ); + } #endif REQUIRE_THROWS(mapnik::image_rgba8 im(-10,-10)); // should throw rather than overflow diff --git a/test/unit/imaging/image_set_pixel.cpp b/test/unit/imaging/image_set_pixel.cpp new file mode 100644 index 000000000..ed7ceaffc --- /dev/null +++ b/test/unit/imaging/image_set_pixel.cpp @@ -0,0 +1,28 @@ +#include "catch.hpp" + +// mapnik +#include +#include +#include +#include + + +TEST_CASE("image set_pixel") { + +SECTION("test gray32") { + mapnik::image_gray32 im(256,256); + mapnik::set_pixel(im, 0, 0, -1); + auto pixel = mapnik::get_pixel(im, 0, 0); + INFO( pixel ); + CHECK( pixel == 0 ); +} + +SECTION("test gray8s") { + mapnik::image_gray8s im(256,256); + mapnik::set_pixel(im, 0, 0, std::numeric_limits::max()+1); + auto pixel = mapnik::get_pixel(im, 0, 0); + INFO( pixel ); + CHECK( (int)pixel == (int)std::numeric_limits::max() ); +} + +} \ No newline at end of file diff --git a/test/unit/numerics/safe_cast.cpp b/test/unit/numerics/safe_cast.cpp new file mode 100644 index 000000000..b6cba62c1 --- /dev/null +++ b/test/unit/numerics/safe_cast.cpp @@ -0,0 +1,59 @@ +#include "catch.hpp" +#include + +#define CAST_ASSERT(numeric_type) \ + using limit = std::numeric_limits; \ + auto min_value = static_cast(limit::min())-1; \ + auto max_value = static_cast(limit::max())+1; \ + CHECK( limit::min() == mapnik::safe_cast(min_value) ); \ + CHECK( limit::max() == mapnik::safe_cast(max_value) ); \ + +#define CAST_ASSERT2(numeric_type) \ + using limit = std::numeric_limits; \ + auto min_value = static_cast(limit::min()); \ + auto max_value = static_cast(limit::max()); \ + CHECK( limit::min() == mapnik::safe_cast(min_value) ); \ + CHECK( limit::max() == mapnik::safe_cast(max_value) ); \ + +#define CAST_ASSERT3(numeric_type) \ + using limit = std::numeric_limits; \ + auto min_value = static_cast(limit::min())-1; \ + auto max_value = static_cast(limit::max()); \ + CHECK( limit::min() == mapnik::safe_cast(min_value) ); \ + CHECK( limit::max() == mapnik::safe_cast(max_value) ); \ + +#define CAST_ASSERT4(numeric_type) \ + using limit = std::numeric_limits; \ + auto min_value = static_cast(-limit::max())-1; \ + auto max_value = static_cast(limit::max()); \ + CHECK( -limit::max() == mapnik::safe_cast(min_value) ); \ + CHECK( limit::max() == mapnik::safe_cast(max_value) ); \ + +TEST_CASE("saturated cast") { + + SECTION("int8") { CAST_ASSERT(std::int8_t); } + SECTION("int16") { CAST_ASSERT(std::int16_t); } + SECTION("int32") { CAST_ASSERT(std::int32_t); } + + SECTION("int64") { CAST_ASSERT2(std::int64_t); } + SECTION("intmax") { CAST_ASSERT2(std::intmax_t); } + SECTION("intptr") { CAST_ASSERT2(std::intptr_t); } + + SECTION("uint8") { CAST_ASSERT(std::uint8_t); } + SECTION("uint16") { CAST_ASSERT(std::uint16_t); } + SECTION("uint32") { CAST_ASSERT(std::uint32_t); } + + SECTION("uint64") { CAST_ASSERT3(std::uint64_t); } + SECTION("uintmax") { CAST_ASSERT3(std::uintmax_t); } + SECTION("uintptr") { CAST_ASSERT3(std::uintptr_t); } + + SECTION("float") { CAST_ASSERT4(float); } + + SECTION("freeform") { + + CHECK( static_cast(0) == mapnik::safe_cast(-1) ); + CHECK( static_cast(0) == mapnik::safe_cast(-1) ); + CHECK( static_cast(0) == mapnik::safe_cast(-1) ); + } + +} \ No newline at end of file diff --git a/test/unit/projection/proj_transform.cpp b/test/unit/projection/proj_transform.cpp index 618b57de5..d2a37893a 100644 --- a/test/unit/projection/proj_transform.cpp +++ b/test/unit/projection/proj_transform.cpp @@ -4,6 +4,12 @@ #include #include +#ifdef MAPNIK_USE_PROJ4 +// proj4 +#include +#endif + + TEST_CASE("projection transform") { @@ -33,6 +39,84 @@ SECTION("Test bounding box transforms - 4326 to 3857") CHECK(bbox.maxx() == Approx(maxx)); CHECK(bbox.maxy() == Approx(maxy)); -} // END SECTION +} -} // END TEST CASE + +#if defined(MAPNIK_USE_PROJ4) && PJ_VERSION >= 480 +SECTION("test pj_transform failure behavior") +{ + mapnik::projection proj_4269("+init=epsg:4269"); + mapnik::projection proj_3857("+init=epsg:3857"); + mapnik::proj_transform prj_trans(proj_4269, proj_3857); + mapnik::proj_transform prj_trans2(proj_3857, proj_4269); + + auto proj_ctx0 = pj_ctx_alloc(); + REQUIRE( proj_ctx0 != nullptr ); + auto proj0 = pj_init_plus_ctx(proj_ctx0, proj_4269.params().c_str()); + REQUIRE( proj0 != nullptr ); + + auto proj_ctx1 = pj_ctx_alloc(); + REQUIRE( proj_ctx1 != nullptr ); + auto proj1 = pj_init_plus_ctx(proj_ctx1, proj_3857.params().c_str()); + REQUIRE( proj1 != nullptr ); + + // first test valid values directly against proj + double x = -180.0; + double y = -60.0; + x *= DEG_TO_RAD; + y *= DEG_TO_RAD; + CHECK( x == Approx(-3.1415926536) ); + CHECK( y == Approx(-1.0471975512) ); + CHECK( 0 == pj_transform(proj0, proj1, 1, 0, &x, &y, nullptr) ); + CHECK( x == Approx(-20037508.3427892439) ); + CHECK( y == Approx(-8399737.8896366451) ); + + // now test mapnik class + double x0 = -180.0; + double y0 = -60.0; + CHECK( prj_trans.forward(&x0,&y0,nullptr,1,1) ); + CHECK( x0 == Approx(-20037508.3427892439) ); + CHECK( y0 == Approx(-8399737.8896366451) ); + double x1 = -180.0; + double y1 = -60.0; + CHECK( prj_trans2.backward(&x1,&y1,nullptr,1,1) ); + CHECK( x1 == Approx(-20037508.3427892439) ); + CHECK( y1 == Approx(-8399737.8896366451) ); + + // longitude value outside the value range for mercator + x = -181.0; + y = -91.0; + x *= DEG_TO_RAD; + y *= DEG_TO_RAD; + CHECK( x == Approx(-3.1590459461) ); + CHECK( y == Approx(-1.5882496193) ); + CHECK( 0 == pj_transform(proj0, proj1, 1, 0, &x, &y, nullptr) ); + CHECK( std::isinf(x) ); + CHECK( std::isinf(y) ); + + // now test mapnik class + double x2 = -181.0; + double y2 = -91.0; + CHECK( false == prj_trans.forward(&x2,&y2,nullptr,1,1) ); + CHECK( std::isinf(x2) ); + CHECK( std::isinf(y2) ); + double x3 = -181.0; + double y3 = -91.0; + CHECK( false == prj_trans2.backward(&x3,&y3,nullptr,1,1) ); + CHECK( std::isinf(x3) ); + CHECK( std::isinf(y3) ); + + // cleanup + pj_ctx_free(proj_ctx0); + proj_ctx0 = nullptr; + pj_free(proj0); + proj0 = nullptr; + pj_ctx_free(proj_ctx1); + proj_ctx1 = nullptr; + pj_free(proj1); + proj1 = nullptr; +} + +#endif + +} diff --git a/test/unit/run.cpp b/test/unit/run.cpp index 59d6f2812..15ad0991a 100644 --- a/test/unit/run.cpp +++ b/test/unit/run.cpp @@ -1,41 +1,13 @@ #define CATCH_CONFIG_RUNNER #include "catch.hpp" -#include // for xmlInitParser(), xmlCleanupParser() - -#if defined(HAVE_CAIRO) -#include -#endif -#include - -#ifdef MAPNIK_USE_PROJ4 -#include -#endif +#include "cleanup.hpp" // run_cleanup() int main (int argc, char* const argv[]) { int result = Catch::Session().run( argc, argv ); - // only call this once, on exit - // to make sure valgrind output is clean - // http://xmlsoft.org/xmlmem.html - xmlCleanupParser(); -#if defined(HAVE_CAIRO) - // http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data - cairo_debug_reset_static_data(); -#endif - - // http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920 - u_cleanup(); - -#ifdef MAPNIK_USE_PROJ4 - // http://trac.osgeo.org/proj/ticket/149 - #if PJ_VERSION >= 480 - pj_clear_initcache(); - #endif - // https://trac.osgeo.org/proj/wiki/ProjAPI#EnvironmentFunctions - pj_deallocate_grids(); -#endif + testing::run_cleanup(); return result; } diff --git a/test/unit/serialization/xml_parser_trim.cpp b/test/unit/serialization/xml_parser_trim.cpp index ffc5ca8be..f79c75502 100644 --- a/test/unit/serialization/xml_parser_trim.cpp +++ b/test/unit/serialization/xml_parser_trim.cpp @@ -21,7 +21,7 @@ TEST_CASE("xml parser") { " " ""); - mapnik::xml_tree tree("utf8"); + mapnik::xml_tree tree; tree.set_filename("xml_datasource_parameter_trim.cpp"); REQUIRE_NOTHROW(read_xml_string(xml, tree.root(), "")); diff --git a/test/unit/vertex_adapter/line_offset_test.cpp b/test/unit/vertex_adapter/line_offset_test.cpp index 8d02502ab..6e32f72e6 100644 --- a/test/unit/vertex_adapter/line_offset_test.cpp +++ b/test/unit/vertex_adapter/line_offset_test.cpp @@ -116,16 +116,16 @@ void test_offset_curve(double const &offset) { off_vc.reset(); off_vc.next_subpath(); while (vc.move(dx)) { - double pos = vc.linear_position(); - double off_pos = off_vc.position_closest_to(vc.current_position()); + double mpos = vc.linear_position(); + double moff_pos = off_vc.position_closest_to(vc.current_position()); { mapnik::vertex_cache::scoped_state s(off_vc); - off_vc.move(off_pos); + off_vc.move(moff_pos); auto eps = (1.001 * offset); auto actual = dist(vc.current_position(), off_vc.current_position()); REQUIRE(actual < eps); } - REQUIRE(std::abs((pos / vc.length()) - (off_pos / off_vc.length())) < 1.0e-3); + REQUIRE(std::abs((mpos / vc.length()) - (moff_pos / off_vc.length())) < 1.0e-3); } } @@ -154,10 +154,10 @@ void test_s_shaped_curve(double const &offset) { off_vc.reset(); off_vc.next_subpath(); while (vc.move(dx)) { - double off_pos = off_vc.position_closest_to(vc.current_position()); + double moff_pos = off_vc.position_closest_to(vc.current_position()); { mapnik::vertex_cache::scoped_state s(off_vc); - off_vc.move(off_pos); + off_vc.move(moff_pos); REQUIRE(dist(vc.current_position(), off_vc.current_position()) < (1.002 * offset)); } } 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/map_sizes_grammar.hpp b/test/visual/map_sizes_grammar.hpp index 29464223d..10d33503c 100644 --- a/test/visual/map_sizes_grammar.hpp +++ b/test/visual/map_sizes_grammar.hpp @@ -27,7 +27,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wunused-local-typedef" +#pragma GCC diagnostic ignored "-Wshadow" #pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#pragma GCC diagnostic ignored "-Wsign-conversion" #include #include #pragma GCC diagnostic pop 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) { } diff --git a/test/visual/run.cpp b/test/visual/run.cpp index 6a80327c0..1353bcc42 100644 --- a/test/visual/run.cpp +++ b/test/visual/run.cpp @@ -29,15 +29,7 @@ // boost #include -#include // for xmlInitParser(), xmlCleanupParser() -#if defined(HAVE_CAIRO) -#include -#endif -#include - -#ifdef MAPNIK_USE_PROJ4 -#include -#endif +#include "cleanup.hpp" // run_cleanup() int main(int argc, char** argv) { @@ -113,27 +105,7 @@ int main(int argc, char** argv) html_summary(results, output_dir); } - // only call this once, on exit - // to make sure valgrind output is clean - // http://xmlsoft.org/xmlmem.html - xmlCleanupParser(); - -#if defined(HAVE_CAIRO) - // http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data - cairo_debug_reset_static_data(); -#endif - - // http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920 - u_cleanup(); - -#ifdef MAPNIK_USE_PROJ4 - // http://trac.osgeo.org/proj/ticket/149 - #if PJ_VERSION >= 480 - pj_clear_initcache(); - #endif - // https://trac.osgeo.org/proj/wiki/ProjAPI#EnvironmentFunctions - pj_deallocate_grids(); -#endif + testing::run_cleanup(); return failed_count; } diff --git a/utils/geometry_to_wkb/main.cpp b/utils/geometry_to_wkb/main.cpp index 1b0056ae2..71ac5b3b1 100644 --- a/utils/geometry_to_wkb/main.cpp +++ b/utils/geometry_to_wkb/main.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/mapnik-config/build.py b/utils/mapnik-config/build.py index 987dd259c..60974e789 100644 --- a/utils/mapnik-config/build.py +++ b/utils/mapnik-config/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -67,12 +67,12 @@ cxxflags = ' '.join(config_env['LIBMAPNIK_CXXFLAGS']) defines = ' '.join(config_env['LIBMAPNIK_DEFINES']) -dep_includes = ''.join([' -I%s' % i for i in config_env['CPPPATH'] if not i.startswith('#')]) +dep_includes = ''.join([' -I${NODE_CONFIG_PREFIX:-""}%s' % i for i in config_env['CPPPATH'] if not i.startswith('#')]) dep_includes += ' ' if config_env['HAS_CAIRO']: - dep_includes += ''.join([' -I%s' % i for i in env['CAIRO_CPPPATHS'] if not i.startswith('#')]) + dep_includes += ''.join([' -I${NODE_CONFIG_PREFIX:-""}%s' % i for i in env['CAIRO_CPPPATHS'] if not i.startswith('#')]) ldflags = ''.join([' -L%s' % i for i in config_env['LIBPATH'] if not i.startswith('#')]) ldflags += config_env['LIBMAPNIK_LINKFLAGS'] diff --git a/utils/ogrindex/build.py b/utils/ogrindex/build.py index 4e115f9df..68a4c0452 100644 --- a/utils/ogrindex/build.py +++ b/utils/ogrindex/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os import glob @@ -32,7 +32,7 @@ source = Split( """ ) -headers = ['#plugins/input/ogr'] + env['CPPPATH'] +headers = ['#plugins/input/ogr'] + env['CPPPATH'] program_env['LIBS'] = [env['PLUGINS']['ogr']['lib']] diff --git a/utils/ogrindex/ogrindex.cpp b/utils/ogrindex/ogrindex.cpp index 7e34a656f..3e7fd503c 100644 --- a/utils/ogrindex/ogrindex.cpp +++ b/utils/ogrindex/ogrindex.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/pgsql2sqlite/build.py b/utils/pgsql2sqlite/build.py index a150e02a6..45d90035b 100644 --- a/utils/pgsql2sqlite/build.py +++ b/utils/pgsql2sqlite/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os diff --git a/utils/pgsql2sqlite/main.cpp b/utils/pgsql2sqlite/main.cpp index 63d9b50a3..39ced62be 100644 --- a/utils/pgsql2sqlite/main.cpp +++ b/utils/pgsql2sqlite/main.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/pgsql2sqlite/pgsql2sqlite.hpp b/utils/pgsql2sqlite/pgsql2sqlite.hpp index 78db58fe5..5c5a640c3 100644 --- a/utils/pgsql2sqlite/pgsql2sqlite.hpp +++ b/utils/pgsql2sqlite/pgsql2sqlite.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/pgsql2sqlite/sqlite.cpp b/utils/pgsql2sqlite/sqlite.cpp index 61ef5b3d2..95c67b8cf 100644 --- a/utils/pgsql2sqlite/sqlite.cpp +++ b/utils/pgsql2sqlite/sqlite.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/pgsql2sqlite/sqlite.hpp b/utils/pgsql2sqlite/sqlite.hpp index fcafe21f9..07d2128a3 100644 --- a/utils/pgsql2sqlite/sqlite.hpp +++ b/utils/pgsql2sqlite/sqlite.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/shapeindex/build.py b/utils/shapeindex/build.py index b769cda24..9f7de7445 100644 --- a/utils/shapeindex/build.py +++ b/utils/shapeindex/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os import glob @@ -33,7 +33,7 @@ source = Split( """ ) -headers = ['#plugins/input/shape'] + env['CPPPATH'] +headers = ['#plugins/input/shape'] + env['CPPPATH'] boost_program_options = 'boost_program_options%s' % env['BOOST_APPEND'] boost_system = 'boost_system%s' % env['BOOST_APPEND'] @@ -52,4 +52,4 @@ if 'uninstall' not in COMMAND_LINE_TARGETS: env.Install(os.path.join(env['INSTALL_PREFIX'],'bin'), shapeindex) env.Alias('install', os.path.join(env['INSTALL_PREFIX'],'bin')) -env['create_uninstall_target'](env, os.path.join(env['INSTALL_PREFIX'],'bin','shapeindex')) \ No newline at end of file +env['create_uninstall_target'](env, os.path.join(env['INSTALL_PREFIX'],'bin','shapeindex')) diff --git a/utils/shapeindex/quadtree.hpp b/utils/shapeindex/quadtree.hpp index 0ad2fd6dd..440ce5051 100644 --- a/utils/shapeindex/quadtree.hpp +++ b/utils/shapeindex/quadtree.hpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/shapeindex/shapeindex.cpp b/utils/shapeindex/shapeindex.cpp index bcf4a57cf..435daba71 100644 --- a/utils/shapeindex/shapeindex.cpp +++ b/utils/shapeindex/shapeindex.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/utils/svg2png/build.py b/utils/svg2png/build.py index 71725ff3a..2f3adcbb2 100644 --- a/utils/svg2png/build.py +++ b/utils/svg2png/build.py @@ -1,7 +1,7 @@ # # This file is part of Mapnik (c++ mapping toolkit) # -# Copyright (C) 2013 Artem Pavlenko +# Copyright (C) 2015 Artem Pavlenko # # Mapnik is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -17,7 +17,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # -# +# import os import glob diff --git a/utils/svg2png/svg2png.cpp b/utils/svg2png/svg2png.cpp index a5e841889..7e3aca532 100644 --- a/utils/svg2png/svg2png.cpp +++ b/utils/svg2png/svg2png.cpp @@ -2,7 +2,7 @@ * * This file is part of Mapnik (c++ mapping toolkit) * - * Copyright (C) 2014 Artem Pavlenko + * Copyright (C) 2015 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public