Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71083 - in trunk: boost/variant boost/variant/detail libs/variant/test
From: steven_at_[hidden]
Date: 2011-04-07 11:35:57


Author: steven_watanabe
Date: 2011-04-07 11:35:56 EDT (Thu, 07 Apr 2011)
New Revision: 71083
URL: http://svn.boost.org/trac/boost/changeset/71083

Log:
Supress warnings from variant. Refs #4666.
Text files modified:
   trunk/boost/variant/detail/visitation_impl.hpp | 1 +
   trunk/boost/variant/variant.hpp | 8 ++++----
   trunk/libs/variant/test/test1.cpp | 6 ++++++
   trunk/libs/variant/test/test2.cpp | 9 +++++++--
   trunk/libs/variant/test/test4.cpp | 6 ++++++
   trunk/libs/variant/test/test7.cpp | 6 ++++++
   6 files changed, 30 insertions(+), 6 deletions(-)

Modified: trunk/boost/variant/detail/visitation_impl.hpp
==============================================================================
--- trunk/boost/variant/detail/visitation_impl.hpp (original)
+++ trunk/boost/variant/detail/visitation_impl.hpp 2011-04-07 11:35:56 EDT (Thu, 07 Apr 2011)
@@ -261,6 +261,7 @@
 
 # undef BOOST_VARIANT_AUX_APPLY_VISITOR_STEP_CASE
 
+ default: BOOST_ASSERT(!"Boost.Variant internal error: 'which' out of range.");
     }
 
     // If not handled in this iteration, continue unrolling:

Modified: trunk/boost/variant/variant.hpp
==============================================================================
--- trunk/boost/variant/variant.hpp (original)
+++ trunk/boost/variant/variant.hpp 2011-04-07 11:35:56 EDT (Thu, 07 Apr 2011)
@@ -1169,14 +1169,14 @@
     which_t which_;
     storage_t storage_;
 
- void indicate_which(int which)
+ void indicate_which(int which_arg)
     {
- which_ = static_cast<which_t>( which );
+ which_ = static_cast<which_t>( which_arg );
     }
 
- void indicate_backup_which(int which)
+ void indicate_backup_which(int which_arg)
     {
- which_ = static_cast<which_t>( -(which + 1) );
+ which_ = static_cast<which_t>( -(which_arg + 1) );
     }
 
 private: // helpers, for queries (below)

Modified: trunk/libs/variant/test/test1.cpp
==============================================================================
--- trunk/libs/variant/test/test1.cpp (original)
+++ trunk/libs/variant/test/test1.cpp 2011-04-07 11:35:56 EDT (Thu, 07 Apr 2011)
@@ -10,6 +10,12 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
+#include "boost/config.hpp"
+
+#ifdef BOOST_MSVC
+#pragma warning(disable:4244) // conversion from const int to const short
+#endif
+
 #include "boost/test/minimal.hpp"
 #include "boost/variant.hpp"
 

Modified: trunk/libs/variant/test/test2.cpp
==============================================================================
--- trunk/libs/variant/test/test2.cpp (original)
+++ trunk/libs/variant/test/test2.cpp 2011-04-07 11:35:56 EDT (Thu, 07 Apr 2011)
@@ -11,6 +11,11 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 #include "boost/config.hpp"
+
+#ifdef BOOST_MSVC
+#pragma warning(disable:4244) // conversion from 'const int' to 'const short'
+#endif
+
 #include "boost/test/minimal.hpp"
 #include "boost/variant.hpp"
 
@@ -38,10 +43,10 @@
       using std::strlen;
 #endif // BOOST_NO_STDC_NAMESPACE
 
- size_t e_limit = this->e_limit; // avoid warnings on some compilers
+ size_t limit = this->e_limit; // avoid warnings on some compilers
       size_t src_len = strlen(src);
       
- len_ = (std::min)(src_len, e_limit-1);
+ len_ = (std::min)(src_len, limit-1);
       std::copy(src, src + len_, buffer_);
       buffer_[len_] = '\0';
    }

Modified: trunk/libs/variant/test/test4.cpp
==============================================================================
--- trunk/libs/variant/test/test4.cpp (original)
+++ trunk/libs/variant/test/test4.cpp 2011-04-07 11:35:56 EDT (Thu, 07 Apr 2011)
@@ -10,6 +10,12 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
+#include "boost/config.hpp"
+
+#ifdef BOOST_MSVC
+#pragma warning(disable:4244) // conversion from 'const int' to 'const short'
+#endif
+
 #include "boost/test/minimal.hpp"
 #include "boost/variant.hpp"
 

Modified: trunk/libs/variant/test/test7.cpp
==============================================================================
--- trunk/libs/variant/test/test7.cpp (original)
+++ trunk/libs/variant/test/test7.cpp 2011-04-07 11:35:56 EDT (Thu, 07 Apr 2011)
@@ -10,6 +10,12 @@
 // accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
+#include "boost/config.hpp"
+
+#ifdef BOOST_MSVC
+#pragma warning(disable:4244) // conversion from 'const int' to 'const short'
+#endif
+
 #include "boost/test/minimal.hpp"
 #include "boost/variant.hpp"
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk