Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80609 - in sandbox/big_number: boost/multiprecision boost/multiprecision/detail libs/multiprecision/test
From: john_at_[hidden]
Date: 2012-09-20 14:21:08


Author: johnmaddock
Date: 2012-09-20 14:21:07 EDT (Thu, 20 Sep 2012)
New Revision: 80609
URL: http://svn.boost.org/trac/boost/changeset/80609

Log:
Fix Intel -x64 failures.
Text files modified:
   sandbox/big_number/boost/multiprecision/cpp_int.hpp | 44 ++++++++++++++++++++--------------------
   sandbox/big_number/boost/multiprecision/detail/number_base.hpp | 2
   sandbox/big_number/boost/multiprecision/detail/number_compare.hpp | 2
   sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp | 2
   4 files changed, 25 insertions(+), 25 deletions(-)

Modified: sandbox/big_number/boost/multiprecision/cpp_int.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/cpp_int.hpp (original)
+++ sandbox/big_number/boost/multiprecision/cpp_int.hpp 2012-09-20 14:21:07 EDT (Thu, 20 Sep 2012)
@@ -1156,15 +1156,10 @@
       typename enable_if_c<
          (MinBits2 <= MinBits)
          && (Signed || !Signed2)
- >::type* = 0)
+ >::type* = 0) BOOST_NOEXCEPT
       : base_type()
    {
- *this = static_cast<
- typename boost::multiprecision::detail::canonical<
- typename cpp_int_backend<MinBits2, Signed2, Allocator2, true>::local_limb_type,
- cpp_int_backend<MinBits, Signed, void, true>
- >::type
- >(*other.limbs());
+ *this->limbs() = static_cast<typename cpp_int_backend<MinBits, Signed, void, true>::local_limb_type>(*other.limbs());
       this->sign(other.sign());
    }
    template <unsigned MinBits2, bool Signed2, class Allocator2>
@@ -1172,31 +1167,21 @@
       typename disable_if_c<
          (MinBits2 <= MinBits)
          && (Signed || !Signed2)
- >::type* = 0)
+ >::type* = 0) BOOST_NOEXCEPT
       : base_type()
    {
- *this = static_cast<
- typename boost::multiprecision::detail::canonical<
- typename cpp_int_backend<MinBits2, Signed2, Allocator2, true>::local_limb_type,
- cpp_int_backend<MinBits, Signed, void, true>
- >::type
- >(*other.limbs());
+ *this->limbs() = static_cast<typename cpp_int_backend<MinBits, Signed, void, true>::local_limb_type>(*other.limbs());
       this->sign(other.sign());
    }
    template <unsigned MinBits2, bool Signed2, class Allocator2>
- cpp_int_backend& operator = (const cpp_int_backend<MinBits2, Signed2, Allocator2, true>& other)
+ cpp_int_backend& operator = (const cpp_int_backend<MinBits2, Signed2, Allocator2, true>& other)BOOST_NOEXCEPT
    {
- *this = static_cast<
- typename boost::multiprecision::detail::canonical<
- typename cpp_int_backend<MinBits2, Signed2, Allocator2, true>::local_limb_type,
- cpp_int_backend<MinBits, Signed, void, true>
- >::type
- >(*other.limbs());
+ *this->limbs() = static_cast<typename cpp_int_backend<MinBits, Signed, void, true>::local_limb_type>(*other.limbs());
       this->sign(other.sign());
       return *this;
    }
    template <unsigned MinBits2, bool Signed2, class Allocator2>
- explicit cpp_int_backend(const cpp_int_backend<MinBits2, Signed2, Allocator2, false>& other)
+ explicit cpp_int_backend(const cpp_int_backend<MinBits2, Signed2, Allocator2, false>& other)BOOST_NOEXCEPT
       : base_type()
    {
       // We can only ever copy two limbs from other:
@@ -1210,6 +1195,21 @@
       }
       this->sign(other.sign());
    }
+ template <unsigned MinBits2, bool Signed2, class Allocator2>
+ cpp_int_backend& operator=(const cpp_int_backend<MinBits2, Signed2, Allocator2, false>& other)BOOST_NOEXCEPT
+ {
+ // We can only ever copy two limbs from other:
+ if(other.size() == 1)
+ {
+ *this->limbs() = *other.limbs();
+ }
+ else
+ {
+ *this->limbs() = static_cast<double_limb_type>(*other.limbs()) | (static_cast<double_limb_type>(other.limbs()[1]) << (sizeof(limb_type) * CHAR_BIT));
+ }
+ this->sign(other.sign());
+ return *this;
+ }
 
    BOOST_FORCEINLINE void swap(cpp_int_backend& o) BOOST_NOEXCEPT
    {

Modified: sandbox/big_number/boost/multiprecision/detail/number_base.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/detail/number_base.hpp (original)
+++ sandbox/big_number/boost/multiprecision/detail/number_base.hpp 2012-09-20 14:21:07 EDT (Thu, 20 Sep 2012)
@@ -218,7 +218,7 @@
 struct combine_expression
 {
 #ifdef BOOST_NO_DECLTYPE
- typedef typename mpl::if_c<sizeof(T1) > sizeof(T2) ? T1, T2>::type type;
+ typedef typename mpl::if_c<(sizeof(T1() + T2()) == sizeof(T1)), T1, T2>::type type;
 #else
    typedef decltype(T1() + T2()) type;
 #endif

Modified: sandbox/big_number/boost/multiprecision/detail/number_compare.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/detail/number_compare.hpp (original)
+++ sandbox/big_number/boost/multiprecision/detail/number_compare.hpp 2012-09-20 14:21:07 EDT (Thu, 20 Sep 2012)
@@ -78,7 +78,7 @@
 struct is_valid_mixed_compare : public mpl::false_ {};
 
 template <class B, expression_template_option ET, class Val>
-struct is_valid_mixed_compare<number<B, ET>, Val> : public is_convertible<Val, number<B, ET>> {};
+struct is_valid_mixed_compare<number<B, ET>, Val> : public is_convertible<Val, number<B, ET> > {};
 
 template <class B, expression_template_option ET>
 struct is_valid_mixed_compare<number<B, ET>, number<B, ET> > : public mpl::false_ {};

Modified: sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp 2012-09-20 14:21:07 EDT (Thu, 20 Sep 2012)
@@ -1383,7 +1383,7 @@
 }
 
 template <class Real>
-void test_members(boost::rational<Real> v)
+void test_members(boost::rational<Real>)
 {
 }
 


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