From: Mike Krinkin Date: Thu, 16 Apr 2015 14:22:48 +0000 (+0300) Subject: Cast constant to size_t before left shift X-Git-Tag: v2.1.0~254 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8d84843e8f3999bc0de0801682f8c8e64a772a6e;p=libcds.git Cast constant to size_t before left shift --- diff --git a/cds/intrusive/split_list.h b/cds/intrusive/split_list.h index 4a560c57..7a923dc8 100644 --- a/cds/intrusive/split_list.h +++ b/cds/intrusive/split_list.h @@ -459,8 +459,8 @@ namespace cds { namespace intrusive { void inc_item_count() { - size_t sz = m_nBucketCountLog2.load(memory_model::memory_order_relaxed); - if ( ( ++m_ItemCounter >> sz ) > m_Buckets.load_factor() && ((size_t)(1 << sz )) < m_Buckets.capacity() ) + size_t sz = m_nBucketCountLog2.load(atomics::memory_order_relaxed); + if ( ( ++m_ItemCounter >> sz ) > m_Buckets.load_factor() && (static_cast(1) << sz ) < m_Buckets.capacity() ) { m_nBucketCountLog2.compare_exchange_strong( sz, sz + 1, memory_model::memory_order_relaxed, atomics::memory_order_relaxed ); }