From 172758cffa7b625965e701d8a1e1ba964ac26993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 22 Jul 2013 14:29:52 +0000 Subject: [PATCH] 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 --- src/OpenMesh/Core/IO/SR_binary_vector_of_fundamentals.inl | 2 +- src/OpenMesh/Core/IO/SR_binary_vector_of_string.inl | 6 +++--- src/OpenMesh/Core/Utils/Property.hh | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OpenMesh/Core/IO/SR_binary_vector_of_fundamentals.inl b/src/OpenMesh/Core/IO/SR_binary_vector_of_fundamentals.inl index 000f9f6b..15ebae26 100644 --- a/src/OpenMesh/Core/IO/SR_binary_vector_of_fundamentals.inl +++ b/src/OpenMesh/Core/IO/SR_binary_vector_of_fundamentals.inl @@ -30,7 +30,7 @@ template <> struct binary< std::vector< T > > { \ size_t bytes=0; \ \ if ( _swap) \ - bytes = std::accumulate( _v.begin(), _v.end(), 0, \ + bytes = std::accumulate( _v.begin(), _v.end(), size_t(0), \ FunctorRestore(_is, _swap) ); \ else \ { \ diff --git a/src/OpenMesh/Core/IO/SR_binary_vector_of_string.inl b/src/OpenMesh/Core/IO/SR_binary_vector_of_string.inl index acf5a1db..c6201ded 100644 --- a/src/OpenMesh/Core/IO/SR_binary_vector_of_string.inl +++ b/src/OpenMesh/Core/IO/SR_binary_vector_of_string.inl @@ -21,19 +21,19 @@ template <> struct binary< std::vector< std::string > > static size_t size_of(void) { return UnknownSize; } 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 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(_os, _swap) ); } static 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(_is, _swap) ); } }; diff --git a/src/OpenMesh/Core/Utils/Property.hh b/src/OpenMesh/Core/Utils/Property.hh index 92b4015f..018f1e9c 100644 --- a/src/OpenMesh/Core/Utils/Property.hh +++ b/src/OpenMesh/Core/Utils/Property.hh @@ -135,7 +135,7 @@ public: { if (element_size() != IO::UnknownSize) 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