From 4233fb4abbedc6691156f48715cc4408bbc3d835 Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 29 Jan 2016 11:37:01 +0100 Subject: [PATCH 01/23] update deps --- deps/mapbox/variant | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/mapbox/variant b/deps/mapbox/variant index 694a78454..7f7c667f8 160000 --- a/deps/mapbox/variant +++ b/deps/mapbox/variant @@ -1 +1 @@ -Subproject commit 694a78454f77be60dda488bdbc38886fb9f05fc9 +Subproject commit 7f7c667f870541c208c07d99a9f2c22dfa1f32de From a50036d421435b9ea23c4ce57fdc72cacef24d46 Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 29 Jan 2016 13:07:43 +0100 Subject: [PATCH 02/23] value - make `noexcept` conditional + add move assigment operator --- include/mapnik/value.hpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 78299e497..4b7a08ece 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -759,7 +759,10 @@ public: value (value const& other) = default; - value( value && other) noexcept = default; + value( value && other) + noexcept (std::is_nothrow_move_constructible::value) + : value_base(std::move(other)) + {} template value ( T const& val) @@ -767,8 +770,15 @@ public: template value ( T && val) - : value_base(typename detail::mapnik_value_type::type(val)) {} + noexcept(std::is_nothrow_move_constructible::type>::value) + : value_base(std::move(typename detail::mapnik_value_type::type(val))) {} + value & operator=( value && other) + noexcept(std::is_nothrow_move_assignable::type>::value) + { + value_base::operator=(std::move(other)); + return *this; + } value & operator=( value const& other) = default; bool operator==(value const& other) const From 64c2ad1e93a884d051b47c0190f720263214caef Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 29 Jan 2016 15:05:08 +0100 Subject: [PATCH 03/23] Just let the compiler generate move/copy for mapnik::value - via @lightmare ref https://github.com/mapnik/mapnik/issues/3274#issuecomment-176730124 --- include/mapnik/value.hpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 4b7a08ece..45e2e3136 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -757,13 +757,6 @@ public: value () noexcept //-- comment out for VC++11 : value_base(value_null()) {} - value (value const& other) = default; - - value( value && other) - noexcept (std::is_nothrow_move_constructible::value) - : value_base(std::move(other)) - {} - template value ( T const& val) : value_base(typename detail::mapnik_value_type::type(val)) {} @@ -773,14 +766,6 @@ public: noexcept(std::is_nothrow_move_constructible::type>::value) : value_base(std::move(typename detail::mapnik_value_type::type(val))) {} - value & operator=( value && other) - noexcept(std::is_nothrow_move_assignable::type>::value) - { - value_base::operator=(std::move(other)); - return *this; - } - value & operator=( value const& other) = default; - bool operator==(value const& other) const { return util::apply_visitor(detail::comparison(), *this, other); From b3170c397c132056b2e6f9cdb6161d7bf5b10d04 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 15:31:13 -0800 Subject: [PATCH 04/23] travis: linux: test gcc49 / osx: use xcode7 - closes #3240 --- .travis.yml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4be27fe6f..5834c83ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -language: cpp +language: c sudo: false @@ -27,18 +27,30 @@ matrix: include: - os: linux compiler: clang - env: JOBS=8 MASON_PUBLISH=true + env: JOBS=8 CXX="ccache clang++-3.6 -Qunused-arguments" CC="clang-3.6" MASON_PUBLISH=true + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6' ] + packages: [ 'clang-3.6', 'libstdc++-4.9-dev', 'libstdc++6' ] - os: linux compiler: gcc - env: JOBS=6 + env: JOBS=6 CXX="ccache g++-4.9" CC="gcc-4.9" + addons: + apt: + sources: [ 'ubuntu-toolchain-r-test' ] + packages: [ 'gcc-4.9', 'g++-4.9', 'libstdc++-4.9-dev', 'libstdc++6' ] - os: osx compiler: clang + osx_image: xcode7 # upgrades clang from 6 -> 7 env: JOBS=8 MASON_PUBLISH=true - os: osx compiler: clang + osx_image: xcode7 # upgrades clang from 6 -> 7 env: JOBS=8 COVERAGE=true before_install: + - export PYTHONUSERBASE=${PYTHONUSERBASE} + - export PATH=${PYTHONUSERBASE}/bin:${PATH} - export COVERAGE=${COVERAGE:-false} - export MASON_PUBLISH=${MASON_PUBLISH:-false} - if [[ ${TRAVIS_BRANCH} != 'master' ]]; then export MASON_PUBLISH=false; fi @@ -55,20 +67,19 @@ before_install: install: - if [[ $(uname -s) == 'Linux' ]]; then - export CXX="ccache clang++-3.5 -Qunused-arguments"; - export CC="ccache clang-3.5 -Qunused-arguments"; - export PYTHONPATH=$(pwd)/mason_packages/.link/lib/python2.7/site-packages; + export PYTHONPATH=${PYTHONUSERBASE}/lib/python2.7/site-packages; else brew rm postgis --force; brew install postgis --force; pg_ctl -w start -l postgres.log --pgdata /usr/local/var/postgres; createuser -s postgres; - export PYTHONPATH=$(pwd)/mason_packages/.link/lib/python/site-packages; + export PYTHONPATH=${PYTHONUSERBASE}/lib/python/site-packages; fi - psql -c 'create database template_postgis;' -U postgres; - psql -c 'create extension postgis;' -d template_postgis -U postgres; - if [[ ${COVERAGE} == true ]]; then - PYTHONUSERBASE=$(pwd)/mason_packages/.link pip install --user cpp-coveralls; + if [[ ! $(which pip) ]]; then easy_install --user pip && export PATH=/Users/travis/Library/Python/2.7/bin:${PATH}; fi; + pip install --user cpp-coveralls; fi script: From bc89f7f877006d7f21fcfd3b454fd7db9b976acf Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 15:54:15 -0800 Subject: [PATCH 05/23] upgrade to latest variant - refs mapbox/variant#73 --- deps/mapbox/variant | 2 +- include/mapnik/value_hash.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/mapbox/variant b/deps/mapbox/variant index 7f7c667f8..c4e864cc1 160000 --- a/deps/mapbox/variant +++ b/deps/mapbox/variant @@ -1 +1 @@ -Subproject commit 7f7c667f870541c208c07d99a9f2c22dfa1f32de +Subproject commit c4e864cc122c4fcc9b1f7a8f68a34e465df9f922 diff --git a/include/mapnik/value_hash.hpp b/include/mapnik/value_hash.hpp index 4c12bbe97..c1f1d60fc 100644 --- a/include/mapnik/value_hash.hpp +++ b/include/mapnik/value_hash.hpp @@ -68,7 +68,7 @@ template std::size_t mapnik_hash_value(T const& val) { std::size_t seed = util::apply_visitor(detail::value_hasher(), val); - detail::hash_combine(seed, val.get_type_index()); + detail::hash_combine(seed, val.which()); return seed; } From 0291e851febca47de3487d5fda47719a050dca93 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 16:05:09 -0800 Subject: [PATCH 06/23] disable g++4.9 build which gets killed / use clang 3.6 to prepare for c++14 support --- .travis.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5834c83ce..ab058cca0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,9 +15,9 @@ addons: apt: sources: - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.5 + - llvm-toolchain-precise-3.6 packages: - - clang-3.5 + - clang-3.6 cache: directories: @@ -32,13 +32,15 @@ matrix: apt: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6' ] packages: [ 'clang-3.6', 'libstdc++-4.9-dev', 'libstdc++6' ] - - os: linux - compiler: gcc - env: JOBS=6 CXX="ccache g++-4.9" CC="gcc-4.9" - addons: - apt: - sources: [ 'ubuntu-toolchain-r-test' ] - packages: [ 'gcc-4.9', 'g++-4.9', 'libstdc++-4.9-dev', 'libstdc++6' ] + # OOM killer knocking out build on render_markers_symbolizer.cpp + # + #- os: linux + # compiler: gcc + # env: JOBS=6 CXX="ccache g++-4.9" CC="gcc-4.9" + # addons: + # apt: + # sources: [ 'ubuntu-toolchain-r-test' ] + # packages: [ 'gcc-4.9', 'g++-4.9', 'libstdc++-4.9-dev', 'libstdc++6' ] - os: osx compiler: clang osx_image: xcode7 # upgrades clang from 6 -> 7 From 32bbccb8fd8faeac3693e6361ab44442c40f130f Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 16:29:12 -0800 Subject: [PATCH 07/23] fix #3276 --- plugins/input/shape/shape_index_featureset.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/input/shape/shape_index_featureset.cpp b/plugins/input/shape/shape_index_featureset.cpp index bb9da6ecb..aa91b085e 100644 --- a/plugins/input/shape/shape_index_featureset.cpp +++ b/plugins/input/shape/shape_index_featureset.cpp @@ -87,7 +87,7 @@ feature_ptr shape_index_featureset::next() int offset = itr_->offset; shape_ptr_->move_to(offset); std::vector> parts; - while (itr_->offset == offset && itr_ != offsets_.end()) + while (itr_ != offsets_.end() && itr_->offset == offset) { if (itr_->start!= -1) parts.emplace_back(itr_->start, itr_->end); ++itr_; From 0b22bd87f7d47dcd8720f8a9fbcb0fdbfe3cde39 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 16:29:43 -0800 Subject: [PATCH 08/23] shape_index_featureset: initialize members explicitly - remove debug print --- plugins/input/shape/shape_index_featureset.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/input/shape/shape_index_featureset.cpp b/plugins/input/shape/shape_index_featureset.cpp index aa91b085e..c4b1918d8 100644 --- a/plugins/input/shape/shape_index_featureset.cpp +++ b/plugins/input/shape/shape_index_featureset.cpp @@ -52,6 +52,9 @@ shape_index_featureset::shape_index_featureset(filterT const& filter, ctx_(std::make_shared()), shape_ptr_(std::move(shape_ptr)), tr_(new mapnik::transcoder(encoding)), + offsets_(), + itr_(), + attr_ids_(), row_limit_(row_limit), count_(0), feature_bbox_() @@ -92,7 +95,6 @@ feature_ptr shape_index_featureset::next() if (itr_->start!= -1) parts.emplace_back(itr_->start, itr_->end); ++itr_; } - //std::cerr << "PARTS SIZE=" << parts.size() <<" offset=" << offset << std::endl; mapnik::value_integer feature_id = shape_ptr_->id(); shape_file::record_type record(shape_ptr_->reclength_ * 2); shape_ptr_->shp().read_record(record); From a447c78d2e88d24e5333dbdde92b2d67e682f2cf Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 16:30:03 -0800 Subject: [PATCH 09/23] ensure valid objects in shapeindex test --- test/unit/datasource/shapeindex.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unit/datasource/shapeindex.cpp b/test/unit/datasource/shapeindex.cpp index 636713feb..7b3aef029 100644 --- a/test/unit/datasource/shapeindex.cpp +++ b/test/unit/datasource/shapeindex.cpp @@ -39,6 +39,7 @@ std::size_t count_shapefile_features(std::string const& filename) params["type"] = "shape"; params["file"] = filename; auto ds = mapnik::datasource_cache::instance().create(params); + REQUIRE(ds != nullptr); CHECK(ds->type() == mapnik::datasource::datasource_t::Vector); auto fields = ds->get_descriptor().get_descriptors(); mapnik::query query(ds->envelope()); @@ -47,6 +48,7 @@ std::size_t count_shapefile_features(std::string const& filename) query.add_property_name(field.get_name()); } auto features = ds->features(query); + REQUIRE(features != nullptr); std::size_t feature_count = 0; auto feature = features->next(); From 61ffe096fcdfa31e6f5cb2f79f69397fefffbb99 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 16:32:09 -0800 Subject: [PATCH 10/23] latest variant --- deps/mapbox/variant | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/mapbox/variant b/deps/mapbox/variant index 7f7c667f8..c4e864cc1 160000 --- a/deps/mapbox/variant +++ b/deps/mapbox/variant @@ -1 +1 @@ -Subproject commit 7f7c667f870541c208c07d99a9f2c22dfa1f32de +Subproject commit c4e864cc122c4fcc9b1f7a8f68a34e465df9f922 From b2c14972de265b3784d9828e02fb1395259aeaab Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Fri, 29 Jan 2016 21:04:47 +0100 Subject: [PATCH 11/23] remove explicitly-defaulted constructors and assignment operators ... ... where they should be implicitly defined by the compiler --- include/mapnik/geometry.hpp | 19 +++---------------- include/mapnik/image.hpp | 3 --- include/mapnik/image_impl.hpp | 8 -------- include/mapnik/image_null.hpp | 3 --- include/mapnik/image_view.hpp | 4 ---- include/mapnik/image_view_impl.hpp | 19 ------------------- include/mapnik/marker.hpp | 21 ++++----------------- include/mapnik/vertex.hpp | 17 ----------------- 8 files changed, 7 insertions(+), 87 deletions(-) diff --git a/include/mapnik/geometry.hpp b/include/mapnik/geometry.hpp index 3766ebf23..7063685d7 100644 --- a/include/mapnik/geometry.hpp +++ b/include/mapnik/geometry.hpp @@ -45,9 +45,6 @@ struct point point(mapnik::coord const& c) : x(c.x), y(c.y) {} - point(point const& other) = default; - point(point && other) noexcept = default; - point & operator=(point const& other) = default; friend inline bool operator== (point const& a, point const& b) { return a.x == b.x && a.y == b.y; @@ -65,12 +62,8 @@ template struct line_string : std::vector > { line_string() = default; - line_string (std::size_t size) + explicit line_string(std::size_t size) : std::vector >(size) {} - line_string (line_string && other) = default ; - line_string& operator=(line_string &&) = default; - line_string (line_string const& ) = default; - line_string& operator=(line_string const&) = default; inline std::size_t num_points() const { return std::vector>::size(); } inline void add_coord(T x, T y) { std::vector>::template emplace_back(x,y);} }; @@ -79,17 +72,12 @@ template struct linear_ring : line_string { linear_ring() = default; - linear_ring(std::size_t size) + explicit linear_ring(std::size_t size) : line_string(size) {} - linear_ring (linear_ring && other) = default ; - linear_ring& operator=(linear_ring &&) = default; linear_ring(line_string && other) - : line_string(other) {} - linear_ring (linear_ring const& ) = default; + : line_string(std::move(other)) {} linear_ring(line_string const& other) : line_string(other) {} - linear_ring& operator=(linear_ring const&) = default; - }; template @@ -102,7 +90,6 @@ struct polygon using rings_container = InteriorRings; rings_container interior_rings; - polygon() = default; inline void set_exterior_ring(linear_ring && ring) { exterior_ring = std::move(ring); diff --git a/include/mapnik/image.hpp b/include/mapnik/image.hpp index 9ebdfc3b2..13b21c856 100644 --- a/include/mapnik/image.hpp +++ b/include/mapnik/image.hpp @@ -54,9 +54,6 @@ template struct image_dimensions { image_dimensions(int width, int height); - image_dimensions(image_dimensions const& other) = default; - image_dimensions(image_dimensions && other) = default; - image_dimensions& operator= (image_dimensions rhs); std::size_t width() const; std::size_t height() const; private: diff --git a/include/mapnik/image_impl.hpp b/include/mapnik/image_impl.hpp index 732e7ebe6..c756547b0 100644 --- a/include/mapnik/image_impl.hpp +++ b/include/mapnik/image_impl.hpp @@ -43,14 +43,6 @@ image_dimensions::image_dimensions(int width, int height) if (height < 0 || static_cast(height) > max_size) throw std::runtime_error("Invalid height for image dimensions requested"); } -template -image_dimensions& image_dimensions::operator= (image_dimensions rhs) -{ - std::swap(width_, rhs.width_); - std::swap(height_, rhs.height_); - return *this; -} - template std::size_t image_dimensions::width() const { diff --git a/include/mapnik/image_null.hpp b/include/mapnik/image_null.hpp index 2fc4e32c5..5a698bbc9 100644 --- a/include/mapnik/image_null.hpp +++ b/include/mapnik/image_null.hpp @@ -48,9 +48,6 @@ public: bool /*initialize*/ = true, bool /*premultiplied*/ = false, bool /*painted*/ = false) {} - image(image const&) {} - image(image &&) noexcept {} - image& operator=(image) { return *this; } bool operator==(image const&) const { return true; } bool operator<(image const&) const { return false; } diff --git a/include/mapnik/image_view.hpp b/include/mapnik/image_view.hpp index c2f023a30..846da6691 100644 --- a/include/mapnik/image_view.hpp +++ b/include/mapnik/image_view.hpp @@ -37,11 +37,7 @@ public: static constexpr std::size_t pixel_size = sizeof(pixel_type); image_view(std::size_t x, std::size_t y, std::size_t width, std::size_t height, T const& data); - ~image_view(); - image_view(image_view const& rhs); - image_view(image_view && other) noexcept; - image_view& operator=(image_view rhs) = delete; bool operator==(image_view const& rhs) const; bool operator<(image_view const& rhs) const; diff --git a/include/mapnik/image_view_impl.hpp b/include/mapnik/image_view_impl.hpp index 89ae15182..14032042a 100644 --- a/include/mapnik/image_view_impl.hpp +++ b/include/mapnik/image_view_impl.hpp @@ -42,25 +42,6 @@ image_view::image_view(std::size_t x, std::size_t y, std::size_t width, std:: if (y_ + height_ > data_.height()) height_ = data_.height() - y_; } -template -image_view::~image_view() {} - -template -image_view::image_view(image_view const& rhs) - : x_(rhs.x_), - y_(rhs.y_), - width_(rhs.width_), - height_(rhs.height_), - data_(rhs.data_) {} - -template -image_view::image_view(image_view && other) noexcept - : x_(std::move(other.x_)), - y_(std::move(other.y_)), - width_(std::move(other.width_)), - height_(std::move(other.height_)), - data_(std::move(other.data_)) {} - template bool image_view::operator==(image_view const& rhs) const { diff --git a/include/mapnik/marker.hpp b/include/mapnik/marker.hpp index bde8d65a2..ff7ac7028 100644 --- a/include/mapnik/marker.hpp +++ b/include/mapnik/marker.hpp @@ -58,18 +58,12 @@ public: bitmap_data_.set(0xff000000); } - marker_rgba8(image_rgba8 const & data) + explicit marker_rgba8(image_rgba8 const& data) : bitmap_data_(data) {} - marker_rgba8(image_rgba8 && data) + explicit marker_rgba8(image_rgba8 && data) noexcept : bitmap_data_(std::move(data)) {} - marker_rgba8(marker_rgba8 const& rhs) - : bitmap_data_(rhs.bitmap_data_) {} - - marker_rgba8(marker_rgba8 && rhs) noexcept - : bitmap_data_(std::move(rhs.bitmap_data_)) {} - box2d bounding_box() const { std::size_t _width = bitmap_data_.width(); @@ -99,17 +93,11 @@ private: struct marker_svg { public: - marker_svg() { } + marker_svg() = default; - marker_svg(mapnik::svg_path_ptr data) + explicit marker_svg(mapnik::svg_path_ptr data) noexcept : vector_data_(data) {} - marker_svg(marker_svg const& rhs) - : vector_data_(rhs.vector_data_) {} - - marker_svg(marker_svg && rhs) noexcept - : vector_data_(rhs.vector_data_) {} - inline box2d bounding_box() const { return vector_data_->bounding_box(); @@ -140,7 +128,6 @@ private: struct marker_null { - marker_null() = default; public: inline box2d bounding_box() const { diff --git a/include/mapnik/vertex.hpp b/include/mapnik/vertex.hpp index b05f362a5..2e1d37844 100644 --- a/include/mapnik/vertex.hpp +++ b/include/mapnik/vertex.hpp @@ -61,29 +61,12 @@ struct vertex vertex(coord_type x_,coord_type y_,unsigned cmd_) : x(x_),y(y_),cmd(cmd_) {} - vertex(vertex && rhs) noexcept - : x(std::move(rhs.x)), - y(std::move(rhs.y)), - cmd(std::move(rhs.cmd)) {} - - vertex(vertex const& rhs) - : x(rhs.x), - y(rhs.y), - cmd(rhs.cmd) {} - template vertex(vertex const& rhs) : x(coord_type(rhs.x)), y(coord_type(rhs.y)), cmd(rhs.cmd) {} - - vertex& operator=(vertex rhs) - { - swap(rhs); - return *this; - } - template vertex& operator=(vertex const& rhs) { From 400e05585fc32a24138f7428d47b455d62a2d301 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Fri, 29 Jan 2016 21:38:40 +0100 Subject: [PATCH 12/23] refine noexcept specifiers on forwarding conversion constructors --- include/mapnik/image_any.hpp | 5 +++-- include/mapnik/image_view_any.hpp | 5 +++-- include/mapnik/marker.hpp | 5 +++-- include/mapnik/params.hpp | 3 ++- include/mapnik/symbolizer_base.hpp | 18 +++++++++--------- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/include/mapnik/image_any.hpp b/include/mapnik/image_any.hpp index 735ad8223..8aedf302a 100644 --- a/include/mapnik/image_any.hpp +++ b/include/mapnik/image_any.hpp @@ -55,8 +55,9 @@ struct MAPNIK_DECL image_any : image_base bool painted = false); template - image_any(T && _data) noexcept - : image_base(std::move(_data)) {} + image_any(T && _data) + noexcept(std::is_nothrow_constructible::value) + : image_base(std::forward(_data)) {} unsigned char const* bytes() const; unsigned char* bytes(); diff --git a/include/mapnik/image_view_any.hpp b/include/mapnik/image_view_any.hpp index f61e33db5..23c9779d8 100644 --- a/include/mapnik/image_view_any.hpp +++ b/include/mapnik/image_view_any.hpp @@ -47,8 +47,9 @@ struct MAPNIK_DECL image_view_any : image_view_base image_view_any() = default; template - image_view_any(T && data) noexcept - : image_view_base(std::move(data)) {} + image_view_any(T && data) + noexcept(std::is_nothrow_constructible::value) + : image_view_base(std::forward(data)) {} std::size_t width() const; std::size_t height() const; diff --git a/include/mapnik/marker.hpp b/include/mapnik/marker.hpp index ff7ac7028..8ba117ec3 100644 --- a/include/mapnik/marker.hpp +++ b/include/mapnik/marker.hpp @@ -182,8 +182,9 @@ struct marker : marker_base marker() = default; template - marker(T && _data) noexcept - : marker_base(std::move(_data)) {} + marker(T && _data) + noexcept(std::is_nothrow_constructible::value) + : marker_base(std::forward(_data)) {} double width() const { diff --git a/include/mapnik/params.hpp b/include/mapnik/params.hpp index fc5928900..a154cf731 100644 --- a/include/mapnik/params.hpp +++ b/include/mapnik/params.hpp @@ -50,7 +50,8 @@ struct value_holder : value_holder_base // perfect forwarding template - value_holder(T && obj) noexcept + value_holder(T && obj) + noexcept(std::is_nothrow_constructible::value) : value_holder_base(std::forward(obj)) {} }; diff --git a/include/mapnik/symbolizer_base.hpp b/include/mapnik/symbolizer_base.hpp index f960752c8..8ac446265 100644 --- a/include/mapnik/symbolizer_base.hpp +++ b/include/mapnik/symbolizer_base.hpp @@ -98,10 +98,8 @@ using value_base_type = util::variant::type(obj)) {} - // move ctor - template - strict_value(T && obj) noexcept - : value_base_type(std::move(obj)) {} + template + strict_value(T && obj) + noexcept(std::is_nothrow_constructible::value) + : value_base_type(std::forward(obj)) + {} }; -} + +} // namespace detail struct MAPNIK_DECL symbolizer_base { From be5d772d6c2744059a0a47dd2dc98fa174fb173a Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Sat, 30 Jan 2016 00:50:22 +0100 Subject: [PATCH 13/23] attempt to fortify mapnik::value conversion construction - including correct noexcept specifier - adding conversion-assignment operator wasn't really necessary, but it might be more efficient since it avoids constructing an intermediate variant --- include/mapnik/value.hpp | 37 +++++++++++++++++++++++++--------- include/mapnik/value_types.hpp | 7 +++++++ 2 files changed, 35 insertions(+), 9 deletions(-) diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index 45e2e3136..fae3977d8 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -754,17 +754,36 @@ class value : public value_base friend const value operator%(value const&,value const&); public: - value () noexcept //-- comment out for VC++11 - : value_base(value_null()) {} + value() = default; - template - value ( T const& val) - : value_base(typename detail::mapnik_value_type::type(val)) {} + // conversion from type T is done via a temporary of type U, which + // is determined by mapnik_value_type; + // enable_if< decay != value > is necessary to avoid ill-formed + // recursion in noexcept specifier; and it also prevents using this + // constructor where implicitly-declared copy/move should be used + // (e.g. value(value&)) + template ::value, + detail::mapnik_value_type_decay + >::type::type> + value(T && val) + noexcept(noexcept(U(std::forward(val))) && + std::is_nothrow_constructible::value) + : value_base(U(std::forward(val))) {} - template - value ( T && val) - noexcept(std::is_nothrow_move_constructible::type>::value) - : value_base(std::move(typename detail::mapnik_value_type::type(val))) {} + template ::value, + detail::mapnik_value_type_decay + >::type::type> + value& operator=(T && val) + noexcept(noexcept(U(std::forward(val))) && + std::is_nothrow_assignable::value) + { + value_base::operator=(U(std::forward(val))); + return *this; + } bool operator==(value const& other) const { diff --git a/include/mapnik/value_types.hpp b/include/mapnik/value_types.hpp index 83ea7641a..4d508fc79 100644 --- a/include/mapnik/value_types.hpp +++ b/include/mapnik/value_types.hpp @@ -227,6 +227,13 @@ struct mapnik_value_type +using mapnik_value_type_decay = mapnik_value_type::type>; + +template +using is_same_decay = std::is_same::type, + typename std::decay::type>; + } // namespace detail } // namespace mapnik From a8d8a0d74f0bf6b27c2cd30f823624fa1ddca68d Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Sat, 30 Jan 2016 02:00:28 +0100 Subject: [PATCH 14/23] make clang happy - const default initialization http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#253 http://stackoverflow.com/questions/7411515/why-does-c-require-a-user-provided-default-constructor-to-default-construct-a http://stackoverflow.com/questions/21900237/do-i-really-need-to-implement-user-provided-constructor-for-const-objects --- include/mapnik/feature.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mapnik/feature.hpp b/include/mapnik/feature.hpp index c232075ad..f340c83d6 100644 --- a/include/mapnik/feature.hpp +++ b/include/mapnik/feature.hpp @@ -90,7 +90,7 @@ private: using context_type = context >; using context_ptr = std::shared_ptr; -static const value default_feature_value; +static const value default_feature_value{}; class MAPNIK_DECL feature_impl : private util::noncopyable { From 239623f9769c371b9af10fed48ae3d14765dc237 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Sat, 30 Jan 2016 03:24:07 +0100 Subject: [PATCH 15/23] remove unused variable [skip ci] --- include/mapnik/offset_converter.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/mapnik/offset_converter.hpp b/include/mapnik/offset_converter.hpp index a5ac57c3e..310ed808a 100644 --- a/include/mapnik/offset_converter.hpp +++ b/include/mapnik/offset_converter.hpp @@ -482,7 +482,6 @@ private: } start_v2.x = v2.x; start_v2.y = v2.y; - bool continue_loop = true; vertex2d tmp_prev(vertex2d::no_init); while (i < points.size()) @@ -515,7 +514,6 @@ private: else if (v2.cmd == SEG_END) { if (!is_polygon) break; - continue_loop = false; v2.x = start_v2.x; v2.y = start_v2.y; } From 09ce7a0ea202ad5d939ee7d2092607dff592d9e9 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 18:31:35 -0800 Subject: [PATCH 16/23] use xcode7.2 rather than 7.0.1 --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ab058cca0..22c8fd1f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,11 +43,12 @@ matrix: # packages: [ 'gcc-4.9', 'g++-4.9', 'libstdc++-4.9-dev', 'libstdc++6' ] - os: osx compiler: clang - osx_image: xcode7 # upgrades clang from 6 -> 7 + # https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions + osx_image: xcode7.2 # upgrades clang from 6 -> 7 env: JOBS=8 MASON_PUBLISH=true - os: osx compiler: clang - osx_image: xcode7 # upgrades clang from 6 -> 7 + osx_image: xcode7.2 # upgrades clang from 6 -> 7 env: JOBS=8 COVERAGE=true before_install: From 7ddb3cc4a241188c9638a069207899ed8b341b41 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 18:32:14 -0800 Subject: [PATCH 17/23] try more JOBS=10 on osx --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 22c8fd1f0..a897ae011 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,11 +45,11 @@ matrix: compiler: clang # https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions osx_image: xcode7.2 # upgrades clang from 6 -> 7 - env: JOBS=8 MASON_PUBLISH=true + env: JOBS=10 MASON_PUBLISH=true - os: osx compiler: clang osx_image: xcode7.2 # upgrades clang from 6 -> 7 - env: JOBS=8 COVERAGE=true + env: JOBS=10 COVERAGE=true before_install: - export PYTHONUSERBASE=${PYTHONUSERBASE} From 971c37691b67504bf8f923598a41a36c397c49b3 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 19:00:04 -0800 Subject: [PATCH 18/23] travis/osx - parellelize the heavy compile jobs - We can probably get away with this since OS X does not have an OOM killer - Will watch to see if it actually helps overall build times... --- .travis.yml | 4 ++-- Makefile | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a897ae011..b9deda2d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,11 +45,11 @@ matrix: compiler: clang # https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions osx_image: xcode7.2 # upgrades clang from 6 -> 7 - env: JOBS=10 MASON_PUBLISH=true + env: JOBS=10 MASON_PUBLISH=true HEAVY_JOBS=3 - os: osx compiler: clang osx_image: xcode7.2 # upgrades clang from 6 -> 7 - env: JOBS=10 COVERAGE=true + env: JOBS=10 COVERAGE=true HEAVY_JOBS=3 before_install: - export PYTHONUSERBASE=${PYTHONUSERBASE} diff --git a/Makefile b/Makefile index 89efe1fb1..3f0c623ee 100755 --- a/Makefile +++ b/Makefile @@ -7,6 +7,10 @@ ifeq ($(JOBS),) JOBS:=1 endif +ifeq ($(HEAVY_JOBS),) + HEAVY_JOBS:=1 +endif + all: mapnik install: @@ -38,7 +42,7 @@ python: src/json/libmapnik-json.a: # we first build memory intensive files with -j1 - $(PYTHON) scons/scons.py -j1 \ + $(PYTHON) scons/scons.py -j$(HEAVY_JOBS) \ --config=cache --implicit-cache --max-drift=1 \ src/renderer_common/render_group_symbolizer.os \ src/renderer_common/render_markers_symbolizer.os \ From 57027eeee311149dcbb8af952e3f4e9324847c76 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 29 Jan 2016 20:04:42 -0800 Subject: [PATCH 19/23] trim back what we build on OS X to try to save time --- .travis.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index b9deda2d0..e25146cc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,7 @@ matrix: include: - os: linux compiler: clang - env: JOBS=8 CXX="ccache clang++-3.6 -Qunused-arguments" CC="clang-3.6" MASON_PUBLISH=true + env: JOBS=8 CXX="ccache clang++-3.6 -Qunused-arguments" CC="clang-3.6" MASON_PUBLISH=true BENCH=True addons: apt: sources: [ 'ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6' ] @@ -56,6 +56,7 @@ before_install: - export PATH=${PYTHONUSERBASE}/bin:${PATH} - export COVERAGE=${COVERAGE:-false} - export MASON_PUBLISH=${MASON_PUBLISH:-false} + - export BENCH=${BENCH:-false} - if [[ ${TRAVIS_BRANCH} != 'master' ]]; then export MASON_PUBLISH=false; fi - if [[ ${TRAVIS_PULL_REQUEST} != 'false' ]]; then export MASON_PUBLISH=false; fi - git submodule update --init --depth=10 || @@ -88,22 +89,22 @@ install: script: - source bootstrap.sh - if [[ ${COVERAGE} == true ]]; then - ./configure CUSTOM_LDFLAGS='--coverage' CUSTOM_CXXFLAGS='--coverage' CUSTOM_CFLAGS='--coverage' DEBUG=True; + ./configure PGSQL2SQLITE=False SVG2PNG=False SAMPLE_INPUT_PLUGINS=False SVG_RENDERER=False BENCHMARK=${BENCH} CUSTOM_LDFLAGS='--coverage' CUSTOM_CXXFLAGS='--coverage' CUSTOM_CFLAGS='--coverage' DEBUG=True; elif [[ ${MASON_PUBLISH} == true ]]; then export MASON_NAME=mapnik; 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 RUNTIME_LINK='static'; + ./configure BENCHMARK=${BENCH} PREFIX=${MASON_PREFIX} PATH_REPLACE='' MAPNIK_BUNDLED_SHARE_DIRECTORY=True RUNTIME_LINK='static'; else - ./configure; + ./configure BENCHMARK=${BENCH}; fi - make - make test || TEST_RESULT=$? - if [[ ${COVERAGE} == true ]]; then ./mason_packages/.link/bin/cpp-coveralls --build-root . --gcov-options '\-lp' --exclude mason_packages --exclude .sconf_temp --exclude benchmark --exclude deps --exclude scons --exclude test --exclude demo --exclude docs --exclude fonts --exclude utils > /dev/null; fi - - if [[ ${COVERAGE} != true ]]; then + - if [[ ${BENCH} == True ]]; then make bench; fi - if [[ ${TEST_RESULT:-0} != 0 ]]; then exit $TEST_RESULT ; fi; From 4ef8efd554e189f0b098c7f8b72d80dda3a2d73d Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Sat, 30 Jan 2016 20:44:40 +0100 Subject: [PATCH 20/23] remove struct member designators from initialization - fixes #3277 - it's C99 syntax, illegal in C++11 braced-init-list - interestingly it's accepted in C++ by GCC and Clang, rejected by MSVC --- src/renderer_common/render_markers_symbolizer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/renderer_common/render_markers_symbolizer.cpp b/src/renderer_common/render_markers_symbolizer.cpp index 7864d3bef..12da737e5 100644 --- a/src/renderer_common/render_markers_symbolizer.cpp +++ b/src/renderer_common/render_markers_symbolizer.cpp @@ -256,13 +256,13 @@ markers_dispatch_params::markers_dispatch_params(box2d const& size, double scale, bool snap) : placement_params{ - .size = size, - .tr = tr, - .spacing = get(sym, feature, vars), - .max_error = get(sym, feature, vars), - .allow_overlap = get(sym, feature, vars), - .avoid_edges = get(sym, feature, vars), - .direction = get(sym, feature, vars)} + size, + tr, + get(sym, feature, vars), + get(sym, feature, vars), + get(sym, feature, vars), + get(sym, feature, vars), + get(sym, feature, vars)} , placement_method(get(sym, feature, vars)) , ignore_placement(get(sym, feature, vars)) , snap_to_pixels(snap) From f9248914af090d612950c05472860f4193fe7a83 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Sun, 31 Jan 2016 15:36:00 +0100 Subject: [PATCH 21/23] travis: add SCons timings, fix comment in Makefile --- .travis.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e25146cc9..24e9e8751 100644 --- a/.travis.yml +++ b/.travis.yml @@ -99,7 +99,7 @@ script: else ./configure BENCHMARK=${BENCH}; fi - - make + - SCONSFLAGS='--debug=time' make - make test || TEST_RESULT=$? - if [[ ${COVERAGE} == true ]]; then ./mason_packages/.link/bin/cpp-coveralls --build-root . --gcov-options '\-lp' --exclude mason_packages --exclude .sconf_temp --exclude benchmark --exclude deps --exclude scons --exclude test --exclude demo --exclude docs --exclude fonts --exclude utils > /dev/null; diff --git a/Makefile b/Makefile index 3f0c623ee..777303d48 100755 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ python: python bindings/python/test/visual.py -q src/json/libmapnik-json.a: - # we first build memory intensive files with -j1 + # we first build memory intensive files with -j$(HEAVY_JOBS) $(PYTHON) scons/scons.py -j$(HEAVY_JOBS) \ --config=cache --implicit-cache --max-drift=1 \ src/renderer_common/render_group_symbolizer.os \ From 958fcbf165c625e5797b7a6e931ad8855d24bfe1 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Sat, 30 Jan 2016 16:34:29 +0100 Subject: [PATCH 22/23] travis: try fewer jobs on osx --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 24e9e8751..89bda2eb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,11 +45,11 @@ matrix: compiler: clang # https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions osx_image: xcode7.2 # upgrades clang from 6 -> 7 - env: JOBS=10 MASON_PUBLISH=true HEAVY_JOBS=3 + env: JOBS=6 MASON_PUBLISH=true HEAVY_JOBS=3 - os: osx compiler: clang osx_image: xcode7.2 # upgrades clang from 6 -> 7 - env: JOBS=10 COVERAGE=true HEAVY_JOBS=3 + env: JOBS=6 COVERAGE=true HEAVY_JOBS=3 before_install: - export PYTHONUSERBASE=${PYTHONUSERBASE} From 33be145be92837e19088ede69652398807211759 Mon Sep 17 00:00:00 2001 From: artemp Date: Mon, 1 Feb 2016 09:22:14 +0100 Subject: [PATCH 23/23] variant - update to the latest upstream --- deps/mapbox/variant | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/mapbox/variant b/deps/mapbox/variant index c4e864cc1..64596e3aa 160000 --- a/deps/mapbox/variant +++ b/deps/mapbox/variant @@ -1 +1 @@ -Subproject commit c4e864cc122c4fcc9b1f7a8f68a34e465df9f922 +Subproject commit 64596e3aa2c0f47ab3e74a50c5c49acd5c57f5d5