more c++
This commit is contained in:
parent
30907b3dd1
commit
fdd646aa5b
8 changed files with 21 additions and 20 deletions
|
@ -27,10 +27,11 @@
|
|||
#include <mapnik/coord.hpp>
|
||||
|
||||
// stl
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
template <typename T>
|
||||
class coord_array
|
||||
{
|
||||
|
@ -43,8 +44,9 @@ public:
|
|||
|
||||
coord_array(coord_array const& rhs)
|
||||
: pt_(static_cast<coord_type*>(rhs.size_==0?0: ::operator new (sizeof(coord_type)*rhs.size_))),
|
||||
size_(rhs.size_) {
|
||||
std::memcpy(pt_,rhs.pt_,sizeof(coord_type)*rhs.size_);
|
||||
size_(rhs.size_)
|
||||
{
|
||||
std::copy(rhs.pt_, rhs.pt_ + rhs.size_ , pt_);
|
||||
}
|
||||
|
||||
~coord_array()
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
#include <mapnik/global.hpp>
|
||||
|
||||
// stl
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
#include <cstring> // memset
|
||||
#include <memory>
|
||||
|
||||
// boost
|
||||
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
inline void clear()
|
||||
{
|
||||
std::memset(data_.getData(),0,sizeof(mapnik::image_data_32::pixel_type)*data_.width()*data_.height());
|
||||
std::fill(data_.getData(), data_.getData() + data_.width() * data_.height(), 0);
|
||||
}
|
||||
|
||||
boost::optional<color> const& get_background() const;
|
||||
|
|
|
@ -29,10 +29,9 @@
|
|||
#include <mapnik/noncopyable.hpp>
|
||||
|
||||
// stl
|
||||
#include <vector>
|
||||
#include <cstring>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <cmath>
|
||||
|
||||
namespace mapnik {
|
||||
|
@ -67,7 +66,7 @@ class hextree : private mapnik::noncopyable
|
|||
reduce_cost(0.0),
|
||||
children_count(0)
|
||||
{
|
||||
std::memset(&children_[0],0,sizeof(children_));
|
||||
std::fill(children_, children_ + 16, nullptr);
|
||||
}
|
||||
|
||||
~node ()
|
||||
|
|
|
@ -29,10 +29,9 @@
|
|||
#include <mapnik/noncopyable.hpp>
|
||||
|
||||
// stl
|
||||
#include <vector>
|
||||
#include <cstring>
|
||||
#include <deque>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <deque>
|
||||
|
||||
namespace mapnik {
|
||||
|
||||
|
@ -63,7 +62,7 @@ class octree : private mapnik::noncopyable
|
|||
children_count(0),
|
||||
index(0)
|
||||
{
|
||||
std::memset(&children_[0],0,sizeof(children_));
|
||||
std::fill(children_,children_ + 8, nullptr);
|
||||
}
|
||||
|
||||
~node()
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
#include <boost/ptr_container/ptr_vector.hpp>
|
||||
|
||||
// stl
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <cstring>
|
||||
|
||||
namespace mapnik
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ class quad_tree : mapnik::noncopyable
|
|||
explicit node(box2d<double> const& ext)
|
||||
: extent_(ext)
|
||||
{
|
||||
std::memset(children_,0,4*sizeof(node*));
|
||||
std::fill(children_, children_ + 4, nullptr);
|
||||
}
|
||||
|
||||
box2d<double> const& extent() const
|
||||
|
|
|
@ -83,7 +83,7 @@ struct wkb_stream
|
|||
|
||||
void write(char const* data, std::size_t size)
|
||||
{
|
||||
std::memcpy(buffer_ + pos_, data, size);
|
||||
std::copy(data, data + size, buffer_ + pos_);
|
||||
pos_ += size;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
#include <mapnik/noncopyable.hpp>
|
||||
|
||||
// stl
|
||||
#include <algorithm>
|
||||
#include <tuple>
|
||||
#include <cstring> // required for memcpy with linux/g++
|
||||
#include <cstdint>
|
||||
|
||||
namespace mapnik
|
||||
|
@ -131,8 +131,8 @@ private:
|
|||
command_size** new_commands = (command_size**)(new_vertices + max_blocks_ + grow_by);
|
||||
if (vertices_)
|
||||
{
|
||||
std::memcpy(new_vertices,vertices_,max_blocks_ * sizeof(coord_type*));
|
||||
std::memcpy(new_commands,commands_,max_blocks_ * sizeof(command_size*));
|
||||
std::copy(vertices_, vertices_ + max_blocks_, new_vertices);
|
||||
std::copy(commands_, commands_ + max_blocks_, new_commands);
|
||||
::operator delete(vertices_);
|
||||
}
|
||||
vertices_ = new_vertices;
|
||||
|
|
|
@ -37,6 +37,7 @@ extern "C"
|
|||
#pragma clang diagnostic pop
|
||||
|
||||
// stl
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
|
||||
|
@ -102,7 +103,7 @@ inline int import_image_data(T2 const& image,
|
|||
{
|
||||
typename T2::pixel_type const * row_from = image.getRow(y);
|
||||
image_data_32::pixel_type * row_to = im.getRow(y);
|
||||
std::memcpy(row_to,row_from,stride);
|
||||
std::copy(row_from, row_from + stride, row_to);
|
||||
}
|
||||
if (alpha)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue