|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r54969 - trunk/boost/spirit/home/karma/numeric/detail
From: hartmut.kaiser_at_[hidden]
Date: 2009-07-15 10:30:44
Author: hkaiser
Date: 2009-07-15 10:30:44 EDT (Wed, 15 Jul 2009)
New Revision: 54969
URL: http://svn.boost.org/trac/boost/changeset/54969
Log:
Spirit: portability fixes for long long
Text files modified:
trunk/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
Modified: trunk/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp (original)
+++ trunk/boost/spirit/home/karma/numeric/detail/numeric_utils.hpp 2009-07-15 10:30:44 EDT (Wed, 15 Jul 2009)
@@ -444,21 +444,22 @@
return call(sink, n, n, 0);
}
+ private:
// helper function returning the biggest number representable either in
// a boost::long_long_type (if this does exist) or in a plain long
// otherwise
#if defined(BOOST_HAS_LONG_LONG)
- static boost::long_long_type max_long()
- {
- return (std::numeric_limits<boost::long_long_type>::max)();
- }
+ typedef boost::long_long_type biggest_long_type;
#else
- static long max_long()
+ typedef long biggest_long_type;
+#endif
+
+ static biggest_long_type max_long()
{
- return (std::numeric_limits<long>::max)();
+ return (std::numeric_limits<biggest_long_type>::max)();
}
-#endif
+ public:
// Specialization for doubles and floats, falling back to long integers
// for representable values. These specializations speed up formatting
// of floating point numbers considerably as all the required
@@ -469,7 +470,7 @@
{
if (std::fabs(n) < max_long())
{
- boost::long_long_type l(n);
+ biggest_long_type l(n);
return call(sink, l, l, 0);
}
return call(sink, n, n, 0);
@@ -480,7 +481,7 @@
{
if (std::fabs(n) < max_long())
{
- boost::long_long_type l(n);
+ biggest_long_type l(n);
return call(sink, l, l, 0);
}
return call(sink, n, n, 0);
@@ -491,7 +492,7 @@
{
if (std::fabs(n) < max_long())
{
- boost::long_long_type l(n);
+ biggest_long_type l(n);
return call(sink, l, l, 0);
}
return call(sink, n, n, 0);
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