Boost logo

Boost-Commit :

From: igaztanaga_at_[hidden]
Date: 2007-11-19 13:32:13


Author: igaztanaga
Date: 2007-11-19 13:32:12 EST (Mon, 19 Nov 2007)
New Revision: 41240
URL: http://svn.boost.org/trac/boost/changeset/41240

Log:
Fixed 64 bit std::size_t specialization error
Text files modified:
   trunk/boost/intrusive/detail/utilities.hpp | 11 ++++++-----
   1 files changed, 6 insertions(+), 5 deletions(-)

Modified: trunk/boost/intrusive/detail/utilities.hpp
==============================================================================
--- trunk/boost/intrusive/detail/utilities.hpp (original)
+++ trunk/boost/intrusive/detail/utilities.hpp 2007-11-19 13:32:12 EST (Mon, 19 Nov 2007)
@@ -24,6 +24,7 @@
 #include <cstddef>
 #include <climits>
 #include <iterator>
+#include <boost/cstdint.hpp>
 
 namespace boost {
 namespace intrusive {
@@ -520,16 +521,16 @@
 template<>
 struct sqrt2_pow_max<32>
 {
- static const std::size_t value = 0xb504f334;
+ static const boost::uint32_t value = 0xb504f334;
    static const std::size_t pow = 31;
 };
 
-#ifndef BOOST_NO_INT64_T
+#ifdef BOOST_HAS_LONG_LONG
 
 template<>
 struct sqrt2_pow_max<64>
 {
- static const std::size_t value = 0xb504f333f9de6484;
+ static const boost::uint64_t value = 0xb504f333f9de6484ull;
    static const std::size_t pow = 63;
 };
 
@@ -539,8 +540,8 @@
 // Defined for X from 0 up to the number of bits in size_t minus 1.
 inline std::size_t sqrt2_pow_2xplus1 (std::size_t x)
 {
- const std::size_t value = sqrt2_pow_max<sizeof(std::size_t)*CHAR_BIT>::value;
- const std::size_t pow = sqrt2_pow_max<sizeof(std::size_t)*CHAR_BIT>::pow;
+ const std::size_t value = (std::size_t)sqrt2_pow_max<sizeof(std::size_t)*CHAR_BIT>::value;
+ const std::size_t pow = (std::size_t)sqrt2_pow_max<sizeof(std::size_t)*CHAR_BIT>::pow;
    return (value >> (pow - x)) + 1;
 }
 


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