From eede16de828f589a50ef36fed1231400df1908bb Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 10 May 2013 12:20:22 +0000 Subject: [PATCH] Fix sizeof usage: fixes gcc-4.8.0 and clang failures. [SVN r84220] --- include/boost/multiprecision/cpp_int.hpp | 4 ++-- include/boost/multiprecision/cpp_int/literals.hpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/multiprecision/cpp_int.hpp b/include/boost/multiprecision/cpp_int.hpp index 9ffef52e..b4c432f8 100644 --- a/include/boost/multiprecision/cpp_int.hpp +++ b/include/boost/multiprecision/cpp_int.hpp @@ -456,7 +456,7 @@ public: #if defined(BOOST_MP_USER_DEFINED_LITERALS) template BOOST_CONSTEXPR cpp_int_base(literals::detail::value_pack 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 @@ public: #if defined(BOOST_MP_USER_DEFINED_LITERALS) template BOOST_CONSTEXPR cpp_int_base(literals::detail::value_pack 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(0u)), m_limbs(1) {} #endif diff --git a/include/boost/multiprecision/cpp_int/literals.hpp b/include/boost/multiprecision/cpp_int/literals.hpp index 79eecd02..ce30fd84 100644 --- a/include/boost/multiprecision/cpp_int/literals.hpp +++ b/include/boost/multiprecision/cpp_int/literals.hpp @@ -48,7 +48,7 @@ template 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::value << shift : hex_value::value; typedef typename pack_values::type recursive_packed_type; @@ -144,17 +144,17 @@ struct unsigned_cpp_int_literal_result_type } template -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::type pt; - return boost::multiprecision::literals::detail::make_backend_from_pack::backend_type>::value; + return boost::multiprecision::literals::detail::make_backend_from_pack::backend_type>::value; } template -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::type pt; - return boost::multiprecision::literals::detail::make_backend_from_pack::backend_type>::value; + return boost::multiprecision::literals::detail::make_backend_from_pack::backend_type>::value; } #define BOOST_MP_DEFINE_SIZED_CPP_INT_LITERAL(Bits)\