From 6924946ceeaae28bc227fe7c9d8e939963bb9d69 Mon Sep 17 00:00:00 2001 From: khizmax Date: Tue, 12 Sep 2017 21:11:45 +0300 Subject: [PATCH] Fixed -Wshadow warnings --- cds/container/impl/bronson_avltree_map_rcu.h | 14 +- cds/container/impl/lazy_list.h | 2 +- cds/container/impl/skip_list_set.h | 2 +- cds/container/lazy_list_rcu.h | 4 +- cds/container/michael_map.h | 8 +- cds/container/michael_map_nogc.h | 8 +- cds/container/michael_map_rcu.h | 8 +- cds/container/michael_set.h | 8 +- cds/container/michael_set_nogc.h | 8 +- cds/container/michael_set_rcu.h | 8 +- cds/container/skip_list_set_rcu.h | 2 +- cds/container/split_list_set.h | 4 +- cds/container/split_list_set_rcu.h | 4 +- cds/intrusive/free_list_cached.h | 6 +- cds/intrusive/impl/ellen_bintree.h | 8 +- cds/intrusive/lazy_list_nogc.h | 20 +-- cds/intrusive/michael_set.h | 8 +- cds/intrusive/michael_set_nogc.h | 8 +- cds/intrusive/michael_set_rcu.h | 8 +- cds/intrusive/msqueue.h | 2 +- cds/intrusive/split_list.h | 2 +- cds/intrusive/split_list_nogc.h | 2 +- cds/intrusive/split_list_rcu.h | 2 +- test/include/cds_test/thread.h | 4 +- test/stress/framework/city.cpp | 10 +- .../intrusive-list/test_intrusive_list_nogc.h | 8 +- .../test_intrusive_michael_lazy_rcu.h | 16 +-- .../test_intrusive_michael_michael_rcu.h | 16 +-- .../test_intrusive_skiplist_rcu.h | 60 ++++---- .../test_intrusive_split_lazy_rcu.h | 16 +-- .../test_intrusive_split_michael_rcu.h | 16 +-- test/unit/misc/cxx11_atomic_class.cpp | 8 +- test/unit/misc/cxx11_atomic_func.cpp | 8 +- test/unit/pqueue/intrusive_mspqueue.cpp | 4 +- test/unit/striped-set/test_striped_set.h | 4 +- test/unit/tree/test_bronson_avltree_map.h | 132 +++++++++--------- 36 files changed, 224 insertions(+), 224 deletions(-) diff --git a/cds/container/impl/bronson_avltree_map_rcu.h b/cds/container/impl/bronson_avltree_map_rcu.h index f21253b5..a855ff24 100644 --- a/cds/container/impl/bronson_avltree_map_rcu.h +++ b/cds/container/impl/bronson_avltree_map_rcu.h @@ -381,9 +381,9 @@ namespace cds { namespace container { return do_remove( key, key_comparator(), - [&f]( key_type const& key, mapped_type pVal, rcu_disposer& disp ) -> bool { + [&f]( key_type const& k, mapped_type pVal, rcu_disposer& disp ) -> bool { assert( pVal ); - f( key, *pVal ); + f( k, *pVal ); disp.dispose_value(pVal); return true; } @@ -404,9 +404,9 @@ namespace cds { namespace container { return do_remove( key, cds::opt::details::make_comparator_from_less(), - [&f]( key_type const& key, mapped_type pVal, rcu_disposer& disp ) -> bool { + [&f]( key_type const& k, mapped_type pVal, rcu_disposer& disp ) -> bool { assert( pVal ); - f( key, *pVal ); + f( k, *pVal ); disp.dispose_value(pVal); return true; } @@ -1410,10 +1410,10 @@ namespace cds { namespace container { { node_type * pNew; - auto fnCreateNode = [&funcUpdate]( node_type * pNew ) { - mapped_type pVal = funcUpdate( pNew ); + auto fnCreateNode = [&funcUpdate]( node_type * pNode ) { + mapped_type pVal = funcUpdate( pNode ); assert( pVal != nullptr ); - pNew->m_pValue.store( pVal, memory_model::memory_order_release ); + pNode->m_pValue.store( pVal, memory_model::memory_order_release ); }; static_if ( c_bRelaxedInsert ) { diff --git a/cds/container/impl/lazy_list.h b/cds/container/impl/lazy_list.h index 7d91b0ee..96c37b81 100644 --- a/cds/container/impl/lazy_list.h +++ b/cds/container/impl/lazy_list.h @@ -851,7 +851,7 @@ namespace cds { namespace container { template bool find_at( head_type& refHead, Q& val, Compare cmp, Func f ) { - return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ f( node_to_value(node), val ); }); + return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& v){ f( node_to_value(node), v ); }); } template diff --git a/cds/container/impl/skip_list_set.h b/cds/container/impl/skip_list_set.h index ab075e97..7901f7d0 100644 --- a/cds/container/impl/skip_list_set.h +++ b/cds/container/impl/skip_list_set.h @@ -313,7 +313,7 @@ namespace cds { namespace container { bool insert( Q const& val, Func f ) { scoped_node_ptr sp( node_allocator().New( random_level(), val )); - if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { f( val.m_Value ); } )) { + if ( base_class::insert( *sp.get(), [&f]( node_type& v ) { f( v.m_Value ); } )) { sp.release(); return true; } diff --git a/cds/container/lazy_list_rcu.h b/cds/container/lazy_list_rcu.h index 738e5042..60c724e0 100644 --- a/cds/container/lazy_list_rcu.h +++ b/cds/container/lazy_list_rcu.h @@ -821,13 +821,13 @@ namespace cds { namespace container { template bool find_at( head_type& refHead, Q const& key, Compare cmp ) const { - return base_class::find_at( &refHead, key, cmp, [](node_type&, Q const &) {} ); + return base_class::find_at( &refHead, key, cmp, [](node_type&, Q const&) {} ); } template bool find_at( head_type& refHead, Q& val, Compare cmp, Func f ) const { - return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& val){ f( node_to_value(node), val ); }); + return base_class::find_at( &refHead, val, cmp, [&f](node_type& node, Q& v){ f( node_to_value(node), v ); }); } template diff --git a/cds/container/michael_map.h b/cds/container/michael_map.h index 912ae81d..9947409d 100644 --- a/cds/container/michael_map.h +++ b/cds/container/michael_map.h @@ -990,15 +990,15 @@ namespace cds { namespace container { } template - typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* b ) { - new (bucket) internal_bucket_type; + new (b) internal_bucket_type; } template - typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* b ) { - new (bucket) internal_bucket_type( m_Stat ); + new (b) internal_bucket_type( m_Stat ); } //@endcond }; diff --git a/cds/container/michael_map_nogc.h b/cds/container/michael_map_nogc.h index 04299da9..610eef33 100644 --- a/cds/container/michael_map_nogc.h +++ b/cds/container/michael_map_nogc.h @@ -590,15 +590,15 @@ namespace cds { namespace container { } template - typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* b ) { - new (bucket) internal_bucket_type; + new (b) internal_bucket_type; } template - typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* b ) { - new (bucket) internal_bucket_type( m_Stat ); + new (b) internal_bucket_type( m_Stat ); } //@endcond }; diff --git a/cds/container/michael_map_rcu.h b/cds/container/michael_map_rcu.h index 93198b8d..ef442547 100644 --- a/cds/container/michael_map_rcu.h +++ b/cds/container/michael_map_rcu.h @@ -855,15 +855,15 @@ namespace cds { namespace container { } template - typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bkt ) { - new (bucket) internal_bucket_type; + new (bkt) internal_bucket_type; } template - typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bkt ) { - new (bucket) internal_bucket_type( m_Stat ); + new (bkt) internal_bucket_type( m_Stat ); } //@endcond }; diff --git a/cds/container/michael_set.h b/cds/container/michael_set.h index 32fddca4..85ffc537 100644 --- a/cds/container/michael_set.h +++ b/cds/container/michael_set.h @@ -943,15 +943,15 @@ namespace cds { namespace container { } template - typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* b ) { - new (bucket) internal_bucket_type; + new (b) internal_bucket_type; } template - typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* b ) { - new (bucket) internal_bucket_type( m_Stat ); + new (b) internal_bucket_type( m_Stat ); } template diff --git a/cds/container/michael_set_nogc.h b/cds/container/michael_set_nogc.h index efb6901b..5874dd20 100644 --- a/cds/container/michael_set_nogc.h +++ b/cds/container/michael_set_nogc.h @@ -430,15 +430,15 @@ namespace cds { namespace container { private: //@cond template - typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* b ) { - new (bucket) internal_bucket_type; + new (b) internal_bucket_type; } template - typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* b ) { - new (bucket) internal_bucket_type( m_Stat ); + new (b) internal_bucket_type( m_Stat ); } const_iterator get_const_begin() const diff --git a/cds/container/michael_set_rcu.h b/cds/container/michael_set_rcu.h index 34bc0c2b..54cf0686 100644 --- a/cds/container/michael_set_rcu.h +++ b/cds/container/michael_set_rcu.h @@ -797,15 +797,15 @@ namespace cds { namespace container { } template - typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type* bkt ) { - new (bucket) internal_bucket_type; + new (bkt) internal_bucket_type; } template - typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bucket ) + typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type* bkt ) { - new (bucket) internal_bucket_type( m_Stat ); + new (bkt) internal_bucket_type( m_Stat ); } const_iterator get_const_begin() const diff --git a/cds/container/skip_list_set_rcu.h b/cds/container/skip_list_set_rcu.h index daf05f2b..b34ccba1 100644 --- a/cds/container/skip_list_set_rcu.h +++ b/cds/container/skip_list_set_rcu.h @@ -358,7 +358,7 @@ namespace cds { namespace container { bool insert( Q const& val, Func f ) { scoped_node_ptr sp( node_allocator().New( random_level(), val )); - if ( base_class::insert( *sp.get(), [&f]( node_type& val ) { f( val.m_Value ); } )) { + if ( base_class::insert( *sp.get(), [&f]( node_type& v ) { f( v.m_Value ); } )) { sp.release(); return true; } diff --git a/cds/container/split_list_set.h b/cds/container/split_list_set.h index b4af551d..47d48865 100644 --- a/cds/container/split_list_set.h +++ b/cds/container/split_list_set.h @@ -936,7 +936,7 @@ namespace cds { namespace container { template bool find_( Q& val, Func f ) { - return base_class::find( val, [&f]( node_type& item, Q& val ) { f( item.m_Value, val ); } ); + return base_class::find( val, [&f]( node_type& item, Q& v ) { f( item.m_Value, v ); } ); } template @@ -951,7 +951,7 @@ namespace cds { namespace container { { CDS_UNUSED( pred ); return base_class::find_with( val, typename maker::template predicate_wrapper::type(), - [&f]( node_type& item, Q& val ) { f( item.m_Value, val ); } ); + [&f]( node_type& item, Q& v ) { f( item.m_Value, v ); } ); } template diff --git a/cds/container/split_list_set_rcu.h b/cds/container/split_list_set_rcu.h index 36f45517..c72295a1 100644 --- a/cds/container/split_list_set_rcu.h +++ b/cds/container/split_list_set_rcu.h @@ -315,7 +315,7 @@ namespace cds { namespace container { template bool find_( Q& val, Func f ) { - return base_class::find( val, [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } ); + return base_class::find( val, [&f]( node_type& item, Q& v ) { f(item.m_Value, v) ; } ); } template @@ -323,7 +323,7 @@ namespace cds { namespace container { { CDS_UNUSED( pred ); return base_class::find_with( val, typename maker::template predicate_wrapper::type(), - [&f]( node_type& item, Q& val ) { f(item.m_Value, val) ; } ); + [&f]( node_type& item, Q& v ) { f(item.m_Value, v) ; } ); } template diff --git a/cds/intrusive/free_list_cached.h b/cds/intrusive/free_list_cached.h index 9c9adea2..3fd3b090 100644 --- a/cds/intrusive/free_list_cached.h +++ b/cds/intrusive/free_list_cached.h @@ -121,9 +121,9 @@ namespace cds { namespace intrusive { return p; // iterate the cache - for ( auto& cell : m_cache ) { - p = cell.load( atomics::memory_order_relaxed ); - if ( p && cell.compare_exchange_weak( p, nullptr, atomics::memory_order_acquire, atomics::memory_order_relaxed )) + for ( auto& item : m_cache ) { + p = item.load( atomics::memory_order_relaxed ); + if ( p && item.compare_exchange_weak( p, nullptr, atomics::memory_order_acquire, atomics::memory_order_relaxed )) return p; } diff --git a/cds/intrusive/impl/ellen_bintree.h b/cds/intrusive/impl/ellen_bintree.h index 974854b4..3ab0923b 100644 --- a/cds/intrusive/impl/ellen_bintree.h +++ b/cds/intrusive/impl/ellen_bintree.h @@ -918,18 +918,18 @@ namespace cds { namespace intrusive { retry: tree_node * p = bRight ? res.guards.protect( search_result::Guard_Leaf, pParent->m_pRight, - []( tree_node * p ) -> internal_node* { return static_cast(p);}) + []( tree_node * pn ) -> internal_node* { return static_cast(pn);}) : res.guards.protect( search_result::Guard_Leaf, pParent->m_pLeft, - []( tree_node * p ) -> internal_node* { return static_cast(p);}); + []( tree_node * pn ) -> internal_node* { return static_cast(pn);}); // If we use member hook, data node pointer != internal node pointer // So, we need protect the child twice: as internal node and as data node // and then analyze what kind of node we have tree_node * pVal = bRight ? res.guards.protect( search_result::Guard_temporary, pParent->m_pRight, - []( tree_node * p ) -> value_type* { return node_traits::to_value_ptr( static_cast(p));} ) + []( tree_node * pn ) -> value_type* { return node_traits::to_value_ptr( static_cast(pn));} ) : res.guards.protect( search_result::Guard_temporary, pParent->m_pLeft, - []( tree_node * p ) -> value_type* { return node_traits::to_value_ptr( static_cast(p));} ); + []( tree_node * pn ) -> value_type* { return node_traits::to_value_ptr( static_cast(pn));} ); // child node is guarded // See whether pParent->m_pUpdate has not been changed diff --git a/cds/intrusive/lazy_list_nogc.h b/cds/intrusive/lazy_list_nogc.h index 01fc656e..2c9761f5 100644 --- a/cds/intrusive/lazy_list_nogc.h +++ b/cds/intrusive/lazy_list_nogc.h @@ -480,10 +480,10 @@ namespace cds { namespace intrusive { \p Equal functor has the interface like \p std::equal_to. */ template - typename std::enable_if::type find_with( Q& key, Equal equal, Func f ) + typename std::enable_if::type find_with( Q& key, Equal eq, Func f ) { - CDS_UNUSED( equal ); - return find_at( &m_Head, key, equal, f ); + //CDS_UNUSED( eq ); + return find_at( &m_Head, key, eq, f ); } //@cond template @@ -494,10 +494,10 @@ namespace cds { namespace intrusive { } template - typename std::enable_if::type find_with( Q const& key, Equal equal, Func f ) + typename std::enable_if::type find_with( Q const& key, Equal eq, Func f ) { - CDS_UNUSED( equal ); - return find_at( &m_Head, key, equal, f ); + //CDS_UNUSED( eq ); + return find_at( &m_Head, key, eq, f ); } //@endcond @@ -547,16 +547,16 @@ namespace cds { namespace intrusive { \p Equal functor has the interface like \p std::equal_to. */ template - typename std::enable_if::type contains( Q const& key, Equal equal ) + typename std::enable_if::type contains( Q const& key, Equal eq ) { - return find_at( &m_Head, key, equal ); + return find_at( &m_Head, key, eq ); } //@cond template CDS_DEPRECATED("deprecated, use contains()") - typename std::enable_if::type find_with( Q const& key, Equal equal ) + typename std::enable_if::type find_with( Q const& key, Equal eq ) { - return contains( key, equal ); + return contains( key, eq ); } //@endcond diff --git a/cds/intrusive/michael_set.h b/cds/intrusive/michael_set.h index fe2c2f95..79b2b8cb 100644 --- a/cds/intrusive/michael_set.h +++ b/cds/intrusive/michael_set.h @@ -982,15 +982,15 @@ namespace cds { namespace intrusive { } template - typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * bucket ) + typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * b ) { - new (bucket) internal_bucket_type; + new (b) internal_bucket_type; } template - typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * bucket ) + typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * b ) { - new (bucket) internal_bucket_type( m_Stat ); + new (b) internal_bucket_type( m_Stat ); } /// Calculates hash value of \p key diff --git a/cds/intrusive/michael_set_nogc.h b/cds/intrusive/michael_set_nogc.h index 883e8526..dfe01d1e 100644 --- a/cds/intrusive/michael_set_nogc.h +++ b/cds/intrusive/michael_set_nogc.h @@ -455,15 +455,15 @@ namespace cds { namespace intrusive { private: //@cond template - typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * bucket ) + typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * b ) { - new (bucket) internal_bucket_type; + new (b) internal_bucket_type; } template - typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * bucket ) + typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * b ) { - new (bucket) internal_bucket_type( m_Stat ); + new (b) internal_bucket_type( m_Stat ); } //@endcond }; diff --git a/cds/intrusive/michael_set_rcu.h b/cds/intrusive/michael_set_rcu.h index 43a26138..2a0d9bd4 100644 --- a/cds/intrusive/michael_set_rcu.h +++ b/cds/intrusive/michael_set_rcu.h @@ -735,15 +735,15 @@ namespace cds { namespace intrusive { private: //@cond template - typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * bucket ) + typename std::enable_if< Stat::empty >::type construct_bucket( internal_bucket_type * bkt ) { - new (bucket) internal_bucket_type; + new (bkt) internal_bucket_type; } template - typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * bucket ) + typename std::enable_if< !Stat::empty >::type construct_bucket( internal_bucket_type * bkt ) { - new (bucket) internal_bucket_type( m_Stat ); + new (bkt) internal_bucket_type( m_Stat ); } /// Calculates hash value of \p key diff --git a/cds/intrusive/msqueue.h b/cds/intrusive/msqueue.h index 98d8a64e..03133905 100644 --- a/cds/intrusive/msqueue.h +++ b/cds/intrusive/msqueue.h @@ -584,7 +584,7 @@ namespace cds { namespace intrusive { bool empty() const { typename gc::Guard guard; - node_type * p = guard.protect( m_pHead, []( node_type * p ) -> value_type * { return node_traits::to_value_ptr( p );}); + node_type * p = guard.protect( m_pHead, []( node_type * pNode ) -> value_type * { return node_traits::to_value_ptr( pNode );}); return p->m_pNext.load( memory_model::memory_order_relaxed ) == nullptr; } diff --git a/cds/intrusive/split_list.h b/cds/intrusive/split_list.h index 691a089d..7ef5bfde 100644 --- a/cds/intrusive/split_list.h +++ b/cds/intrusive/split_list.h @@ -1325,7 +1325,7 @@ namespace cds { namespace intrusive { return m_Stat.onFind( m_List.find_at( pHead, sv, cmp, - [&f]( value_type& item, split_list::details::search_value_type& val ) { f( item, val.val ); } ) + [&f]( value_type& item, split_list::details::search_value_type& v ) { f( item, v.val ); } ) ); } diff --git a/cds/intrusive/split_list_nogc.h b/cds/intrusive/split_list_nogc.h index 68c0d250..966f5da3 100644 --- a/cds/intrusive/split_list_nogc.h +++ b/cds/intrusive/split_list_nogc.h @@ -582,7 +582,7 @@ namespace cds { namespace intrusive { aux_node_type * pHead = get_bucket( nHash ); assert( pHead != nullptr ); return m_Stat.onFind( m_List.find_at( pHead, sv, cmp, - [&f](value_type& item, split_list::details::search_value_type& val){ f(item, val.val ); })); + [&f](value_type& item, split_list::details::search_value_type& v){ f(item, v.val ); })); } aux_node_type * alloc_aux_node( size_t nHash ) diff --git a/cds/intrusive/split_list_rcu.h b/cds/intrusive/split_list_rcu.h index 64583fe4..48c49a28 100644 --- a/cds/intrusive/split_list_rcu.h +++ b/cds/intrusive/split_list_rcu.h @@ -1019,7 +1019,7 @@ namespace cds { namespace intrusive { assert( pHead != nullptr ); return m_Stat.onFind( m_List.find_at( pHead, sv, cmp, - [&f](value_type& item, split_list::details::search_value_type& val){ f(item, val.val ); })); + [&f](value_type& item, split_list::details::search_value_type& v){ f(item, v.val ); })); } template diff --git a/test/include/cds_test/thread.h b/test/include/cds_test/thread.h index 44baffdb..51fc399a 100644 --- a/test/include/cds_test/thread.h +++ b/test/include/cds_test/thread.h @@ -156,8 +156,8 @@ namespace cds_test { }; public: - explicit thread_pool( ::testing::Test& fixture ) - : m_fixture( fixture ) + explicit thread_pool( ::testing::Test& fx ) + : m_fixture( fx ) , m_bTimeElapsed( false ) {} diff --git a/test/stress/framework/city.cpp b/test/stress/framework/city.cpp index 1d995578..321cea1b 100644 --- a/test/stress/framework/city.cpp +++ b/test/stress/framework/city.cpp @@ -200,11 +200,11 @@ uint32 CityHash32(const char *s, size_t len) { f = f * 5 + 0xe6546b64; size_t iters = (len - 1) / 20; do { - uint32 a0 = Rotate32(Fetch32(s) * c1, 17) * c2; - uint32 a1 = Fetch32(s + 4); - uint32 a2 = Rotate32(Fetch32(s + 8) * c1, 17) * c2; - uint32 a3 = Rotate32(Fetch32(s + 12) * c1, 17) * c2; - uint32 a4 = Fetch32(s + 16); + a0 = Rotate32(Fetch32(s) * c1, 17) * c2; + a1 = Fetch32(s + 4); + a2 = Rotate32(Fetch32(s + 8) * c1, 17) * c2; + a3 = Rotate32(Fetch32(s + 12) * c1, 17) * c2; + a4 = Fetch32(s + 16); h ^= a0; h = Rotate32(h, 18); h = h * 5 + 0xe6546b64; diff --git a/test/unit/intrusive-list/test_intrusive_list_nogc.h b/test/unit/intrusive-list/test_intrusive_list_nogc.h index 08274cc6..c023d000 100644 --- a/test/unit/intrusive-list/test_intrusive_list_nogc.h +++ b/test/unit/intrusive-list/test_intrusive_list_nogc.h @@ -329,11 +329,11 @@ namespace cds_test { EXPECT_FALSE( ret.second ); EXPECT_EQ( i.s.nUpdateExistsCall, 1 ); - ret = l.update( i, []( bool bNew, value_type& i, value_type& arg ) { + ret = l.update( i, []( bool bNew, value_type& vi, value_type& arg ) { EXPECT_FALSE( bNew ); - EXPECT_EQ( i.s.nUpdateExistsCall, 1 ); - EXPECT_TRUE( &i == &arg ); - ++i.s.nUpdateExistsCall; + EXPECT_EQ( vi.s.nUpdateExistsCall, 1 ); + EXPECT_TRUE( &vi == &arg ); + ++vi.s.nUpdateExistsCall; }); EXPECT_TRUE( ret.first ); EXPECT_FALSE( ret.second ); diff --git a/test/unit/intrusive-set/test_intrusive_michael_lazy_rcu.h b/test/unit/intrusive-set/test_intrusive_michael_lazy_rcu.h index d8312680..5c036504 100644 --- a/test/unit/intrusive-set/test_intrusive_michael_lazy_rcu.h +++ b/test/unit/intrusive-set/test_intrusive_michael_lazy_rcu.h @@ -68,14 +68,14 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, base_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; typedef typename TestFixture::hash_int hash_int; typedef ci::LazyList< rcu_type , base_item_type , typename ci::lazy_list::make_traits< ci::opt::hook< ci::lazy_list::base_hook< ci::opt::gc< rcu_type > > > - , ci::opt::compare< cmp > + , ci::opt::compare< item_cmp > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -95,14 +95,14 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, base_less ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template less less; + typedef typename TestFixture::template less item_less; typedef typename TestFixture::hash_int hash_int; typedef ci::LazyList< rcu_type , base_item_type , typename ci::lazy_list::make_traits< ci::opt::hook< ci::lazy_list::base_hook< ci::opt::gc< rcu_type >>> - , ci::opt::less< less > + , ci::opt::less< item_less > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -232,7 +232,7 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, member_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; typedef typename TestFixture::hash_int hash_int; typedef ci::LazyList< rcu_type @@ -242,7 +242,7 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, member_cmp ) offsetof( member_item_type, hMember ), ci::opt::gc >> - , ci::opt::compare< cmp > + , ci::opt::compare< item_cmp > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -262,7 +262,7 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, member_less ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template less less; + typedef typename TestFixture::template less item_less; typedef typename TestFixture::hash_int hash_int; typedef ci::LazyList< rcu_type @@ -272,7 +272,7 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, member_less ) offsetof( member_item_type, hMember ), ci::opt::gc > > - , ci::opt::less< less > + , ci::opt::less< item_less > , ci::opt::disposer< mock_disposer > >::type > bucket_type; diff --git a/test/unit/intrusive-set/test_intrusive_michael_michael_rcu.h b/test/unit/intrusive-set/test_intrusive_michael_michael_rcu.h index 1c387317..5d9e3ee7 100644 --- a/test/unit/intrusive-set/test_intrusive_michael_michael_rcu.h +++ b/test/unit/intrusive-set/test_intrusive_michael_michael_rcu.h @@ -66,14 +66,14 @@ TYPED_TEST_P( IntrusiveMichaelSet, base_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; typedef typename TestFixture::hash_int hash_int; typedef ci::MichaelList< rcu_type , base_item_type , typename ci::michael_list::make_traits< ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type > > > - , ci::opt::compare< cmp > + , ci::opt::compare< item_cmp > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -93,14 +93,14 @@ TYPED_TEST_P( IntrusiveMichaelSet, base_less ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template less less; + typedef typename TestFixture::template less item_less; typedef typename TestFixture::hash_int hash_int; typedef ci::MichaelList< rcu_type , base_item_type , typename ci::michael_list::make_traits< ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type >>> - , ci::opt::less< less > + , ci::opt::less< item_less > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -205,7 +205,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; typedef typename TestFixture::hash_int hash_int; typedef ci::MichaelList< rcu_type @@ -215,7 +215,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_cmp ) offsetof( member_item_type, hMember ), ci::opt::gc >> - , ci::opt::compare< cmp > + , ci::opt::compare< item_cmp > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -235,7 +235,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_less ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template less less; + typedef typename TestFixture::template less item_less; typedef typename TestFixture::hash_int hash_int; typedef ci::MichaelList< rcu_type @@ -245,7 +245,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_less ) offsetof( member_item_type, hMember ), ci::opt::gc > > - , ci::opt::less< less > + , ci::opt::less< item_less > , ci::opt::disposer< mock_disposer > >::type > bucket_type; diff --git a/test/unit/intrusive-set/test_intrusive_skiplist_rcu.h b/test/unit/intrusive-set/test_intrusive_skiplist_rcu.h index ee62fc27..63347a8b 100644 --- a/test/unit/intrusive-set/test_intrusive_skiplist_rcu.h +++ b/test/unit/intrusive-set/test_intrusive_skiplist_rcu.h @@ -65,13 +65,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, base_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits : public ci::skip_list::traits { typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; }; typedef ci::SkipListSet< rcu_type, base_item_type, traits > set_type; @@ -106,14 +106,14 @@ TYPED_TEST_P( IntrusiveSkipListSet, base_cmpmix ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; typedef typename TestFixture::template less less_predicate; struct traits : public ci::skip_list::traits { typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef less_predicate less; typedef ci::skip_list::stat<> stat; }; @@ -129,13 +129,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, base_xorshift32 ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits : public ci::skip_list::traits { typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef ci::skip_list::xorshift32 random_level_generator; }; @@ -150,13 +150,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, base_xorshift24 ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits: public ci::skip_list::traits { typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef ci::skip_list::xorshift24 random_level_generator; }; @@ -171,13 +171,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, base_xorshift16 ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits: public ci::skip_list::traits { typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef ci::skip_list::xorshift16 random_level_generator; }; @@ -192,13 +192,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, base_turbo32 ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits: public ci::skip_list::traits { typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef ci::skip_list::turbo32 random_level_generator; }; @@ -234,13 +234,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, base_turbo16 ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits: public ci::skip_list::traits { typedef ci::skip_list::base_hook< ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef ci::skip_list::turbo16 random_level_generator; }; @@ -256,13 +256,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, member_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits : public ci::skip_list::traits { typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; }; typedef ci::SkipListSet< rcu_type, member_item_type, traits > set_type; @@ -300,13 +300,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, member_cmpmix ) typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; typedef typename TestFixture::template less less_predicate; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits : public ci::skip_list::traits { typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef less_predicate less; typedef ci::skip_list::stat<> stat; }; @@ -323,13 +323,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, member_xorshift32 ) typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; typedef typename TestFixture::template less less_predicate; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits : public ci::skip_list::traits { typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef less_predicate less; typedef ci::skip_list::stat<> stat; typedef ci::skip_list::xorshift32 random_level_generator; @@ -347,13 +347,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, member_xorshift24 ) typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; typedef typename TestFixture::template less less_predicate; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits: public ci::skip_list::traits { typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef less_predicate less; typedef ci::skip_list::stat<> stat; typedef ci::skip_list::xorshift24 random_level_generator; @@ -371,13 +371,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, member_xorshift16 ) typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; typedef typename TestFixture::template less less_predicate; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits: public ci::skip_list::traits { typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef less_predicate less; typedef ci::skip_list::stat<> stat; typedef ci::skip_list::xorshift16 random_level_generator; @@ -395,13 +395,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, member_turbo32 ) typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; typedef typename TestFixture::template less less_predicate; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits: public ci::skip_list::traits { typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef less_predicate less; typedef ci::skip_list::stat<> stat; typedef ci::skip_list::turbo32 random_level_generator; @@ -419,13 +419,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, member_turbo24 ) typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; typedef typename TestFixture::template less less_predicate; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits: public ci::skip_list::traits { typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef less_predicate less; typedef ci::skip_list::stat<> stat; typedef ci::skip_list::turbo24 random_level_generator; @@ -443,13 +443,13 @@ TYPED_TEST_P( IntrusiveSkipListSet, member_turbo16 ) typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; typedef typename TestFixture::template less less_predicate; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; struct traits: public ci::skip_list::traits { typedef ci::skip_list::member_hook< offsetof( member_item_type, hMember ), ci::opt::gc< rcu_type >> hook; typedef mock_disposer disposer; - typedef cmp compare; + typedef item_cmp compare; typedef less_predicate less; typedef ci::skip_list::stat<> stat; typedef ci::skip_list::turbo16 random_level_generator; diff --git a/test/unit/intrusive-set/test_intrusive_split_lazy_rcu.h b/test/unit/intrusive-set/test_intrusive_split_lazy_rcu.h index 7d7176aa..73e54162 100644 --- a/test/unit/intrusive-set/test_intrusive_split_lazy_rcu.h +++ b/test/unit/intrusive-set/test_intrusive_split_lazy_rcu.h @@ -69,14 +69,14 @@ TYPED_TEST_P( IntrusiveSplitLazySet, base_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; typedef typename TestFixture::hash_int hash_int; typedef ci::LazyList< rcu_type , base_item_type , typename ci::lazy_list::make_traits< ci::opt::hook< ci::lazy_list::base_hook< ci::opt::gc< rcu_type > > > - , ci::opt::compare< cmp > + , ci::opt::compare< item_cmp > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -96,14 +96,14 @@ TYPED_TEST_P( IntrusiveSplitLazySet, base_less ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template less less; + typedef typename TestFixture::template less item_less; typedef typename TestFixture::hash_int hash_int; typedef ci::LazyList< rcu_type , base_item_type , typename ci::lazy_list::make_traits< ci::opt::hook< ci::lazy_list::base_hook< ci::opt::gc< rcu_type >>> - , ci::opt::less< less > + , ci::opt::less< item_less > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -270,7 +270,7 @@ TYPED_TEST_P( IntrusiveSplitLazySet, member_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; typedef typename TestFixture::hash_int hash_int; typedef ci::LazyList< rcu_type @@ -280,7 +280,7 @@ TYPED_TEST_P( IntrusiveSplitLazySet, member_cmp ) offsetof( member_item_type, hMember ), ci::opt::gc >> - , ci::opt::compare< cmp > + , ci::opt::compare< item_cmp > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -300,7 +300,7 @@ TYPED_TEST_P( IntrusiveSplitLazySet, member_less ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template less less; + typedef typename TestFixture::template less item_less; typedef typename TestFixture::hash_int hash_int; typedef ci::LazyList< rcu_type @@ -310,7 +310,7 @@ TYPED_TEST_P( IntrusiveSplitLazySet, member_less ) offsetof( member_item_type, hMember ), ci::opt::gc > > - , ci::opt::less< less > + , ci::opt::less< item_less > , ci::opt::disposer< mock_disposer > >::type > bucket_type; diff --git a/test/unit/intrusive-set/test_intrusive_split_michael_rcu.h b/test/unit/intrusive-set/test_intrusive_split_michael_rcu.h index cb7b4826..5f1cf5b5 100644 --- a/test/unit/intrusive-set/test_intrusive_split_michael_rcu.h +++ b/test/unit/intrusive-set/test_intrusive_split_michael_rcu.h @@ -67,14 +67,14 @@ TYPED_TEST_P( IntrusiveSplitMichaelSet, base_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; typedef typename TestFixture::hash_int hash_int; typedef ci::MichaelList< rcu_type , base_item_type , typename ci::michael_list::make_traits< ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type > > > - , ci::opt::compare< cmp > + , ci::opt::compare< item_cmp > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -94,14 +94,14 @@ TYPED_TEST_P( IntrusiveSplitMichaelSet, base_less ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::base_item_type base_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template less less; + typedef typename TestFixture::template less item_less; typedef typename TestFixture::hash_int hash_int; typedef ci::MichaelList< rcu_type , base_item_type , typename ci::michael_list::make_traits< ci::opt::hook< ci::michael_list::base_hook< ci::opt::gc< rcu_type >>> - , ci::opt::less< less > + , ci::opt::less< item_less > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -324,7 +324,7 @@ TYPED_TEST_P( IntrusiveSplitMichaelSet, member_cmp ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template cmp cmp; + typedef typename TestFixture::template cmp item_cmp; typedef typename TestFixture::hash_int hash_int; typedef ci::MichaelList< rcu_type @@ -334,7 +334,7 @@ TYPED_TEST_P( IntrusiveSplitMichaelSet, member_cmp ) offsetof( member_item_type, hMember ), ci::opt::gc >> - , ci::opt::compare< cmp > + , ci::opt::compare< item_cmp > , ci::opt::disposer< mock_disposer > >::type > bucket_type; @@ -354,7 +354,7 @@ TYPED_TEST_P( IntrusiveSplitMichaelSet, member_less ) typedef typename TestFixture::rcu_type rcu_type; typedef typename TestFixture::member_item_type member_item_type; typedef typename TestFixture::mock_disposer mock_disposer; - typedef typename TestFixture::template less less; + typedef typename TestFixture::template less item_less; typedef typename TestFixture::hash_int hash_int; typedef ci::MichaelList< rcu_type @@ -364,7 +364,7 @@ TYPED_TEST_P( IntrusiveSplitMichaelSet, member_less ) offsetof( member_item_type, hMember ), ci::opt::gc > > - , ci::opt::less< less > + , ci::opt::less< item_less > , ci::opt::disposer< mock_disposer > >::type > bucket_type; diff --git a/test/unit/misc/cxx11_atomic_class.cpp b/test/unit/misc/cxx11_atomic_class.cpp index c17702ad..4041d8f7 100644 --- a/test/unit/misc/cxx11_atomic_class.cpp +++ b/test/unit/misc/cxx11_atomic_class.cpp @@ -526,14 +526,14 @@ namespace { EXPECT_EQ( *a.load( oLoad ), 1 ); for ( integral_type i = 1; i < aSize; ++i ) { - integral_type * p = a.load(); + p = a.load(); EXPECT_EQ( *p, i ); EXPECT_EQ( a.fetch_add( 1, order ), p ); EXPECT_EQ( *a.load( oLoad ), i + 1 ); } for ( integral_type i = aSize; i > 1; --i ) { - integral_type * p = a.load(); + p = a.load(); EXPECT_EQ( *p, i ); EXPECT_EQ( a.fetch_sub( 1, order ), p ); EXPECT_EQ( *a.load( oLoad ), i - 1 ); @@ -578,7 +578,7 @@ namespace { EXPECT_EQ( *a.load(), 1 ); for ( integral_type i = 1; i < aSize; ++i ) { - integral_type * p = a.load(); + p = a.load(); EXPECT_EQ( *p, i ); integral_type * pa = a.fetch_add( 1 ); EXPECT_EQ( pa, p ); @@ -586,7 +586,7 @@ namespace { } for ( integral_type i = aSize; i > 1; --i ) { - integral_type * p = a.load(); + p = a.load(); EXPECT_EQ( *p, i ); EXPECT_EQ( a.fetch_sub( 1 ), p ); EXPECT_EQ( *a.load(), i - 1 ); diff --git a/test/unit/misc/cxx11_atomic_func.cpp b/test/unit/misc/cxx11_atomic_func.cpp index 432ed4e5..20c948f0 100644 --- a/test/unit/misc/cxx11_atomic_func.cpp +++ b/test/unit/misc/cxx11_atomic_func.cpp @@ -416,14 +416,14 @@ namespace misc { EXPECT_EQ( *atomics::atomic_load_explicit( &a, oLoad ), 1 ); for ( integral_type i = 1; i < aSize; ++i ) { - integral_type * p = atomics::atomic_load_explicit( &a, oLoad ); + p = atomics::atomic_load_explicit( &a, oLoad ); EXPECT_EQ( *p, i ); EXPECT_EQ( atomics::atomic_fetch_add_explicit( &a, 1, order ), p ); EXPECT_EQ( *atomics::atomic_load_explicit( &a, oLoad ), i + 1 ); } for ( integral_type i = aSize; i > 1; --i ) { - integral_type * p = atomics::atomic_load_explicit( &a, oLoad ); + p = atomics::atomic_load_explicit( &a, oLoad ); EXPECT_EQ( *p, i ); EXPECT_EQ( atomics::atomic_fetch_sub_explicit( &a, 1, order ), p ); EXPECT_EQ( *atomics::atomic_load_explicit( &a, oLoad ), i - 1 ); @@ -464,14 +464,14 @@ namespace misc { EXPECT_EQ( *atomics::atomic_load( &a ), 1 ); for ( integral_type i = 1; i < aSize; ++i ) { - integral_type * p = atomics::atomic_load( &a ); + p = atomics::atomic_load( &a ); EXPECT_EQ( *p, i ); EXPECT_EQ( atomics::atomic_fetch_add( &a, 1 ), p ); EXPECT_EQ( *atomics::atomic_load( &a ), i + 1 ); } for ( integral_type i = aSize; i > 1; --i ) { - integral_type * p = atomics::atomic_load( &a ); + p = atomics::atomic_load( &a ); EXPECT_EQ( *p, i ); EXPECT_EQ( atomics::atomic_fetch_sub( &a, 1 ), p ); EXPECT_EQ( *atomics::atomic_load( &a ), i - 1 ); diff --git a/test/unit/pqueue/intrusive_mspqueue.cpp b/test/unit/pqueue/intrusive_mspqueue.cpp index b91c1a69..5fa1921a 100644 --- a/test/unit/pqueue/intrusive_mspqueue.cpp +++ b/test/unit/pqueue/intrusive_mspqueue.cpp @@ -116,7 +116,7 @@ namespace { ASSERT_EQ( pq.size(), 0u ); // Clear test - for ( value_type * p = pFirst; p < pLast; ++p ) { + for ( p = pFirst; p < pLast; ++p ) { ASSERT_TRUE( pq.push( *p )); } EXPECT_FALSE( pq.empty()); @@ -128,7 +128,7 @@ namespace { EXPECT_EQ( pq.size(), 0u ); // clear_with test - for ( value_type * p = pFirst; p < pLast; ++p ) { + for ( p = pFirst; p < pLast; ++p ) { ASSERT_TRUE( pq.push( *p )); } ASSERT_FALSE( pq.empty()); diff --git a/test/unit/striped-set/test_striped_set.h b/test/unit/striped-set/test_striped_set.h index 1e7dec47..338ebcdc 100644 --- a/test/unit/striped-set/test_striped_set.h +++ b/test/unit/striped-set/test_striped_set.h @@ -72,8 +72,8 @@ namespace { template bool operator()( Set& s, int key, Func f ) const { - return s.find( key, [&f]( typename Set::value_type& v, int key ) { - cds_test::container_set::other_item oi( key ); + return s.find( key, [&f]( typename Set::value_type& v, int k ) { + cds_test::container_set::other_item oi( k ); f( v, oi ); }); } diff --git a/test/unit/tree/test_bronson_avltree_map.h b/test/unit/tree/test_bronson_avltree_map.h index d82c9d11..9145c718 100644 --- a/test/unit/tree/test_bronson_avltree_map.h +++ b/test/unit/tree/test_bronson_avltree_map.h @@ -93,25 +93,25 @@ namespace { case 0: ASSERT_TRUE( m.insert( i )); ASSERT_FALSE( m.insert( i )); - ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) { - val.nVal = key.nKey; - val.strVal = std::to_string( key.nKey ); + ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) { + v.nVal = key.nKey; + v.strVal = std::to_string( key.nKey ); } )); break; case 1: ASSERT_TRUE( m.insert( i.nKey )); ASSERT_FALSE( m.insert( i.nKey )); - ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) { - val.nVal = key.nKey; - val.strVal = std::to_string( key.nKey ); + ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) { + v.nVal = key.nKey; + v.strVal = std::to_string( key.nKey ); } )); break; case 2: ASSERT_TRUE( m.insert( std::to_string( i.nKey ))); ASSERT_FALSE( m.insert( std::to_string( i.nKey ))); - ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) { - val.nVal = key.nKey; - val.strVal = std::to_string( key.nKey ); + ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) { + v.nVal = key.nKey; + v.strVal = std::to_string( key.nKey ); } )); break; case 3: @@ -127,27 +127,27 @@ namespace { ASSERT_FALSE( m.insert( val.strVal, i.nKey )); break; case 6: - ASSERT_TRUE( m.insert_with( i, []( key_type const& key, value_type& val ) { - val.nVal = key.nKey; - val.strVal = std::to_string( key.nKey ); + ASSERT_TRUE( m.insert_with( i, []( key_type const& key, value_type& v ) { + v.nVal = key.nKey; + v.strVal = std::to_string( key.nKey ); } )); ASSERT_FALSE( m.insert_with( i, []( key_type const& /*key*/, value_type& /*val*/ ) { EXPECT_TRUE( false ); } )); break; case 7: - ASSERT_TRUE( m.insert_with( i.nKey, []( key_type const& key, value_type& val ) { - val.nVal = key.nKey; - val.strVal = std::to_string( key.nKey ); + ASSERT_TRUE( m.insert_with( i.nKey, []( key_type const& key, value_type& v ) { + v.nVal = key.nKey; + v.strVal = std::to_string( key.nKey ); } )); ASSERT_FALSE( m.insert_with( i.nKey, []( key_type const& /*key*/, value_type& /*val*/ ) { EXPECT_TRUE( false ); } )); break; case 8: - ASSERT_TRUE( m.insert_with( val.strVal, []( key_type const& key, value_type& val ) { - val.nVal = key.nKey; - val.strVal = std::to_string( key.nKey ); + ASSERT_TRUE( m.insert_with( val.strVal, []( key_type const& key, value_type& v ) { + v.nVal = key.nKey; + v.strVal = std::to_string( key.nKey ); } )); ASSERT_FALSE( m.insert_with( val.strVal, []( key_type const& /*key*/, value_type& /*val*/ ) { EXPECT_TRUE( false ); @@ -160,17 +160,17 @@ namespace { ASSERT_FALSE( updResult.first ); ASSERT_FALSE( updResult.second ); - updResult = m.update( i.nKey, []( bool bNew, key_type const& key, value_type& val ) { + updResult = m.update( i.nKey, []( bool bNew, key_type const& key, value_type& v ) { EXPECT_TRUE( bNew ); - val.nVal = key.nKey; + v.nVal = key.nKey; }); ASSERT_TRUE( updResult.first ); ASSERT_TRUE( updResult.second ); - updResult = m.update( i.nKey, []( bool bNew, key_type const& key, value_type& val ) { + updResult = m.update( i.nKey, []( bool bNew, key_type const& key, value_type& v ) { EXPECT_FALSE( bNew ); - EXPECT_EQ( key.nKey, val.nVal ); - val.strVal = std::to_string( val.nVal ); + EXPECT_EQ( key.nKey, v.nVal ); + v.strVal = std::to_string( v.nVal ); } ); ASSERT_TRUE( updResult.first ); ASSERT_FALSE( updResult.second ); @@ -182,17 +182,17 @@ namespace { ASSERT_FALSE( updResult.first ); ASSERT_FALSE( updResult.second ); - updResult = m.update( i, []( bool bNew, key_type const& key, value_type& val ) { + updResult = m.update( i, []( bool bNew, key_type const& key, value_type& v ) { EXPECT_TRUE( bNew ); - val.nVal = key.nKey; + v.nVal = key.nKey; }); ASSERT_TRUE( updResult.first ); ASSERT_TRUE( updResult.second ); - updResult = m.update( i, []( bool bNew, key_type const& key, value_type& val ) { + updResult = m.update( i, []( bool bNew, key_type const& key, value_type& v ) { EXPECT_FALSE( bNew ); - EXPECT_EQ( key.nKey, val.nVal ); - val.strVal = std::to_string( val.nVal ); + EXPECT_EQ( key.nKey, v.nVal ); + v.strVal = std::to_string( v.nVal ); } ); ASSERT_TRUE( updResult.first ); ASSERT_FALSE( updResult.second ); @@ -204,17 +204,17 @@ namespace { ASSERT_FALSE( updResult.first ); ASSERT_FALSE( updResult.second ); - updResult = m.update( val.strVal, []( bool bNew, key_type const& key, value_type& val ) { + updResult = m.update( val.strVal, []( bool bNew, key_type const& key, value_type& v ) { EXPECT_TRUE( bNew ); - val.nVal = key.nKey; + v.nVal = key.nKey; }); ASSERT_TRUE( updResult.first ); ASSERT_TRUE( updResult.second ); - updResult = m.update( val.strVal, []( bool bNew, key_type const& key, value_type& val ) { + updResult = m.update( val.strVal, []( bool bNew, key_type const& key, value_type& v ) { EXPECT_FALSE( bNew ); - EXPECT_EQ( key.nKey, val.nVal ); - val.strVal = std::to_string( val.nVal ); + EXPECT_EQ( key.nKey, v.nVal ); + v.strVal = std::to_string( v.nVal ); } ); ASSERT_TRUE( updResult.first ); ASSERT_FALSE( updResult.second ); @@ -222,9 +222,9 @@ namespace { case 12: ASSERT_TRUE( m.emplace( i.nKey )); ASSERT_FALSE( m.emplace( i.nKey )); - ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) { - val.nVal = key.nKey; - val.strVal = std::to_string( key.nKey ); + ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) { + v.nVal = key.nKey; + v.strVal = std::to_string( key.nKey ); } )); break; case 13: @@ -256,17 +256,17 @@ namespace { ASSERT_TRUE( m.contains( i.nKey )); ASSERT_TRUE( m.contains( i )); ASSERT_TRUE( m.contains( other_item( i.nKey ), other_less())); - ASSERT_TRUE( m.find( i, []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.find( i, []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); } )); - ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); } )); - ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); } )); } ASSERT_FALSE( m.empty()); @@ -284,17 +284,17 @@ namespace { ASSERT_TRUE( m.contains( val.strVal )); ASSERT_TRUE( m.contains( i )); ASSERT_TRUE( m.contains( other_item( i.nKey ), other_less())); - ASSERT_TRUE( m.find( i, []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.find( i, []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); } )); - ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.find( i.nKey, []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); } )); - ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.find_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); } )); @@ -316,36 +316,36 @@ namespace { ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_less())); break; case 4: - ASSERT_TRUE( m.erase( i, []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.erase( i, []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); })); ASSERT_FALSE( m.erase( i, []( key_type const& /*key*/, value_type& /*val*/ ) { EXPECT_TRUE( false ); })); break; case 5: - ASSERT_TRUE( m.erase( i.nKey, []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.erase( i.nKey, []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); })); ASSERT_FALSE( m.erase( i.nKey, []( key_type const& /*key*/, value_type& /*val*/ ) { EXPECT_TRUE( false ); })); break; case 6: - ASSERT_TRUE( m.erase( val.strVal, []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.erase( val.strVal, []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); })); ASSERT_FALSE( m.erase( val.strVal, []( key_type const& /*key*/, value_type& /*val*/ ) { EXPECT_TRUE( false ); })); break; case 7: - ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& val ) { - EXPECT_EQ( key.nKey, val.nVal ); - EXPECT_EQ( std::to_string( key.nKey ), val.strVal ); + ASSERT_TRUE( m.erase_with( other_item( i.nKey ), other_less(), []( key_type const& key, value_type& v ) { + EXPECT_EQ( key.nKey, v.nVal ); + EXPECT_EQ( std::to_string( key.nKey ), v.strVal ); })); ASSERT_FALSE( m.erase_with( other_item( i.nKey ), other_less(), []( key_type const& /*key*/, value_type& /*val*/ ) { EXPECT_TRUE( false ); -- 2.34.1