Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84220 - in trunk/boost/multiprecision: . cpp_int
From: john_at_[hidden]
Date: 2013-05-10 08:20:22


Author: johnmaddock
Date: 2013-05-10 08:20:22 EDT (Fri, 10 May 2013)
New Revision: 84220
URL: http://svn.boost.org/trac/boost/changeset/84220

Log:
Fix sizeof usage: fixes gcc-4.8.0 and clang failures.
Text files modified:
   trunk/boost/multiprecision/cpp_int.hpp | 4 ++--
   trunk/boost/multiprecision/cpp_int/literals.hpp | 10 +++++-----
   2 files changed, 7 insertions(+), 7 deletions(-)

Modified: trunk/boost/multiprecision/cpp_int.hpp
==============================================================================
--- trunk/boost/multiprecision/cpp_int.hpp (original)
+++ trunk/boost/multiprecision/cpp_int.hpp 2013-05-10 08:20:22 EDT (Fri, 10 May 2013)
@@ -456,7 +456,7 @@
 #if defined(BOOST_MP_USER_DEFINED_LITERALS)
       template <limb_type...VALUES>
       BOOST_CONSTEXPR cpp_int_base(literals::detail::value_pack<VALUES...> i)
- : m_wrapper(i), m_limbs(sizeof...VALUES), m_sign(false) {}
+ : m_wrapper(i), m_limbs(sizeof...(VALUES)), m_sign(false) {}
       BOOST_CONSTEXPR cpp_int_base(literals::detail::value_pack<> i)
          : m_wrapper(i), m_limbs(1), m_sign(false) {}
       BOOST_CONSTEXPR cpp_int_base(const cpp_int_base& a, const literals::detail::negate_tag&)
@@ -604,7 +604,7 @@
 #if defined(BOOST_MP_USER_DEFINED_LITERALS)
       template <limb_type...VALUES>
       BOOST_CONSTEXPR cpp_int_base(literals::detail::value_pack<VALUES...> i)
- : m_wrapper(i), m_limbs(sizeof...VALUES) {}
+ : m_wrapper(i), m_limbs(sizeof...(VALUES)) {}
       BOOST_CONSTEXPR cpp_int_base(literals::detail::value_pack<>)
          : m_wrapper(static_cast<limb_type>(0u)), m_limbs(1) {}
 #endif

Modified: trunk/boost/multiprecision/cpp_int/literals.hpp
==============================================================================
--- trunk/boost/multiprecision/cpp_int/literals.hpp (original)
+++ trunk/boost/multiprecision/cpp_int/literals.hpp 2013-05-10 08:20:22 EDT (Fri, 10 May 2013)
@@ -48,7 +48,7 @@
 struct pack_values
 {
    static constexpr unsigned chars_per_limb = sizeof(limb_type) * CHAR_BIT / 4;
- static constexpr unsigned shift = ((sizeof...CHARS) % chars_per_limb) * 4;
+ static constexpr unsigned shift = ((sizeof...(CHARS)) % chars_per_limb) * 4;
    static constexpr limb_type value_to_add = shift ? hex_value<NextChar>::value << shift : hex_value<NextChar>::value;
 
    typedef typename pack_values<CHARS...>::type recursive_packed_type;
@@ -144,17 +144,17 @@
 }
 
 template <char... STR>
-constexpr typename boost::multiprecision::literals::detail::signed_cpp_int_literal_result_type<(sizeof...STR) - 2>::number_type operator "" _cppi()
+constexpr typename boost::multiprecision::literals::detail::signed_cpp_int_literal_result_type<(sizeof...(STR)) - 2>::number_type operator "" _cppi()
 {
    typedef typename boost::multiprecision::literals::detail::make_packed_value_from_str<STR...>::type pt;
- return boost::multiprecision::literals::detail::make_backend_from_pack<pt, typename boost::multiprecision::literals::detail::signed_cpp_int_literal_result_type<(sizeof...STR) - 2>::backend_type>::value;
+ return boost::multiprecision::literals::detail::make_backend_from_pack<pt, typename boost::multiprecision::literals::detail::signed_cpp_int_literal_result_type<(sizeof...(STR)) - 2>::backend_type>::value;
 }
 
 template <char... STR>
-constexpr typename boost::multiprecision::literals::detail::unsigned_cpp_int_literal_result_type<(sizeof...STR) - 2>::number_type operator "" _cppui()
+constexpr typename boost::multiprecision::literals::detail::unsigned_cpp_int_literal_result_type<(sizeof...(STR)) - 2>::number_type operator "" _cppui()
 {
    typedef typename boost::multiprecision::literals::detail::make_packed_value_from_str<STR...>::type pt;
- return boost::multiprecision::literals::detail::make_backend_from_pack<pt, typename boost::multiprecision::literals::detail::unsigned_cpp_int_literal_result_type<(sizeof...STR) - 2>::backend_type>::value;
+ return boost::multiprecision::literals::detail::make_backend_from_pack<pt, typename boost::multiprecision::literals::detail::unsigned_cpp_int_literal_result_type<(sizeof...(STR)) - 2>::backend_type>::value;
 }
 
 #define BOOST_MP_DEFINE_SIZED_CPP_INT_LITERAL(Bits)\


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