Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57008 - in trunk/boost/random: . detail
From: steven_at_[hidden]
Date: 2009-10-19 18:53:05


Author: steven_watanabe
Date: 2009-10-19 18:53:04 EDT (Mon, 19 Oct 2009)
New Revision: 57008
URL: http://svn.boost.org/trac/boost/changeset/57008

Log:
Disable some warnings for msvc. Fixes #3532
Added:
   trunk/boost/random/detail/disable_warnings.hpp (contents, props changed)
   trunk/boost/random/detail/enable_warnings.hpp (contents, props changed)
Text files modified:
   trunk/boost/random/detail/const_mod.hpp | 4 ++++
   trunk/boost/random/detail/pass_through_engine.hpp | 4 +++-
   trunk/boost/random/linear_congruential.hpp | 4 ++++
   trunk/boost/random/uniform_01.hpp | 4 ++++
   trunk/boost/random/uniform_int.hpp | 2 +-
   trunk/boost/random/variate_generator.hpp | 4 ++++
   6 files changed, 20 insertions(+), 2 deletions(-)

Modified: trunk/boost/random/detail/const_mod.hpp
==============================================================================
--- trunk/boost/random/detail/const_mod.hpp (original)
+++ trunk/boost/random/detail/const_mod.hpp 2009-10-19 18:53:04 EDT (Mon, 19 Oct 2009)
@@ -22,6 +22,8 @@
 #include <boost/integer_traits.hpp>
 #include <boost/detail/workaround.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 namespace random {
 
@@ -356,4 +358,6 @@
 } // namespace random
 } // namespace boost
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif // BOOST_RANDOM_CONST_MOD_HPP

Added: trunk/boost/random/detail/disable_warnings.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/random/detail/disable_warnings.hpp 2009-10-19 18:53:04 EDT (Mon, 19 Oct 2009)
@@ -0,0 +1,22 @@
+/* boost random/detail/disable_warnings.hpp header file
+ *
+ * Copyright Steven Watanabe 2009
+ * Distributed under the Boost Software License, Version 1.0. (See
+ * accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * See http://www.boost.org for most recent version including documentation.
+ *
+ * $Id$
+ *
+ */
+
+// No #include guard. This header is intended to be included multiple times.
+
+#include <boost/config.hpp>
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4512)
+#pragma warning(disable:4127)
+#endif

Added: trunk/boost/random/detail/enable_warnings.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/random/detail/enable_warnings.hpp 2009-10-19 18:53:04 EDT (Mon, 19 Oct 2009)
@@ -0,0 +1,18 @@
+/* boost random/detail/enable_warnings.hpp header file
+ *
+ * Copyright Steven Watanabe 2009
+ * Distributed under the Boost Software License, Version 1.0. (See
+ * accompanying file LICENSE_1_0.txt or copy at
+ * http://www.boost.org/LICENSE_1_0.txt)
+ *
+ * See http://www.boost.org for most recent version including documentation.
+ *
+ * $Id$
+ *
+ */
+
+// No #include guard. This header is intended to be included multiple times.
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif

Modified: trunk/boost/random/detail/pass_through_engine.hpp
==============================================================================
--- trunk/boost/random/detail/pass_through_engine.hpp (original)
+++ trunk/boost/random/detail/pass_through_engine.hpp 2009-10-19 18:53:04 EDT (Mon, 19 Oct 2009)
@@ -16,7 +16,7 @@
 
 #include <boost/config.hpp>
 #include <boost/random/detail/ptr_helper.hpp>
-
+#include <boost/random/detail/disable_warnings.hpp>
 
 namespace boost {
 namespace random {
@@ -94,5 +94,7 @@
 } // namespace random
 } // namespace boost
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif // BOOST_RANDOM_DETAIL_PASS_THROUGH_ENGINE_HPP
 

Modified: trunk/boost/random/linear_congruential.hpp
==============================================================================
--- trunk/boost/random/linear_congruential.hpp (original)
+++ trunk/boost/random/linear_congruential.hpp 2009-10-19 18:53:04 EDT (Mon, 19 Oct 2009)
@@ -26,6 +26,8 @@
 #include <boost/random/detail/const_mod.hpp>
 #include <boost/detail/workaround.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 namespace random {
 
@@ -270,4 +272,6 @@
 
 } // namespace boost
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif // BOOST_RANDOM_LINEAR_CONGRUENTIAL_HPP

Modified: trunk/boost/random/uniform_01.hpp
==============================================================================
--- trunk/boost/random/uniform_01.hpp (original)
+++ trunk/boost/random/uniform_01.hpp 2009-10-19 18:53:04 EDT (Mon, 19 Oct 2009)
@@ -23,6 +23,8 @@
 #include <boost/random/detail/config.hpp>
 #include <boost/random/detail/pass_through_engine.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 
 namespace detail {
@@ -217,4 +219,6 @@
 
 } // namespace boost
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif // BOOST_RANDOM_UNIFORM_01_HPP

Modified: trunk/boost/random/uniform_int.hpp
==============================================================================
--- trunk/boost/random/uniform_int.hpp (original)
+++ trunk/boost/random/uniform_int.hpp 2009-10-19 18:53:04 EDT (Mon, 19 Oct 2009)
@@ -94,7 +94,7 @@
 
 private:
   template<class Engine>
- static result_type generate(Engine& eng, result_type min_value, result_type max_value, range_type range)
+ static result_type generate(Engine& eng, result_type min_value, result_type /*max_value*/, range_type range)
   {
     typedef typename Engine::result_type base_result;
     // ranges are always unsigned

Modified: trunk/boost/random/variate_generator.hpp
==============================================================================
--- trunk/boost/random/variate_generator.hpp (original)
+++ trunk/boost/random/variate_generator.hpp 2009-10-19 18:53:04 EDT (Mon, 19 Oct 2009)
@@ -29,6 +29,8 @@
 #include <boost/type_traits/is_integral.hpp>
 #endif
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 
 namespace random {
@@ -130,4 +132,6 @@
 
 } // namespace boost
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 #endif // BOOST_RANDOM_RANDOM_GENERATOR_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