diff --git a/bindings/python/python_grid_utils.cpp b/bindings/python/python_grid_utils.cpp index d2b03275c..977206d51 100644 --- a/bindings/python/python_grid_utils.cpp +++ b/bindings/python/python_grid_utils.cpp @@ -24,7 +24,7 @@ // boost #include -#include + // mapnik @@ -67,7 +67,7 @@ void grid2utf(T const& grid_type, for (unsigned y = 0; y < data.height(); ++y) { boost::uint16_t idx = 0; - boost::scoped_array line(new Py_UNICODE[array_size]); + const std::unique_ptr line(new Py_UNICODE[array_size]); typename T::value_type const* row = data.getRow(y); for (unsigned x = 0; x < data.width(); ++x) { @@ -130,7 +130,7 @@ void grid2utf(T const& grid_type, for (unsigned y = 0; y < grid_type.height(); y=y+resolution) { boost::uint16_t idx = 0; - boost::scoped_array line(new Py_UNICODE[array_size]); + const std::unique_ptr line(new Py_UNICODE[array_size]); mapnik::grid::value_type const* row = grid_type.getRow(y); for (unsigned x = 0; x < grid_type.width(); x=x+resolution) { @@ -197,7 +197,7 @@ void grid2utf2(T const& grid_type, for (unsigned y = 0; y < target.height(); ++y) { uint16_t idx = 0; - boost::scoped_array line(new Py_UNICODE[array_size]); + const std::unique_ptr line(new Py_UNICODE[array_size]); mapnik::grid::value_type * row = target.getRow(y); unsigned x; for (x = 0; x < target.width(); ++x) diff --git a/include/mapnik/png_io.hpp b/include/mapnik/png_io.hpp index 3de152960..a1b7095ba 100644 --- a/include/mapnik/png_io.hpp +++ b/include/mapnik/png_io.hpp @@ -34,7 +34,7 @@ #include // for Z_DEFAULT_COMPRESSION // boost -#include + // stl #include @@ -123,7 +123,7 @@ void save_as_png(T1 & file, png_set_IHDR(png_ptr, info_ptr,image.width(),image.height(),8, (trans_mode == 0) ? PNG_COLOR_TYPE_RGB : PNG_COLOR_TYPE_RGB_ALPHA,PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT); - boost::scoped_array row_pointers(new png_bytep[image.height()]); + const std::unique_ptr row_pointers(new png_bytep[image.height()]); for (unsigned int i = 0; i < image.height(); i++) { row_pointers[i] = (png_bytep)image.getRow(i); diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp index f4f6927b4..1ad24e0b7 100644 --- a/include/mapnik/value.hpp +++ b/include/mapnik/value.hpp @@ -34,7 +34,7 @@ #include #include #include -#include + #include #include #include "hash_variant.hpp" @@ -61,7 +61,7 @@ inline void to_utf8(mapnik::value_unicode_string const& input, std::string & tar u_strToUTF8(buf, BUF_SIZE, &len, input.getBuffer(), input.length(), &err); if (err == U_BUFFER_OVERFLOW_ERROR || err == U_STRING_NOT_TERMINATED_WARNING ) { - boost::scoped_array buf_ptr(new char [len+1]); + const std::unique_ptr buf_ptr(new char [len+1]); err = U_ZERO_ERROR; u_strToUTF8(buf_ptr.get() , len + 1, &len, input.getBuffer(), input.length(), &err); target.assign(buf_ptr.get() , static_cast(len)); diff --git a/include/mapnik/webp_io.hpp b/include/mapnik/webp_io.hpp index a697b39c9..de57349a1 100644 --- a/include/mapnik/webp_io.hpp +++ b/include/mapnik/webp_io.hpp @@ -34,7 +34,7 @@ #include // boost -#include + namespace mapnik { diff --git a/plugins/input/postgis/postgis_featureset.cpp b/plugins/input/postgis/postgis_featureset.cpp index 0e1f9e50e..90d4ebea2 100644 --- a/plugins/input/postgis/postgis_featureset.cpp +++ b/plugins/input/postgis/postgis_featureset.cpp @@ -34,7 +34,7 @@ #include #include #include // for int2net -#include + // boost @@ -238,7 +238,7 @@ std::string numeric2string(const char* buf) boost::int16_t sign = int2net(buf+4); boost::int16_t dscale = int2net(buf+6); - boost::scoped_array digits(new boost::int16_t[ndigits]); + const std::unique_ptr digits(new boost::int16_t[ndigits]); for (int n=0; n < ndigits ;++n) { digits[n] = int2net(buf+8+n*2); diff --git a/src/fs.cpp b/src/fs.cpp index 9eb01214b..bd78663e2 100644 --- a/src/fs.cpp +++ b/src/fs.cpp @@ -33,7 +33,7 @@ #include #if (BOOST_FILESYSTEM_VERSION <= 2) -#include + namespace boost { namespace filesystem { @@ -44,7 +44,7 @@ path read_symlink(const path& p) #ifdef BOOST_POSIX_API for (std::size_t path_max = 64;; path_max *= 2)// loop 'til buffer is large enough { - boost::scoped_array buf(new char[path_max]); + const std::unique_ptr buf(new char[path_max]); ssize_t result; if ((result=::readlink(p.string().c_str(), buf.get(), path_max))== -1) { diff --git a/src/graphics.cpp b/src/graphics.cpp index cf55b37c3..bafa04ddb 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -33,7 +33,7 @@ #include "agg_color_rgba.h" // boost -#include + // cairo #ifdef HAVE_CAIRO @@ -72,7 +72,7 @@ image_32::image_32(cairo_surface_ptr const& surface) int stride = cairo_image_surface_get_stride(&*surface) / 4; - boost::scoped_array out_row(new unsigned int[width_]); + const std::unique_ptr out_row(new unsigned int[width_]); const unsigned int *in_row = (const unsigned int *)cairo_image_surface_get_data(&*surface); for (unsigned int row = 0; row < height_; row++, in_row += stride) diff --git a/src/jpeg_reader.cpp b/src/jpeg_reader.cpp index 60e7e601d..254d4601f 100644 --- a/src/jpeg_reader.cpp +++ b/src/jpeg_reader.cpp @@ -31,14 +31,13 @@ extern "C" } // boost -#include -#include #include #include #include // std #include +#include namespace mapnik { @@ -280,7 +279,7 @@ void jpeg_reader::read(unsigned x0, unsigned y0, image_data_32& image) unsigned w = std::min(unsigned(image.width()),width_ - x0); unsigned h = std::min(unsigned(image.height()),height_ - y0); - boost::scoped_array out_row(new unsigned int[w]); + const std::unique_ptr out_row(new unsigned int[w]); unsigned row = 0; while (cinfo.output_scanline < cinfo.output_height) { diff --git a/src/png_reader.cpp b/src/png_reader.cpp index 4a732b109..1762fd524 100644 --- a/src/png_reader.cpp +++ b/src/png_reader.cpp @@ -29,12 +29,14 @@ extern "C" #include } // boost -#include // iostreams #include #include #include +// stl +#include + namespace mapnik { @@ -265,7 +267,7 @@ void png_reader::read(unsigned x0, unsigned y0,image_data_32& image) png_read_update_info(png_ptr, info_ptr); // we can read whole image at once // alloc row pointers - boost::scoped_array rows(new png_bytep[height_]); + const std::unique_ptr rows(new png_bytep[height_]); for (unsigned i=0; i::read(unsigned x0, unsigned y0,image_data_32& image) unsigned w=std::min(unsigned(image.width()),width_ - x0); unsigned h=std::min(unsigned(image.height()),height_ - y0); unsigned rowbytes=png_get_rowbytes(png_ptr, info_ptr); - boost::scoped_array row(new png_byte[rowbytes]); + const std::unique_ptr row(new png_byte[rowbytes]); //START read image rows for (unsigned i = 0;i < height_; ++i) { diff --git a/src/text_symbolizer.cpp b/src/text_symbolizer.cpp index 82e25b960..7b6ce662f 100644 --- a/src/text_symbolizer.cpp +++ b/src/text_symbolizer.cpp @@ -26,11 +26,6 @@ #include #include - -// boost - - - namespace mapnik { diff --git a/utils/pgsql2sqlite/pgsql2sqlite.hpp b/utils/pgsql2sqlite/pgsql2sqlite.hpp index 24e34f03e..08fe6efc2 100644 --- a/utils/pgsql2sqlite/pgsql2sqlite.hpp +++ b/utils/pgsql2sqlite/pgsql2sqlite.hpp @@ -35,13 +35,12 @@ // boost #include -#include -#include #include //stl #include #include +#include static std::string numeric2string(const char* buf) { @@ -50,7 +49,7 @@ static std::string numeric2string(const char* buf) boost::int16_t sign = int2net(buf+4); boost::int16_t dscale = int2net(buf+6); - boost::scoped_array digits(new boost::int16_t[ndigits]); + const std::unique_ptr digits(new boost::int16_t[ndigits]); for (int n=0; n < ndigits ;++n) { digits[n] = int2net(buf+8+n*2);