diff DEPENDENCIES/generic/include/boost/random/detail/large_arithmetic.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
line wrap: on
line diff
--- a/DEPENDENCIES/generic/include/boost/random/detail/large_arithmetic.hpp	Fri Sep 04 12:01:02 2015 +0100
+++ b/DEPENDENCIES/generic/include/boost/random/detail/large_arithmetic.hpp	Mon Sep 07 11:12:49 2015 +0100
@@ -7,7 +7,7 @@
  *
  * See http://www.boost.org for most recent version including documentation.
  *
- * $Id: large_arithmetic.hpp 71018 2011-04-05 21:27:52Z steven_watanabe $
+ * $Id$
  */
 
 #ifndef BOOST_RANDOM_DETAIL_LARGE_ARITHMETIC_HPP
@@ -31,9 +31,9 @@
 
 inline div_t muldivmod(boost::uintmax_t a, boost::uintmax_t b, boost::uintmax_t m)
 {
-    static const int bits =
+    const int bits =
         ::std::numeric_limits< ::boost::uintmax_t>::digits / 2;
-    static const ::boost::uintmax_t mask = (::boost::uintmax_t(1) << bits) - 1;
+    const ::boost::uintmax_t mask = (::boost::uintmax_t(1) << bits) - 1;
     typedef ::boost::uint_t<bits>::fast digit_t;
 
     int shift = std::numeric_limits< ::boost::uintmax_t>::digits - 1
@@ -96,8 +96,8 @@
 
         quotient[i - 2] = q;
         product[i] = 0;
-        product[i-1] = (rem >> bits) & mask;
-        product[i-2] = rem & mask;
+        product[i-1] = static_cast<digit_t>((rem >> bits) & mask);
+        product[i-2] = static_cast<digit_t>(rem & mask);
     }
 
     div_t result = {