summaryrefslogtreecommitdiff
path: root/boost/spirit/home/x3/support/numeric_utils
diff options
context:
space:
mode:
Diffstat (limited to 'boost/spirit/home/x3/support/numeric_utils')
-rw-r--r--boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp29
-rw-r--r--boost/spirit/home/x3/support/numeric_utils/extract_int.hpp3
-rw-r--r--boost/spirit/home/x3/support/numeric_utils/extract_real.hpp5
-rw-r--r--boost/spirit/home/x3/support/numeric_utils/sign.hpp4
4 files changed, 6 insertions, 35 deletions
diff --git a/boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp b/boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp
index 4ebd66f182..2115903e6c 100644
--- a/boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp
+++ b/boost/spirit/home/x3/support/numeric_utils/detail/extract_int.hpp
@@ -474,35 +474,6 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
};
#undef SPIRIT_NUMERIC_INNER_LOOP
-
- ///////////////////////////////////////////////////////////////////////////
- // Cast an signed integer to an unsigned integer
- ///////////////////////////////////////////////////////////////////////////
- template <typename T,
- bool force_unsigned
- = mpl::and_<is_integral<T>, is_signed<T> >::value>
- struct cast_unsigned;
-
- template <typename T>
- struct cast_unsigned<T, true>
- {
- typedef typename make_unsigned<T>::type unsigned_type;
- typedef typename make_unsigned<T>::type& unsigned_type_ref;
-
- inline static unsigned_type_ref call(T& n)
- {
- return unsigned_type_ref(n);
- }
- };
-
- template <typename T>
- struct cast_unsigned<T, false>
- {
- inline static T& call(T& n)
- {
- return n;
- }
- };
}}}}
#endif
diff --git a/boost/spirit/home/x3/support/numeric_utils/extract_int.hpp b/boost/spirit/home/x3/support/numeric_utils/extract_int.hpp
index 621275f4c8..6e59d42bd1 100644
--- a/boost/spirit/home/x3/support/numeric_utils/extract_int.hpp
+++ b/boost/spirit/home/x3/support/numeric_utils/extract_int.hpp
@@ -62,8 +62,7 @@ namespace boost { namespace spirit { namespace x3
extract_type;
Iterator save = first;
- if (!extract_type::parse(first, last,
- detail::cast_unsigned<T>::call(attr)))
+ if (!extract_type::parse(first, last, attr))
{
first = save;
return false;
diff --git a/boost/spirit/home/x3/support/numeric_utils/extract_real.hpp b/boost/spirit/home/x3/support/numeric_utils/extract_real.hpp
index ea1f0df949..9749fbec1f 100644
--- a/boost/spirit/home/x3/support/numeric_utils/extract_real.hpp
+++ b/boost/spirit/home/x3/support/numeric_utils/extract_real.hpp
@@ -6,8 +6,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_EXTRACT_REAL_APRIL_18_2006_0901AM)
-#define SPIRIT_EXTRACT_REAL_APRIL_18_2006_0901AM
+#if !defined(BOOST_SPIRIT_X3_EXTRACT_REAL_APRIL_18_2006_0901AM)
+#define BOOST_SPIRIT_X3_EXTRACT_REAL_APRIL_18_2006_0901AM
#include <cmath>
#include <boost/limits.hpp>
@@ -180,6 +180,7 @@ namespace boost { namespace spirit { namespace x3
if (!is_same<T, unused_type>::value)
frac_digits =
static_cast<int>(std::distance(savef, first));
+ BOOST_ASSERT(frac_digits >= 0);
}
else if (!got_a_number || !p.allow_trailing_dot)
{
diff --git a/boost/spirit/home/x3/support/numeric_utils/sign.hpp b/boost/spirit/home/x3/support/numeric_utils/sign.hpp
index 2ee4142de6..3ca326f3ec 100644
--- a/boost/spirit/home/x3/support/numeric_utils/sign.hpp
+++ b/boost/spirit/home/x3/support/numeric_utils/sign.hpp
@@ -6,8 +6,8 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#if !defined(SPIRIT_SIGN_MAR_11_2009_0734PM)
-#define SPIRIT_SIGN_MAR_11_2009_0734PM
+#if !defined(BOOST_SPIRIT_X3_SIGN_MAR_11_2009_0734PM)
+#define BOOST_SPIRIT_X3_SIGN_MAR_11_2009_0734PM
#include <boost/config/no_tr1/cmath.hpp>
#include <boost/math/special_functions/fpclassify.hpp>