Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73839 - in trunk: boost/unordered/detail libs/unordered/test/unordered
From: dnljms_at_[hidden]
Date: 2011-08-17 03:43:45


Author: danieljames
Date: 2011-08-17 03:43:43 EDT (Wed, 17 Aug 2011)
New Revision: 73839
URL: http://svn.boost.org/trac/boost/changeset/73839

Log:
Unordered: Fix gcc error + warning.
Text files modified:
   trunk/boost/unordered/detail/table.hpp | 10 ++++++++--
   trunk/libs/unordered/test/unordered/compile_tests.hpp | 2 +-
   2 files changed, 9 insertions(+), 3 deletions(-)

Modified: trunk/boost/unordered/detail/table.hpp
==============================================================================
--- trunk/boost/unordered/detail/table.hpp (original)
+++ trunk/boost/unordered/detail/table.hpp 2011-08-17 03:43:43 EDT (Wed, 17 Aug 2011)
@@ -129,7 +129,9 @@
     
             // size < mlf_ * count
             return double_to_size_t(ceil(
- (double) this->mlf_ * this->max_bucket_count())) - 1;
+ static_cast<double>(this->mlf_) *
+ static_cast<double>(this->max_bucket_count())
+ )) - 1;
         }
 
         std::size_t calculate_max_load()
@@ -138,7 +140,11 @@
     
             // From 6.3.1/13:
             // Only resize when size >= mlf_ * count
- return double_to_size_t(ceil((double) mlf_ * this->bucket_count_));
+ return double_to_size_t(ceil(
+ static_cast<double>(this->mlf_) *
+ static_cast<double>(this->bucket_count_)
+ )) - 1;
+
         }
 
         void max_load_factor(float z)

Modified: trunk/libs/unordered/test/unordered/compile_tests.hpp
==============================================================================
--- trunk/libs/unordered/test/unordered/compile_tests.hpp (original)
+++ trunk/libs/unordered/test/unordered/compile_tests.hpp 2011-08-17 03:43:43 EDT (Wed, 17 Aug 2011)
@@ -455,7 +455,7 @@
     typedef BOOST_DEDUCED_TYPENAME X::const_iterator const_iterator;
 
 #if !defined(BOOST_NO_RVALUE_REFERENCES)
- X x1(rvalue_default<X>();
+ X x1(rvalue_default<X>());
     X x2(boost::move(x1));
     x1 = rvalue_default<X>();
     x2 = boost::move(x1);


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