From d561fa8eab731c589d2540e26e513b2f8d5d0a98 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sun, 18 May 2014 01:37:14 +0200 Subject: [PATCH 1/2] Fix unused variable warnings --- include/boost/numeric/ublas/matrix.hpp | 12 ++++++------ include/boost/numeric/ublas/storage.hpp | 4 ++-- include/boost/numeric/ublas/vector.hpp | 6 +++--- include/boost/numeric/ublas/vector_proxy.hpp | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/boost/numeric/ublas/matrix.hpp b/include/boost/numeric/ublas/matrix.hpp index 8d354431..7946624d 100644 --- a/include/boost/numeric/ublas/matrix.hpp +++ b/include/boost/numeric/ublas/matrix.hpp @@ -3210,7 +3210,7 @@ namespace boost { namespace numeric { // Resizing BOOST_UBLAS_INLINE - void resize (size_type size, bool preserve = true) { + void resize (size_type size, bool /*preserve*/ = true) { size1_ = size; size2_ = size; } @@ -3597,7 +3597,7 @@ namespace boost { namespace numeric { // Resizing BOOST_UBLAS_INLINE - void resize (size_type size, bool preserve = true) { + void resize (size_type size, bool /*preserve*/ = true) { size1_ = size; size2_ = size; size_common_ = ((std::min)(size1_, size2_)); @@ -4692,7 +4692,7 @@ namespace boost { namespace numeric { // Element lookup BOOST_UBLAS_INLINE - const_iterator1 find1 (int rank, size_type i, size_type j) const { + const_iterator1 find1 (int /*rank*/, size_type i, size_type j) const { #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR return const_iterator1 (*this, i, j); #else @@ -4700,7 +4700,7 @@ namespace boost { namespace numeric { #endif } BOOST_UBLAS_INLINE - iterator1 find1 (int rank, size_type i, size_type j) { + iterator1 find1 (int /*rank*/, size_type i, size_type j) { #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR return iterator1 (*this, i, j); #else @@ -4708,7 +4708,7 @@ namespace boost { namespace numeric { #endif } BOOST_UBLAS_INLINE - const_iterator2 find2 (int rank, size_type i, size_type j) const { + const_iterator2 find2 (int /*rank*/, size_type i, size_type j) const { #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR return const_iterator2 (*this, i, j); #else @@ -4716,7 +4716,7 @@ namespace boost { namespace numeric { #endif } BOOST_UBLAS_INLINE - iterator2 find2 (int rank, size_type i, size_type j) { + iterator2 find2 (int /*rank*/, size_type i, size_type j) { #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR return iterator2 (*this, i, j); #else diff --git a/include/boost/numeric/ublas/storage.hpp b/include/boost/numeric/ublas/storage.hpp index 71a25fd6..183318bb 100644 --- a/include/boost/numeric/ublas/storage.hpp +++ b/include/boost/numeric/ublas/storage.hpp @@ -273,7 +273,7 @@ namespace boost { namespace numeric { namespace ublas { // Serialization template - void serialize(Archive & ar, const unsigned int version) + void serialize(Archive & ar, const unsigned int /*version*/) { serialization::collection_size_type s(size_); ar & serialization::make_nvp("size",s); @@ -451,7 +451,7 @@ namespace boost { namespace numeric { namespace ublas { friend class boost::serialization::access; template - void serialize(Archive & ar, const unsigned int version) + void serialize(Archive & ar, const unsigned int /*version*/) { serialization::collection_size_type s(size_); ar & serialization::make_nvp("size", s); diff --git a/include/boost/numeric/ublas/vector.hpp b/include/boost/numeric/ublas/vector.hpp index 906250b7..3a0a04f9 100644 --- a/include/boost/numeric/ublas/vector.hpp +++ b/include/boost/numeric/ublas/vector.hpp @@ -88,7 +88,7 @@ namespace boost { namespace numeric { namespace ublas { /// \param data container of type \c A /// \todo remove this definition because \c size is not used BOOST_UBLAS_INLINE - vector (size_type size, const array_type &data): + vector (size_type /*size*/, const array_type &data): vector_container (), data_ (data) {} @@ -1675,7 +1675,7 @@ namespace boost { namespace numeric { namespace ublas { // Element support BOOST_UBLAS_INLINE - const_pointer find_element (size_type i) const { + const_pointer find_element (size_type /*i*/) const { return & zero_; } @@ -2384,7 +2384,7 @@ namespace boost { namespace numeric { namespace ublas { // Resizing BOOST_UBLAS_INLINE - void resize (size_type size, bool preserve = true) { + void resize (size_type size, bool /*preserve*/ = true) { if (size > N) bad_size ().raise (); size_ = size; diff --git a/include/boost/numeric/ublas/vector_proxy.hpp b/include/boost/numeric/ublas/vector_proxy.hpp index d6e2b777..55e5d959 100644 --- a/include/boost/numeric/ublas/vector_proxy.hpp +++ b/include/boost/numeric/ublas/vector_proxy.hpp @@ -1303,8 +1303,8 @@ namespace boost { namespace numeric { namespace ublas { // Closure comparison BOOST_UBLAS_INLINE - bool same_closure (const vector_indirect &vr) const { -return true; + bool same_closure (const vector_indirect &/*vr*/) const { + return true; } // Comparison From 583abafe2ddee5aa833665b19f848792494538f9 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Sun, 18 May 2014 02:11:19 +0200 Subject: [PATCH 2/2] Fix msvc-12.0 constexpr errors --- include/boost/numeric/ublas/matrix.hpp | 5 +++-- include/boost/numeric/ublas/vector.hpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/boost/numeric/ublas/matrix.hpp b/include/boost/numeric/ublas/matrix.hpp index 7946624d..634f720e 100644 --- a/include/boost/numeric/ublas/matrix.hpp +++ b/include/boost/numeric/ublas/matrix.hpp @@ -14,6 +14,7 @@ #ifndef _BOOST_UBLAS_MATRIX_ #define _BOOST_UBLAS_MATRIX_ +#include #include #include #include @@ -1194,7 +1195,7 @@ namespace boost { namespace numeric { * You can also use the free size<>() function in operation/size.hpp as size<1>(m) where m is a fixed_matrix */ BOOST_UBLAS_INLINE - constexpr size_type size1 () const { + BOOST_CONSTEXPR size_type size1 () const { return M; } @@ -1202,7 +1203,7 @@ namespace boost { namespace numeric { * You can also use the free size<>() function in operation/size.hpp as size<2>(m) where m is a fixed_matrix */ BOOST_UBLAS_INLINE - constexpr size_type size2 () const { + BOOST_CONSTEXPR size_type size2 () const { return N; } diff --git a/include/boost/numeric/ublas/vector.hpp b/include/boost/numeric/ublas/vector.hpp index 3a0a04f9..29dc341f 100644 --- a/include/boost/numeric/ublas/vector.hpp +++ b/include/boost/numeric/ublas/vector.hpp @@ -17,6 +17,7 @@ #ifndef _BOOST_UBLAS_VECTOR_ #define _BOOST_UBLAS_VECTOR_ +#include #include #include #include @@ -907,7 +908,7 @@ namespace boost { namespace numeric { namespace ublas { /// \brief Return the size of the vector BOOST_UBLAS_INLINE - constexpr size_type size () const{ // should have a const after C++14 + BOOST_CONSTEXPR size_type size () const{ // should have a const after C++14 return data_.size (); }