Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80370 - trunk/boost/lockfree/detail
From: tim_at_[hidden]
Date: 2012-09-03 06:05:32


Author: timblechmann
Date: 2012-09-03 06:05:30 EDT (Mon, 03 Sep 2012)
New Revision: 80370
URL: http://svn.boost.org/trac/boost/changeset/80370

Log:
lockfree: fix msvc warning

patch by hartmut kaiser, taken from ticket #7322

Signed-off-by: Tim Blechmann <tim_at_[hidden]>
Text files modified:
   trunk/boost/lockfree/detail/freelist.hpp | 9 +++++----
   1 files changed, 5 insertions(+), 4 deletions(-)

Modified: trunk/boost/lockfree/detail/freelist.hpp
==============================================================================
--- trunk/boost/lockfree/detail/freelist.hpp (original)
+++ trunk/boost/lockfree/detail/freelist.hpp 2012-09-03 06:05:30 EDT (Mon, 03 Sep 2012)
@@ -381,7 +381,7 @@
 #ifdef BOOST_LOCKFREE_FREELIST_INIT_RUNS_DTOR
             destruct<false>(nodes + i);
 #else
- deallocate<false>(i);
+ deallocate<false>(static_cast<index_t>(i));
 #endif
         }
     }
@@ -391,7 +391,8 @@
 
     template <typename Allocator>
     fixed_size_freelist (Allocator const & alloc, std::size_t count):
- NodeStorage(alloc, count), pool_(tagged_index(count, 0))
+ NodeStorage(alloc, count),
+ pool_(tagged_index(static_cast<index_t>(count), 0))
     {
         initialize();
     }
@@ -461,7 +462,7 @@
 
     index_t null_handle(void) const
     {
- return NodeStorage::node_count();
+ return static_cast<index_t>(NodeStorage::node_count());
     }
 
     index_t get_handle(T * pointer) const
@@ -469,7 +470,7 @@
         if (pointer == NULL)
             return null_handle();
         else
- return pointer - NodeStorage::nodes();
+ return static_cast<index_t>(pointer - NodeStorage::nodes());
     }
 
     index_t get_handle(tagged_node_handle const & handle) const


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