Commit 172758cf authored by Jan Möbius's avatar Jan Möbius
Browse files

Get rid of some size_t warnings in OpenMesh

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@839 fdac6126-5c0c-442c-9429-916003d36597
parent dece923a
...@@ -30,7 +30,7 @@ template <> struct binary< std::vector< T > > { \ ...@@ -30,7 +30,7 @@ template <> struct binary< std::vector< T > > { \
size_t bytes=0; \ size_t bytes=0; \
\ \
if ( _swap) \ if ( _swap) \
bytes = std::accumulate( _v.begin(), _v.end(), 0, \ bytes = std::accumulate( _v.begin(), _v.end(), size_t(0), \
FunctorRestore<elem_type>(_is, _swap) ); \ FunctorRestore<elem_type>(_is, _swap) ); \
else \ else \
{ \ { \
......
...@@ -21,19 +21,19 @@ template <> struct binary< std::vector< std::string > > ...@@ -21,19 +21,19 @@ template <> struct binary< std::vector< std::string > >
static size_t size_of(void) { return UnknownSize; } static size_t size_of(void) { return UnknownSize; }
static size_t size_of(const value_type& _v) static size_t size_of(const value_type& _v)
{ return std::accumulate( _v.begin(), _v.end(), 0u, Sum() ); } { return std::accumulate( _v.begin(), _v.end(), size_t(0), Sum() ); }
static static
size_t store(std::ostream& _os, const value_type& _v, bool _swap=false) size_t store(std::ostream& _os, const value_type& _v, bool _swap=false)
{ {
return std::accumulate( _v.begin(), _v.end(), 0, return std::accumulate( _v.begin(), _v.end(), size_t(0),
FunctorStore<elem_type>(_os, _swap) ); FunctorStore<elem_type>(_os, _swap) );
} }
static static
size_t restore(std::istream& _is, value_type& _v, bool _swap=false) size_t restore(std::istream& _is, value_type& _v, bool _swap=false)
{ {
return std::accumulate( _v.begin(), _v.end(), 0, return std::accumulate( _v.begin(), _v.end(), size_t(0),
FunctorRestore<elem_type>(_is, _swap) ); FunctorRestore<elem_type>(_is, _swap) );
} }
}; };
...@@ -135,7 +135,7 @@ public: ...@@ -135,7 +135,7 @@ public:
{ {
if (element_size() != IO::UnknownSize) if (element_size() != IO::UnknownSize)
return this->BaseProperty::size_of(n_elements()); return this->BaseProperty::size_of(n_elements());
return std::accumulate(data_.begin(), data_.end(), 0, plus()); return std::accumulate(data_.begin(), data_.end(), size_t(0), plus());
} }
virtual size_t size_of(size_t _n_elem) const virtual size_t size_of(size_t _n_elem) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment