Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70017 - in trunk: boost/random boost/random/detail libs/random/test
From: steven_at_[hidden]
Date: 2011-03-15 23:24:50


Author: steven_watanabe
Date: 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
New Revision: 70017
URL: http://svn.boost.org/trac/boost/changeset/70017

Log:
Warning patrol
Text files modified:
   trunk/boost/random/binomial_distribution.hpp | 6 ++
   trunk/boost/random/detail/const_mod.hpp | 26 ++++++++---
   trunk/boost/random/detail/seed_impl.hpp | 14 +++++-
   trunk/boost/random/detail/uniform_int_float.hpp | 4 +
   trunk/boost/random/discrete_distribution.hpp | 4 +
   trunk/boost/random/generate_canonical.hpp | 3
   trunk/boost/random/inversive_congruential.hpp | 4 +
   trunk/boost/random/poisson_distribution.hpp | 4 +
   trunk/boost/random/random_number_generator.hpp | 4 +
   trunk/boost/random/ranlux.hpp | 4
   trunk/boost/random/shuffle_order.hpp | 15 +++---
   trunk/boost/random/subtract_with_carry.hpp | 2
   trunk/libs/random/test/Jamfile.v2 | 2
   trunk/libs/random/test/concepts.hpp | 27 +++++++++++-
   trunk/libs/random/test/statistic_tests.hpp | 2
   trunk/libs/random/test/test_bernoulli.cpp | 2
   trunk/libs/random/test/test_const_mod.cpp | 84 ++++++++++++++++++++--------------------
   trunk/libs/random/test/test_distribution.ipp | 10 ++++
   trunk/libs/random/test/test_ecuyer1988.cpp | 6 +-
   trunk/libs/random/test/test_generator.ipp | 11 ++--
   trunk/libs/random/test/test_geometric.cpp | 3
   trunk/libs/random/test/test_hellekalek1995.cpp | 6 +-
   trunk/libs/random/test/test_independent_bits31.cpp | 6 +-
   trunk/libs/random/test/test_independent_bits32.cpp | 4
   trunk/libs/random/test/test_knuth_b.cpp | 6 +-
   trunk/libs/random/test/test_kreutzer1986.cpp | 6 +-
   trunk/libs/random/test/test_lagged_fibonacci.cpp | 6 +-
   trunk/libs/random/test/test_minstd_rand.cpp | 6 +-
   trunk/libs/random/test/test_minstd_rand0.cpp | 6 +-
   trunk/libs/random/test/test_piecewise_constant.cpp | 6 +-
   trunk/libs/random/test/test_piecewise_linear.cpp | 6 +-
   trunk/libs/random/test/test_rand48.cpp | 2
   trunk/libs/random/test/test_random_device.cpp | 2
   trunk/libs/random/test/test_ranlux24.cpp | 6 +-
   trunk/libs/random/test/test_ranlux24_base.cpp | 6 +-
   trunk/libs/random/test/test_ranlux3.cpp | 6 +-
   trunk/libs/random/test/test_ranlux4.cpp | 6 +-
   trunk/libs/random/test/test_ranlux64_3.cpp | 2
   trunk/libs/random/test/test_ranlux64_4.cpp | 2
   trunk/libs/random/test/test_real_distribution.ipp | 3
   40 files changed, 203 insertions(+), 127 deletions(-)

Modified: trunk/boost/random/binomial_distribution.hpp
==============================================================================
--- trunk/boost/random/binomial_distribution.hpp (original)
+++ trunk/boost/random/binomial_distribution.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -13,13 +13,15 @@
 #ifndef BOOST_RANDOM_BINOMIAL_DISTRIBUTION_HPP_INCLUDED
 #define BOOST_RANDOM_BINOMIAL_DISTRIBUTION_HPP_INCLUDED
 
-#include <cmath>
+#include <boost/config/no_tr1/cmath.hpp>
 #include <cstdlib>
 #include <iosfwd>
 
 #include <boost/random/detail/config.hpp>
 #include <boost/random/uniform_01.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 namespace random {
 
@@ -415,4 +417,6 @@
 
 }
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif

Modified: trunk/boost/random/detail/const_mod.hpp
==============================================================================
--- trunk/boost/random/detail/const_mod.hpp (original)
+++ trunk/boost/random/detail/const_mod.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -43,8 +43,11 @@
   {
     if(((unsigned_m() - 1) & unsigned_m()) == 0)
       return (unsigned_type(x)) & (unsigned_m() - 1);
- else
- return x % m;
+ else {
+ IntType supress_warnings = (m == 0);
+ BOOST_ASSERT(supress_warnings == 0);
+ return x % (m + supress_warnings);
+ }
   }
 
   static IntType add(IntType x, IntType c)
@@ -83,9 +86,11 @@
       return (unsigned_type(a) * unsigned_type(x) + unsigned_type(c)) & (unsigned_m() - 1);
     else if(a == 0)
       return c;
- else if(m <= (traits::const_max-c)/a) // i.e. a*m+c <= max
- return (a*x+c) % m;
- else
+ else if(m <= (traits::const_max-c)/a) { // i.e. a*m+c <= max
+ IntType supress_warnings = (m == 0);
+ BOOST_ASSERT(supress_warnings == 0);
+ return (a*x+c) % (m + supress_warnings);
+ } else
       return add(mult(a, x), c);
   }
 
@@ -113,7 +118,9 @@
 
   static IntType mult_small(IntType a, IntType x)
   {
- return a*x % m;
+ IntType supress_warnings = (m == 0);
+ BOOST_ASSERT(supress_warnings == 0);
+ return a*x % (m + supress_warnings);
   }
 
   static IntType mult_schrage(IntType a, IntType value)
@@ -130,9 +137,12 @@
     IntType q, r;
     IntType value = 0;
 
+ IntType supress_warnings = (m == 0);
+ BOOST_ASSERT(supress_warnings == 0);
+
     while(true) {
       if(a == 0 || b <= traits::const_max/a)
- return add(value, IntType(a * b % m));
+ return add(value, IntType(a * b % (m + supress_warnings)));
 
       if(b < a) std::swap(a, b);
       q = m / a;
@@ -143,7 +153,7 @@
       a = r;
       b = IntType(b/q);
       if(a == 0 || b <= traits::const_max/a)
- return sub(value, IntType(a * b % m));
+ return sub(value, IntType(a * b % (m + supress_warnings)));
         
       if(b < a) std::swap(a, b);
       q = m / a;

Modified: trunk/boost/random/detail/seed_impl.hpp
==============================================================================
--- trunk/boost/random/detail/seed_impl.hpp (original)
+++ trunk/boost/random/detail/seed_impl.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -28,6 +28,8 @@
 #include <boost/random/detail/integer_log2.hpp>
 #include <boost/random/detail/signed_unsigned_tools.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 namespace random {
 namespace detail {
@@ -60,7 +62,7 @@
 struct const_pow_impl<0>
 {
     template<class T>
- static T call(T arg, int n, T result)
+ static T call(T, int, T result)
     {
         return result;
     }
@@ -165,7 +167,9 @@
         } else if(available_bits % 32 == 0) {
             for(int i = 0; i < available_bits / 32; ++i) {
                 boost::uint_least32_t word = boost::uint_least32_t(val) & 0xFFFFFFFFu;
- val >>= 32;
+ int supress_warning = (bits >= 32);
+ BOOST_ASSERT(supress_warning == 1);
+ val >>= (32 * supress_warning);
                 *begin++ = word;
                 if(begin == end) return;
             }
@@ -184,7 +188,9 @@
             if(bits >= 32) {
                 for(; available_bits >= 32; available_bits -= 32) {
                     boost::uint_least32_t word = boost::uint_least32_t(val) & 0xFFFFFFFFu;
- val >>= 32;
+ int supress_warning = (bits >= 32);
+ BOOST_ASSERT(supress_warning == 1);
+ val >>= (32 * supress_warning);
                     *begin++ = word;
                     if(begin == end) return;
                 }
@@ -386,4 +392,6 @@
 }
 }
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif

Modified: trunk/boost/random/detail/uniform_int_float.hpp
==============================================================================
--- trunk/boost/random/detail/uniform_int_float.hpp (original)
+++ trunk/boost/random/detail/uniform_int_float.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -20,6 +20,8 @@
 #include <boost/integer.hpp>
 #include <boost/random/detail/config.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 namespace random {
 namespace detail {
@@ -66,4 +68,6 @@
 } // namespace random
 } // namespace boost
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif // BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP

Modified: trunk/boost/random/discrete_distribution.hpp
==============================================================================
--- trunk/boost/random/discrete_distribution.hpp (original)
+++ trunk/boost/random/discrete_distribution.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -32,6 +32,8 @@
 #include <boost/range/begin.hpp>
 #include <boost/range/end.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 namespace random {
 
@@ -446,4 +448,6 @@
 }
 }
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif

Modified: trunk/boost/random/generate_canonical.hpp
==============================================================================
--- trunk/boost/random/generate_canonical.hpp (original)
+++ trunk/boost/random/generate_canonical.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -56,11 +56,10 @@
     std::size_t digits = std::numeric_limits<RealType>::digits;
     std::size_t engine_bits = g.precision();
     std::size_t b = (std::min)(bits, digits);
- std::size_t k = (b + engine_bits - 1) / engine_bits;
     RealType R = pow(RealType(2), RealType(engine_bits));
     RealType mult = R;
     RealType limit = pow(RealType(2), RealType(b));
- RealType S = g() - (g.min)();
+ RealType S = RealType(g() - (g.min)());
     while(mult < limit) {
         RealType inc(floor((RealType(g()) - RealType((g.min)())) * R));
         S += inc * mult;

Modified: trunk/boost/random/inversive_congruential.hpp
==============================================================================
--- trunk/boost/random/inversive_congruential.hpp (original)
+++ trunk/boost/random/inversive_congruential.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -28,6 +28,8 @@
 #include <boost/random/detail/operators.hpp>
 #include <boost/random/detail/seed_impl.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 namespace random {
 
@@ -260,4 +262,6 @@
 
 } // namespace boost
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif // BOOST_RANDOM_INVERSIVE_CONGRUENTIAL_HPP

Modified: trunk/boost/random/poisson_distribution.hpp
==============================================================================
--- trunk/boost/random/poisson_distribution.hpp (original)
+++ trunk/boost/random/poisson_distribution.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -23,6 +23,8 @@
 #include <boost/random/uniform_01.hpp>
 #include <boost/random/detail/config.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 namespace random {
 
@@ -353,4 +355,6 @@
 
 } // namespace boost
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif // BOOST_RANDOM_POISSON_DISTRIBUTION_HPP

Modified: trunk/boost/random/random_number_generator.hpp
==============================================================================
--- trunk/boost/random/random_number_generator.hpp (original)
+++ trunk/boost/random/random_number_generator.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -19,6 +19,8 @@
 #include <boost/assert.hpp>
 #include <boost/random/uniform_int_distribution.hpp>
 
+#include <boost/random/detail/disable_warnings.hpp>
+
 namespace boost {
 namespace random {
 
@@ -66,4 +68,6 @@
 
 } // namespace boost
 
+#include <boost/random/detail/enable_warnings.hpp>
+
 #endif // BOOST_RANDOM_RANDOM_NUMBER_GENERATOR_HPP

Modified: trunk/boost/random/ranlux.hpp
==============================================================================
--- trunk/boost/random/ranlux.hpp (original)
+++ trunk/boost/random/ranlux.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -45,7 +45,7 @@
 class ranlux_documentation {};
 }
 
-typedef subtract_with_carry_engine<int, 24, 10, 24> ranlux_base;
+typedef subtract_with_carry_engine<uint32_t, 24, 10, 24> ranlux_base;
 typedef subtract_with_carry_01_engine<float, 24, 10, 24> ranlux_base_01;
 typedef subtract_with_carry_01_engine<double, 48, 10, 24> ranlux64_base_01;
 
@@ -66,7 +66,7 @@
 typedef discard_block_engine<ranlux64_base_01, 389, 24> ranlux64_4_01;
 
 #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
-typedef subtract_with_carry_engine<int64_t, 48, 10, 24> ranlux64_base;
+typedef subtract_with_carry_engine<uint64_t, 48, 10, 24> ranlux64_base;
 /** @copydoc boost::random::detail::ranlux_documentation */
 typedef discard_block_engine<ranlux64_base, 223, 24> ranlux64_3;
 /** @copydoc boost::random::detail::ranlux_documentation */

Modified: trunk/boost/random/shuffle_order.hpp
==============================================================================
--- trunk/boost/random/shuffle_order.hpp (original)
+++ trunk/boost/random/shuffle_order.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -111,16 +111,17 @@
      *
      * Complexity: Exactly k+1 invocations of the base generator.
      */
- template<class T>
- void seed(T& s) { _rng.seed(s); init(); }
+ BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(shuffle_order_engine,
+ result_type, seed_arg)
+ { _rng.seed(seed_arg); init(); }
     /**
      * Invokes the one-argument seed method of the base generator
- * with the parameter seed and re-initializes the internal buffer array.
+ * with the parameter seq and re-initializes the internal buffer array.
      *
      * Complexity: Exactly k+1 invocations of the base generator.
      */
- template<class T>
- void seed(const T& s) { _rng.seed(s); init(); }
+ BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(shuffle_order_engine, SeedSeq, seq)
+ { _rng.seed(seq); init(); }
     template<class It> void seed(It& first, It last)
     { _rng.seed(first, last); init(); }
 
@@ -203,7 +204,7 @@
     BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, shuffle_order_engine, s)
     {
         os << s._rng;
- for(int i = 0; i < k; ++i)
+ for(std::size_t i = 0; i < k; ++i)
             os << ' ' << s.v[i];
         os << ' ' << s.y;
         return os;
@@ -213,7 +214,7 @@
     BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, shuffle_order_engine, s)
     {
         is >> s._rng;
- for(int i = 0; i < k; ++i)
+ for(std::size_t i = 0; i < k; ++i)
             is >> std::ws >> s.v[i];
         is >> std::ws >> s.y;
         return is;

Modified: trunk/boost/random/subtract_with_carry.hpp
==============================================================================
--- trunk/boost/random/subtract_with_carry.hpp (original)
+++ trunk/boost/random/subtract_with_carry.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -66,7 +66,7 @@
 
     if(k < z) {
         // main loop: update full blocks from k = 0 to long_lag
- for(int i = 0; i < (z - k) / long_lag; ++i) {
+ for(std::size_t i = 0; i < (z - k) / long_lag; ++i) {
             for(std::size_t j = 0; j < short_lag; ++j) {
                 carry = eng.do_update(j, j + long_lag - short_lag, carry);
             }

Modified: trunk/libs/random/test/Jamfile.v2
==============================================================================
--- trunk/libs/random/test/Jamfile.v2 (original)
+++ trunk/libs/random/test/Jamfile.v2 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -8,7 +8,7 @@
 # bring in rules for testing
 import testing ;
 
-project /boost/random/test ;
+project /boost/random/test : requirements <toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS ;
 
 run test_const_mod.cpp /boost//unit_test_framework ;
 run test_generate_canonical.cpp /boost//unit_test_framework ;

Modified: trunk/libs/random/test/concepts.hpp
==============================================================================
--- trunk/libs/random/test/concepts.hpp (original)
+++ trunk/libs/random/test/concepts.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -9,8 +9,22 @@
  *
  */
 
+#ifndef BOOST_RANDOM_TEST_CONCEPTS_HPP
+#define BOOST_RANDOM_TEST_CONCEPTS_HPP
+
 #include <boost/config.hpp>
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4100)
+#endif
+
 #include <boost/concept_check.hpp>
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
 #include <boost/concept_archetype.hpp>
 #include <boost/concept/requires.hpp>
 #include <boost/mpl/assert.hpp>
@@ -22,8 +36,11 @@
 #include <istream>
 #include <ostream>
 
-#ifndef BOOST_RANDOM_TEST_CONCEPTS_HPP
-#define BOOST_RANDOM_TEST_CONCEPTS_HPP
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4510)
+#pragma warning(disable:4610)
+#endif
 
 namespace boost {
 namespace random {
@@ -135,7 +152,7 @@
     E v;
     const E x;
     seed_seq_archetype<> q;
- result_type s;
+ typename detail::seed_type<result_type>::type s;
     unsigned long long z;
 
     void check_extra(boost::mpl::true_ /*is_integral*/) {}
@@ -197,4 +214,8 @@
 }
 }
 
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
 #endif

Modified: trunk/libs/random/test/statistic_tests.hpp
==============================================================================
--- trunk/libs/random/test/statistic_tests.hpp (original)
+++ trunk/libs/random/test/statistic_tests.hpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -94,7 +94,7 @@
     for(int i = 0; i < n; ++i)
       count(f());
   }
- double probability(int i) const { return 1.0/classes(); }
+ double probability(int /*i*/) const { return 1.0/classes(); }
 };
 
 // two-dimensional equidistribution experiment

Modified: trunk/libs/random/test/test_bernoulli.cpp
==============================================================================
--- trunk/libs/random/test/test_bernoulli.cpp (original)
+++ trunk/libs/random/test/test_bernoulli.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -25,7 +25,7 @@
 bool do_test(double p, long long max) {
     std::cout << "running bernoulli(" << p << ")" << " " << max << " times: " << std::flush;
 
- boost::math::binomial expected(max, p);
+ boost::math::binomial expected(static_cast<double>(max), p);
     
     boost::random::bernoulli_distribution<> dist(p);
     boost::mt19937 gen;

Modified: trunk/libs/random/test/test_const_mod.cpp
==============================================================================
--- trunk/libs/random/test/test_const_mod.cpp (original)
+++ trunk/libs/random/test/test_const_mod.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -98,37 +98,37 @@
> int32_types;
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(test_mult32, IntType, int32_types) {
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(0, 0)), 0);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(0, 2147483562)), 0);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(2147483562, 0)), 0);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(2147483562, 2147483562)), 1);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(1234567890, 1234657890)), 813106682);
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(0, 0)), IntType(0));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(0, 2147483562)), IntType(0));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(2147483562, 0)), IntType(0));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(2147483562, 2147483562)), IntType(1));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(1234567890, 1234657890)), IntType(813106682));
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(test_add32, IntType, int32_types) {
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(0, 0)), 0);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(0, 2147483562)), 2147483562);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(2147483562, 0)), 2147483562);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(2147483562, 2147483562)), 2147483561);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(1234567890, 1234657890)), 321742217);
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(0, 0)), IntType(0));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(0, 2147483562)), IntType(2147483562));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(2147483562, 0)), IntType(2147483562));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(2147483562, 2147483562)), IntType(2147483561));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::add(1234567890, 1234657890)), IntType(321742217));
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(test_mult_add32, IntType, int32_types) {
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(0, 0, 0)), 0);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(0, 2147483562, 827364)), 827364);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(2147483562, 0, 827364)), 827364);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(2147483562, 2147483562, 2147483562)), 0);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(1234567890, 1234657890, 1726384759)), 392007878);
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(0, 0, 0)), IntType(0));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(0, 2147483562, 827364)), IntType(827364));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(2147483562, 0, 827364)), IntType(827364));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(2147483562, 2147483562, 2147483562)), IntType(0));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(1234567890, 1234657890, 1726384759)), IntType(392007878));
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(test_invert32, IntType, int32_types) {
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::invert(0)), 0);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(0, 0, 0)), 0);
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::invert(0)), IntType(0));
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult_add(0, 0, 0)), IntType(0));
     IntType inverse;
     inverse = boost::random::const_mod<IntType, 2147483563>::invert(2147483562);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(2147483562, inverse)), 1);
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(2147483562, inverse)), IntType(1));
     inverse = boost::random::const_mod<IntType, 2147483563>::invert(1234567890);
- BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(1234567890, inverse)), 1);
+ BOOST_CHECK_EQUAL((boost::random::const_mod<IntType, 2147483563>::mult(1234567890, inverse)), IntType(1));
 }
 
 #if !defined(BOOST_NO_INT64_T)
@@ -140,44 +140,44 @@
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(test_mult64, IntType, int64_types) {
     typedef boost::random::const_mod<IntType, INT64_C(2147483563652738498)> const_mod_type;
- BOOST_CHECK_EQUAL((const_mod_type::mult(0, 0)), 0);
- BOOST_CHECK_EQUAL((const_mod_type::mult(0, 2147483562)), 0);
- BOOST_CHECK_EQUAL((const_mod_type::mult(2147483562, 0)), 0);
- BOOST_CHECK_EQUAL((const_mod_type::mult(2147483562, 2147483562)), INT64_C(316718521754730848));
- BOOST_CHECK_EQUAL((const_mod_type::mult(1234567890, 1234657890)), INT64_C(1524268986129152100));
- BOOST_CHECK_EQUAL((const_mod_type::mult(INT64_C(1234567890726352938), INT64_C(1234657890736453927))), INT64_C(88656187017794672));
+ BOOST_CHECK_EQUAL((const_mod_type::mult(0, 0)), IntType(0));
+ BOOST_CHECK_EQUAL((const_mod_type::mult(0, 2147483562)), IntType(0));
+ BOOST_CHECK_EQUAL((const_mod_type::mult(2147483562, 0)), IntType(0));
+ BOOST_CHECK_EQUAL((const_mod_type::mult(2147483562, 2147483562)), IntType(INT64_C(316718521754730848)));
+ BOOST_CHECK_EQUAL((const_mod_type::mult(1234567890, 1234657890)), IntType(INT64_C(1524268986129152100)));
+ BOOST_CHECK_EQUAL((const_mod_type::mult(INT64_C(1234567890726352938), INT64_C(1234657890736453927))), IntType(INT64_C(88656187017794672)));
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(test_add64, IntType, int64_types) {
     typedef boost::random::const_mod<IntType, INT64_C(2147483563652738498)> const_mod_type;
- BOOST_CHECK_EQUAL((const_mod_type::add(0, 0)), 0);
- BOOST_CHECK_EQUAL((const_mod_type::add(0, 2147483562)), 2147483562);
- BOOST_CHECK_EQUAL((const_mod_type::add(2147483562, 0)), 2147483562);
- BOOST_CHECK_EQUAL((const_mod_type::add(2147483562, 2147483562)), 4294967124);
- BOOST_CHECK_EQUAL((const_mod_type::add(1234567890, 1234657890)), 2469225780);
- BOOST_CHECK_EQUAL((const_mod_type::add(INT64_C(1234567890726352938), INT64_C(1234657890736453927))), INT64_C(321742217810068367));
- BOOST_CHECK_EQUAL((const_mod_type::add(INT64_C(2147483563652738490), 8)), 0);
+ BOOST_CHECK_EQUAL((const_mod_type::add(0, 0)), IntType(0));
+ BOOST_CHECK_EQUAL((const_mod_type::add(0, 2147483562)), IntType(2147483562));
+ BOOST_CHECK_EQUAL((const_mod_type::add(2147483562, 0)), IntType(2147483562));
+ BOOST_CHECK_EQUAL((const_mod_type::add(2147483562, 2147483562)), IntType(4294967124U));
+ BOOST_CHECK_EQUAL((const_mod_type::add(1234567890, 1234657890)), IntType(2469225780U));
+ BOOST_CHECK_EQUAL((const_mod_type::add(INT64_C(1234567890726352938), INT64_C(1234657890736453927))), IntType(INT64_C(321742217810068367)));
+ BOOST_CHECK_EQUAL((const_mod_type::add(INT64_C(2147483563652738490), 8)), IntType(0));
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(test_mult_add64, IntType, int64_types) {
     typedef boost::random::const_mod<IntType, INT64_C(2147483563652738498)> const_mod_type;
- BOOST_CHECK_EQUAL((const_mod_type::mult_add(0, 0, 0)), 0);
- BOOST_CHECK_EQUAL((const_mod_type::mult_add(0, 2147483562, 827364)), 827364);
- BOOST_CHECK_EQUAL((const_mod_type::mult_add(2147483562, 0, 827364)), 827364);
- BOOST_CHECK_EQUAL((const_mod_type::mult_add(2147483562, 2147483562, 2147483562)), INT64_C(316718523902214410));
- BOOST_CHECK_EQUAL((const_mod_type::mult_add(1234567890, 1234657890, 1726384759)), INT64_C(1524268987855536859));
- BOOST_CHECK_EQUAL((const_mod_type::mult_add(INT64_C(1234567890726352938), INT64_C(1234657890736453927), INT64_C(1726384759726488649))), INT64_C(1815040946744283321));
+ BOOST_CHECK_EQUAL((const_mod_type::mult_add(0, 0, 0)), IntType(0));
+ BOOST_CHECK_EQUAL((const_mod_type::mult_add(0, 2147483562, 827364)), IntType(827364));
+ BOOST_CHECK_EQUAL((const_mod_type::mult_add(2147483562, 0, 827364)), IntType(827364));
+ BOOST_CHECK_EQUAL((const_mod_type::mult_add(2147483562, 2147483562, 2147483562)), IntType(INT64_C(316718523902214410)));
+ BOOST_CHECK_EQUAL((const_mod_type::mult_add(1234567890, 1234657890, 1726384759)), IntType(INT64_C(1524268987855536859)));
+ BOOST_CHECK_EQUAL((const_mod_type::mult_add(INT64_C(1234567890726352938), INT64_C(1234657890736453927), INT64_C(1726384759726488649))), IntType(INT64_C(1815040946744283321)));
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(test_invert64, IntType, int64_types) {
     typedef boost::random::const_mod<IntType, INT64_C(2147483563652738498)> const_mod_type;
- BOOST_CHECK_EQUAL((const_mod_type::invert(0)), 0);
- BOOST_CHECK_EQUAL((const_mod_type::mult_add(0, 0, 0)), 0);
+ BOOST_CHECK_EQUAL((const_mod_type::invert(0)), IntType(0));
+ BOOST_CHECK_EQUAL((const_mod_type::mult_add(0, 0, 0)), IntType(0));
     IntType inverse;
     inverse = const_mod_type::invert(INT64_C(7362947769));
- BOOST_CHECK_EQUAL((const_mod_type::mult(INT64_C(7362947769), inverse)), 1);
+ BOOST_CHECK_EQUAL((const_mod_type::mult(INT64_C(7362947769), inverse)), IntType(1));
     inverse = const_mod_type::invert(INT64_C(1263142436887493875));
- BOOST_CHECK_EQUAL((const_mod_type::mult(INT64_C(1263142436887493875), inverse)), 1);
+ BOOST_CHECK_EQUAL((const_mod_type::mult(INT64_C(1263142436887493875), inverse)), IntType(1));
 }
 
 #endif

Modified: trunk/libs/random/test/test_distribution.ipp
==============================================================================
--- trunk/libs/random/test/test_distribution.ipp (original)
+++ trunk/libs/random/test/test_distribution.ipp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -204,6 +204,8 @@
     BOOST_CHECK_EQUAL(dist, restored_dist);
 }
 
+void use(BOOST_RANDOM_DISTRIBUTION::result_type) {}
+
 BOOST_AUTO_TEST_CASE(test_generation) {
     boost::minstd_rand0 gen;
     BOOST_RANDOM_DISTRIBUTION dist BOOST_RANDOM_TEST1_PARAMS;
@@ -211,6 +213,7 @@
     typedef BOOST_RANDOM_DISTRIBUTION::result_type result_type;
     for(int i = 0; i < 10; ++i) {
         result_type value = dist(gen);
+ use(value);
 #ifdef BOOST_RANDOM_TEST1_MIN
         BOOST_CHECK_GE(value, BOOST_RANDOM_TEST1_MIN);
 #endif
@@ -218,6 +221,7 @@
         BOOST_CHECK_LE(value, BOOST_RANDOM_TEST1_MAX);
 #endif
         result_type value_two = dist_two(gen);
+ use(value_two);
 #ifdef BOOST_RANDOM_TEST2_MIN
         BOOST_CHECK_GE(value_two, BOOST_RANDOM_TEST2_MIN);
 #endif
@@ -225,6 +229,7 @@
         BOOST_CHECK_LE(value_two, BOOST_RANDOM_TEST2_MAX);
 #endif
         result_type value_param = dist_two(gen, dist.param());
+ use(value_param);
 #ifdef BOOST_RANDOM_TEST1_MIN
         BOOST_CHECK_GE(value_param, BOOST_RANDOM_TEST1_MIN);
 #endif
@@ -232,6 +237,7 @@
         BOOST_CHECK_LE(value_param, BOOST_RANDOM_TEST1_MAX);
 #endif
         result_type value_two_param = dist(gen, dist_two.param());
+ use(value_two_param);
 #ifdef BOOST_RANDOM_TEST2_MIN
         BOOST_CHECK_GE(value_two_param, BOOST_RANDOM_TEST2_MIN);
 #endif
@@ -248,6 +254,7 @@
     typedef BOOST_RANDOM_DISTRIBUTION::result_type result_type;
     for(int i = 0; i < 10; ++i) {
         result_type value = dist(gen);
+ use(value);
 #ifdef BOOST_RANDOM_TEST1_MIN
         BOOST_CHECK_GE(value, BOOST_RANDOM_TEST1_MIN);
 #endif
@@ -255,6 +262,7 @@
         BOOST_CHECK_LE(value, BOOST_RANDOM_TEST1_MAX);
 #endif
         result_type value_two = dist_two(gen);
+ use(value_two);
 #ifdef BOOST_RANDOM_TEST2_MIN
         BOOST_CHECK_GE(value_two, BOOST_RANDOM_TEST2_MIN);
 #endif
@@ -262,6 +270,7 @@
         BOOST_CHECK_LE(value_two, BOOST_RANDOM_TEST2_MAX);
 #endif
         result_type value_param = dist_two(gen, dist.param());
+ use(value_param);
 #ifdef BOOST_RANDOM_TEST1_MIN
         BOOST_CHECK_GE(value_param, BOOST_RANDOM_TEST1_MIN);
 #endif
@@ -269,6 +278,7 @@
         BOOST_CHECK_LE(value_param, BOOST_RANDOM_TEST1_MAX);
 #endif
         result_type value_two_param = dist(gen, dist_two.param());
+ use(value_two_param);
 #ifdef BOOST_RANDOM_TEST2_MIN
         BOOST_CHECK_GE(value_two_param, BOOST_RANDOM_TEST2_MIN);
 #endif

Modified: trunk/libs/random/test/test_ecuyer1988.cpp
==============================================================================
--- trunk/libs/random/test/test_ecuyer1988.cpp (original)
+++ trunk/libs/random/test/test_ecuyer1988.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -15,9 +15,9 @@
 
 #define BOOST_RANDOM_SEED_WORDS 2
 
-#define BOOST_RANDOM_VALIDATION_VALUE 2060321752
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1416886025
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 776923198
+#define BOOST_RANDOM_VALIDATION_VALUE 2060321752U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1416886025U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 776923198U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0x7AE0C087U, 0x948A8A31U, 0xBE5CCBA9U, 0x1316692CU }
 

Modified: trunk/libs/random/test/test_generator.ipp
==============================================================================
--- trunk/libs/random/test/test_generator.ipp (original)
+++ trunk/libs/random/test/test_generator.ipp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -19,6 +19,7 @@
 BOOST_CONCEPT_ASSERT((RandomNumberEngine< BOOST_RANDOM_URNG >));
 
 typedef BOOST_RANDOM_URNG::result_type result_type;
+typedef boost::random::detail::seed_type<result_type>::type seed_type;
 
 #ifdef BOOST_MSVC
 #pragma warning(push)
@@ -43,7 +44,7 @@
 #pragma warning(pop)
 #endif
 
-void test_seed(result_type value)
+void test_seed(seed_type value)
 {
     BOOST_RANDOM_URNG urng(value);
 
@@ -80,10 +81,10 @@
 
 BOOST_AUTO_TEST_CASE(test_arithmetic_seed)
 {
- test_seed(static_cast<result_type>(0));
- test_seed(static_cast<result_type>(127));
- test_seed(static_cast<result_type>(539157235));
- test_seed(static_cast<result_type>(~0u));
+ test_seed(static_cast<seed_type>(0));
+ test_seed(static_cast<seed_type>(127));
+ test_seed(static_cast<seed_type>(539157235));
+ test_seed(static_cast<seed_type>(~0u));
 }
    
 BOOST_AUTO_TEST_CASE(test_iterator_seed)

Modified: trunk/libs/random/test/test_geometric.cpp
==============================================================================
--- trunk/libs/random/test/test_geometric.cpp (original)
+++ trunk/libs/random/test/test_geometric.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -12,6 +12,7 @@
 #include <boost/random/geometric_distribution.hpp>
 #include <boost/random/uniform_real.hpp>
 #include <boost/math/distributions/geometric.hpp>
+#include <boost/numeric/conversion/cast.hpp>
 
 #define BOOST_RANDOM_DISTRIBUTION boost::random::geometric_distribution<>
 #define BOOST_RANDOM_DISTRIBUTION_NAME geometric
@@ -20,6 +21,6 @@
 #define BOOST_RANDOM_ARG1_NAME p
 #define BOOST_RANDOM_ARG1_DEFAULT 0.5
 #define BOOST_RANDOM_ARG1_DISTRIBUTION(n) boost::uniform_real<>(0.0001, 0.9999)
-#define BOOST_RANDOM_DISTRIBUTION_MAX (-5 / std::log(1-p))
+#define BOOST_RANDOM_DISTRIBUTION_MAX boost::numeric_cast<int>(-5 / std::log(1-p))
 
 #include "test_real_distribution.ipp"

Modified: trunk/libs/random/test/test_hellekalek1995.cpp
==============================================================================
--- trunk/libs/random/test/test_hellekalek1995.cpp (original)
+++ trunk/libs/random/test/test_hellekalek1995.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -15,9 +15,9 @@
 
 #define BOOST_RANDOM_SEED_WORDS 1
 
-#define BOOST_RANDOM_VALIDATION_VALUE 1187812169
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1081665111
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 618743552
+#define BOOST_RANDOM_VALIDATION_VALUE 1187812169U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1081665111U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 618743552U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0x5642A47BU, 0x1F6987E8U, 0xD35860E7U, 0xC8C661ABU }
 

Modified: trunk/libs/random/test/test_independent_bits31.cpp
==============================================================================
--- trunk/libs/random/test/test_independent_bits31.cpp (original)
+++ trunk/libs/random/test/test_independent_bits31.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -17,9 +17,9 @@
 
 #define BOOST_RANDOM_SEED_WORDS 1
 
-#define BOOST_RANDOM_VALIDATION_VALUE 26292962
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1147343739
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 1399154219
+#define BOOST_RANDOM_VALIDATION_VALUE 26292962U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1147343739U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 1399154219U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0xC1A63AF0U, 0xD66C0614U, 0xADE076B1U, 0xC1DAE13FU }
 

Modified: trunk/libs/random/test/test_independent_bits32.cpp
==============================================================================
--- trunk/libs/random/test/test_independent_bits32.cpp (original)
+++ trunk/libs/random/test/test_independent_bits32.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -18,8 +18,8 @@
 #define BOOST_RANDOM_SEED_WORDS 624
 
 #define BOOST_RANDOM_VALIDATION_VALUE 4123659995U
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 3107690757
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 3408548740
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 3107690757U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 3408548740U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0xD091BB5CU, 0x22AE9EF6U, 0xE7E1FAEEU, 0xD5C31F79U }
 

Modified: trunk/libs/random/test/test_knuth_b.cpp
==============================================================================
--- trunk/libs/random/test/test_knuth_b.cpp (original)
+++ trunk/libs/random/test/test_knuth_b.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -17,9 +17,9 @@
 #define BOOST_RANDOM_SEED_WORDS 1
 
 // validation from the C++0x draft (n3090)
-#define BOOST_RANDOM_VALIDATION_VALUE 1112339016
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 160100893
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 1692601883
+#define BOOST_RANDOM_VALIDATION_VALUE 1112339016U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 160100893U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 1692601883U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0x5D189C63U, 0xD0544F0EU, 0x15B0E78FU, 0xD814D654U }
 

Modified: trunk/libs/random/test/test_kreutzer1986.cpp
==============================================================================
--- trunk/libs/random/test/test_kreutzer1986.cpp (original)
+++ trunk/libs/random/test/test_kreutzer1986.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -17,9 +17,9 @@
 #define BOOST_RANDOM_SEED_WORDS 1
 
 // validation by experiment from Harry Erwin's generator.h (private e-mail)
-#define BOOST_RANDOM_VALIDATION_VALUE 139726
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 227233
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 163138
+#define BOOST_RANDOM_VALIDATION_VALUE 139726U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 227233U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 163138U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0x3EADAB08U, 0x85E481CEU, 0xCF84AEA5U, 0x39D4395BU }
 

Modified: trunk/libs/random/test/test_lagged_fibonacci.cpp
==============================================================================
--- trunk/libs/random/test/test_lagged_fibonacci.cpp (original)
+++ trunk/libs/random/test/test_lagged_fibonacci.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -16,9 +16,9 @@
 
 #define BOOST_RANDOM_SEED_WORDS 607
 
-#define BOOST_RANDOM_VALIDATION_VALUE 3543833
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 7852929
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 4372778
+#define BOOST_RANDOM_VALIDATION_VALUE 3543833U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 7852929U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 4372778U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0xF61A5094U, 0xFC4BA046U, 0xF1C41E92U, 0x3D82FE61U }
 

Modified: trunk/libs/random/test/test_minstd_rand.cpp
==============================================================================
--- trunk/libs/random/test/test_minstd_rand.cpp (original)
+++ trunk/libs/random/test/test_minstd_rand.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -17,9 +17,9 @@
 #define BOOST_RANDOM_SEED_WORDS 1
 
 // validation values from the publications
-#define BOOST_RANDOM_VALIDATION_VALUE 399268537
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 2096435890
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 182651141
+#define BOOST_RANDOM_VALIDATION_VALUE 399268537U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 2096435890U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 182651141U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0x8400BC8EU, 0xF45B895FU, 0x145F0F91U, 0xE5F8F088U }
 

Modified: trunk/libs/random/test/test_minstd_rand0.cpp
==============================================================================
--- trunk/libs/random/test/test_minstd_rand0.cpp (original)
+++ trunk/libs/random/test/test_minstd_rand0.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -17,9 +17,9 @@
 #define BOOST_RANDOM_SEED_WORDS 1
 
 // validation values from the publications
-#define BOOST_RANDOM_VALIDATION_VALUE 1043618065
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 849515105
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 1263181168
+#define BOOST_RANDOM_VALIDATION_VALUE 1043618065U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 849515105U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 1263181168U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0xC00041A6U, 0xCD8358EBU, 0x430A4B7AU, 0x31B781ADU }
 

Modified: trunk/libs/random/test/test_piecewise_constant.cpp
==============================================================================
--- trunk/libs/random/test/test_piecewise_constant.cpp (original)
+++ trunk/libs/random/test/test_piecewise_constant.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -60,7 +60,7 @@
     return dist.cdf(x);
 }
 
-bool do_test(int n, long long max) {
+bool do_test(int n, int max) {
     std::cout << "running piecewise_constant(p0, p1, ..., p" << n-1 << ")" << " " << max << " times: " << std::flush;
 
     std::vector<double> weights;
@@ -93,7 +93,7 @@
     return result;
 }
 
-bool do_tests(int repeat, int max_n, long long trials) {
+bool do_tests(int repeat, int max_n, int trials) {
     boost::mt19937 gen;
     boost::uniform_int<> idist(1, max_n);
     int errors = 0;
@@ -128,7 +128,7 @@
 int main(int argc, char** argv) {
     int repeat = 10;
     int max_n = 10;
- long long trials = 1000000ll;
+ int trials = 1000000;
 
     if(argc > 0) {
         --argc;

Modified: trunk/libs/random/test/test_piecewise_linear.cpp
==============================================================================
--- trunk/libs/random/test/test_piecewise_linear.cpp (original)
+++ trunk/libs/random/test/test_piecewise_linear.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -77,7 +77,7 @@
     return dist.cdf(x);
 }
 
-bool do_test(int n, long long max) {
+bool do_test(int n, int max) {
     std::cout << "running piecewise_linear(p0, p1, ..., p" << n-1 << ")" << " " << max << " times: " << std::flush;
 
     std::vector<double> weights;
@@ -110,7 +110,7 @@
     return result;
 }
 
-bool do_tests(int repeat, int max_n, long long trials) {
+bool do_tests(int repeat, int max_n, int trials) {
     boost::mt19937 gen;
     boost::uniform_int<> idist(2, max_n);
     int errors = 0;
@@ -145,7 +145,7 @@
 int main(int argc, char** argv) {
     int repeat = 10;
     int max_n = 10;
- long long trials = 1000000ll;
+ int trials = 1000000;
 
     if(argc > 0) {
         --argc;

Modified: trunk/libs/random/test/test_rand48.cpp
==============================================================================
--- trunk/libs/random/test/test_rand48.cpp (original)
+++ trunk/libs/random/test/test_rand48.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -17,7 +17,7 @@
 #define BOOST_RANDOM_SEED_WORDS 2
 
 // by experiment from lrand48()
-#define BOOST_RANDOM_VALIDATION_VALUE 1993516219
+#define BOOST_RANDOM_VALIDATION_VALUE 1993516219U
 #define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1127873718U
 #define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 839037874U
 

Modified: trunk/libs/random/test/test_random_device.cpp
==============================================================================
--- trunk/libs/random/test/test_random_device.cpp (original)
+++ trunk/libs/random/test/test_random_device.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -13,7 +13,7 @@
 #include <boost/test/test_tools.hpp>
 #include <boost/test/included/test_exec_monitor.hpp>
 
-int test_main(int argc, char** argv) {
+int test_main(int, char**) {
     boost::random_device rng;
     double entropy = rng.entropy();
     BOOST_CHECK_GE(entropy, 0);

Modified: trunk/libs/random/test/test_ranlux24.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux24.cpp (original)
+++ trunk/libs/random/test/test_ranlux24.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -17,9 +17,9 @@
 #define BOOST_RANDOM_SEED_WORDS 24
 
 // validation from the C++0x draft (n3090)
-#define BOOST_RANDOM_VALIDATION_VALUE 9901578
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 4870344
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 3888733
+#define BOOST_RANDOM_VALIDATION_VALUE 9901578U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 4870344U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 3888733U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
 

Modified: trunk/libs/random/test/test_ranlux24_base.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux24_base.cpp (original)
+++ trunk/libs/random/test/test_ranlux24_base.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -16,9 +16,9 @@
 #define BOOST_RANDOM_SEED_WORDS 24
 
 // validation from the C++0x draft (n3126).
-#define BOOST_RANDOM_VALIDATION_VALUE 7937952
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 836370
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 7739608
+#define BOOST_RANDOM_VALIDATION_VALUE 7937952U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 836370U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 7739608U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
 

Modified: trunk/libs/random/test/test_ranlux3.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux3.cpp (original)
+++ trunk/libs/random/test/test_ranlux3.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -16,9 +16,9 @@
 #define BOOST_RANDOM_SEED_WORDS 24
 
 // principal operation validated with CLHEP, values by experiment
-#define BOOST_RANDOM_VALIDATION_VALUE 5957620
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1848500
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 11620328
+#define BOOST_RANDOM_VALIDATION_VALUE 5957620U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 1848500U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 11620328U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
 

Modified: trunk/libs/random/test/test_ranlux4.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux4.cpp (original)
+++ trunk/libs/random/test/test_ranlux4.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -16,9 +16,9 @@
 #define BOOST_RANDOM_SEED_WORDS 24
 
 // principal operation validated with CLHEP, values by experiment
-#define BOOST_RANDOM_VALIDATION_VALUE 8587295
-#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 6375782
-#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 4515722
+#define BOOST_RANDOM_VALIDATION_VALUE 8587295U
+#define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE 6375782U
+#define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE 4515722U
 
 #define BOOST_RANDOM_GENERATE_VALUES { 0x55E57B2CU, 0xF2DEF915U, 0x6D1A0CD9U, 0xCA0109F9U }
 

Modified: trunk/libs/random/test/test_ranlux64_3.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux64_3.cpp (original)
+++ trunk/libs/random/test/test_ranlux64_3.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -18,7 +18,7 @@
 #define BOOST_RANDOM_SEED_WORDS 48
 
 // principal operation validated with CLHEP, values by experiment
-#define BOOST_RANDOM_VALIDATION_VALUE INT64_C(141789170949364)
+#define BOOST_RANDOM_VALIDATION_VALUE UINT64_C(141789170949364)
 #define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(97179253367494)
 #define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(101724473226966)
 

Modified: trunk/libs/random/test/test_ranlux64_4.cpp
==============================================================================
--- trunk/libs/random/test/test_ranlux64_4.cpp (original)
+++ trunk/libs/random/test/test_ranlux64_4.cpp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -18,7 +18,7 @@
 #define BOOST_RANDOM_SEED_WORDS 48
 
 // principal operation validated with CLHEP, values by experiment
-#define BOOST_RANDOM_VALIDATION_VALUE INT64_C(199461971133682)
+#define BOOST_RANDOM_VALIDATION_VALUE UINT64_C(199461971133682)
 #define BOOST_RANDOM_SEED_SEQ_VALIDATION_VALUE UINT64_C(63570328604787)
 #define BOOST_RANDOM_ITERATOR_VALIDATION_VALUE UINT64_C(40074210927900)
 

Modified: trunk/libs/random/test/test_real_distribution.ipp
==============================================================================
--- trunk/libs/random/test/test_real_distribution.ipp (original)
+++ trunk/libs/random/test/test_real_distribution.ipp 2011-03-15 23:24:42 EDT (Tue, 15 Mar 2011)
@@ -34,6 +34,7 @@
 #include <boost/exception/diagnostic_information.hpp>
 #include <boost/preprocessor/stringize.hpp>
 #include <boost/range/numeric.hpp>
+#include <boost/numeric/conversion/cast.hpp>
 #include <iostream>
 #include <vector>
 
@@ -82,7 +83,7 @@
 
 #else
 
- kolmogorov_experiment test(max);
+ kolmogorov_experiment test(boost::numeric_cast<int>(max));
     boost::variate_generator<boost::mt19937&, BOOST_RANDOM_DISTRIBUTION > vgen(gen, dist);
 
     double prob = test.probability(test.run(vgen, expected));


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