Blame SOURCES/boost-1.60-multiprecision.patch

3c181a
commit f9c8f9ec091ad232c0a291904f7839d665d098e0
3c181a
Author: jzmaddock <john@johnmaddock.co.uk>
3c181a
Date:   Thu Mar 3 10:52:03 2016 +0000
3c181a
3c181a
    Add some needed casts for cases where limb_type is wider than unsigned int.
3c181a
3c181a
diff --git a/include/boost/multiprecision/cpp_int.hpp b/include/boost/multiprecision/cpp_int.hpp
3c181a
index 60ad876..b868167 100644
3c181a
--- a/include/boost/multiprecision/cpp_int.hpp
3c181a
+++ b/include/boost/multiprecision/cpp_int.hpp
3c181a
@@ -190,7 +190,7 @@ private:
3c181a
 public:
3c181a
    BOOST_STATIC_CONSTANT(unsigned, limb_bits = sizeof(limb_type) * CHAR_BIT);
3c181a
    BOOST_STATIC_CONSTANT(limb_type, max_limb_value = ~static_cast<limb_type>(0u));
3c181a
-   BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1));
3c181a
+   BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = static_cast<limb_type>(1u) << (limb_bits - 1));
3c181a
    BOOST_STATIC_CONSTANT(unsigned, internal_limb_count =
3c181a
       MinBits
3c181a
          ? (MinBits / limb_bits + ((MinBits % limb_bits) ? 1 : 0))
3c181a
@@ -413,7 +413,7 @@ struct cpp_int_base<MinBits, MinBits, signed_magnitude, Checked, void, false>
3c181a
 public:
3c181a
    BOOST_STATIC_CONSTANT(unsigned, limb_bits = sizeof(limb_type) * CHAR_BIT);
3c181a
    BOOST_STATIC_CONSTANT(limb_type, max_limb_value = ~static_cast<limb_type>(0u));
3c181a
-   BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1));
3c181a
+   BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = static_cast<limb_type>(1u) << (limb_bits - 1));
3c181a
    BOOST_STATIC_CONSTANT(unsigned, internal_limb_count = MinBits / limb_bits + ((MinBits % limb_bits) ? 1 : 0));
3c181a
    BOOST_STATIC_CONSTANT(bool, variable = false);
3c181a
    BOOST_STATIC_CONSTANT(limb_type, upper_limb_mask = (MinBits % limb_bits) ? (limb_type(1) << (MinBits % limb_bits)) -1 : (~limb_type(0)));
3c181a
@@ -565,7 +565,7 @@ struct cpp_int_base<MinBits, MinBits, unsigned_magnitude, Checked, void, false>
3c181a
 public:
3c181a
    BOOST_STATIC_CONSTANT(unsigned, limb_bits = sizeof(limb_type) * CHAR_BIT);
3c181a
    BOOST_STATIC_CONSTANT(limb_type, max_limb_value = ~static_cast<limb_type>(0u));
3c181a
-   BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = 1u << (limb_bits - 1));
3c181a
+   BOOST_STATIC_CONSTANT(limb_type, sign_bit_mask = static_cast<limb_type>(1u) << (limb_bits - 1));
3c181a
    BOOST_STATIC_CONSTANT(unsigned, internal_limb_count = MinBits / limb_bits + ((MinBits % limb_bits) ? 1 : 0));
3c181a
    BOOST_STATIC_CONSTANT(bool, variable = false);
3c181a
    BOOST_STATIC_CONSTANT(limb_type, upper_limb_mask = (MinBits % limb_bits) ? (limb_type(1) << (MinBits % limb_bits)) -1 : (~limb_type(0)));