From bf70d25157b8e9610ada79239c3bc446b83a507f Mon Sep 17 00:00:00 2001 From: khizmax Date: Wed, 26 Nov 2014 08:52:08 +0300 Subject: [PATCH] Removed unused vars --- cds/container/cuckoo_map.h | 4 ++++ .../ordered_list/hdr_intrusive_lazy.h | 4 ++-- .../ordered_list/hdr_intrusive_michael.h | 4 ++-- tests/test-hdr/ordered_list/hdr_lazy.h | 2 +- tests/unit/alloc/michael_allocator.h | 24 +++++++++---------- tests/unit/map2/map_types.h | 16 ++++++------- tests/unit/map2/std_hash_map.h | 2 +- tests/unit/map2/std_map.h | 2 +- tests/unit/pqueue/pqueue_type.h | 2 +- .../queue/intrusive_queue_reader_writer.cpp | 2 +- tests/unit/queue/intrusive_queue_type.h | 10 ++++---- tests/unit/queue/queue_type.h | 10 ++++---- tests/unit/set2/set_delodd.cpp | 4 ++-- tests/unit/set2/set_insdel_func.h | 4 ++-- tests/unit/set2/set_types.h | 24 +++++++++---------- tests/unit/stack/intrusive_stack_type.h | 4 ++-- tests/unit/stack/stack_intrusive_pushpop.cpp | 2 +- tests/unit/stack/stack_pushpop.cpp | 2 +- tests/unit/stack/stack_type.h | 6 ++--- 19 files changed, 66 insertions(+), 62 deletions(-) diff --git a/cds/container/cuckoo_map.h b/cds/container/cuckoo_map.h index cf15043f..11885552 100644 --- a/cds/container/cuckoo_map.h +++ b/cds/container/cuckoo_map.h @@ -550,6 +550,7 @@ namespace cds { namespace container { template bool erase_with( K const& key, Predicate pred ) { + CDS_UNUSED( pred ); node_type * pNode = base_class::erase_with(key, cds::details::predicate_wrapper()); if ( pNode ) { free_node( pNode ); @@ -598,6 +599,7 @@ namespace cds { namespace container { template bool erase_with( K const& key, Predicate pred, Func f ) { + CDS_UNUSED( pred ); node_type * pNode = base_class::erase_with( key, cds::details::predicate_wrapper() ); if ( pNode ) { f( pNode->m_val ); @@ -640,6 +642,7 @@ namespace cds { namespace container { template bool find_with( K const& key, Predicate pred, Func f ) { + CDS_UNUSED( pred ); return base_class::find_with( key, cds::details::predicate_wrapper(), [&f](node_type& item, K const& ) { f( item.m_val );}); } @@ -667,6 +670,7 @@ namespace cds { namespace container { template bool find_with( K const& key, Predicate pred ) { + CDS_UNUSED( pred ); return base_class::find_with( key, cds::details::predicate_wrapper() ); } diff --git a/tests/test-hdr/ordered_list/hdr_intrusive_lazy.h b/tests/test-hdr/ordered_list/hdr_intrusive_lazy.h index a07c6b55..8402f732 100644 --- a/tests/test-hdr/ordered_list/hdr_intrusive_lazy.h +++ b/tests/test-hdr/ordered_list/hdr_intrusive_lazy.h @@ -173,7 +173,7 @@ namespace ordlist { struct ensure_functor { template - void operator ()(bool bNew, T& item, T& val ) + void operator ()(bool bNew, T& item, T& /*val*/ ) { if ( bNew ) ++item.s.nEnsureNewCall; @@ -185,7 +185,7 @@ namespace ordlist { struct find_functor { template - void operator ()( T& item, Q& val ) + void operator ()( T& item, Q& /*val*/ ) { ++item.s.nFindCall; } diff --git a/tests/test-hdr/ordered_list/hdr_intrusive_michael.h b/tests/test-hdr/ordered_list/hdr_intrusive_michael.h index 606d7f34..52c71735 100644 --- a/tests/test-hdr/ordered_list/hdr_intrusive_michael.h +++ b/tests/test-hdr/ordered_list/hdr_intrusive_michael.h @@ -173,7 +173,7 @@ namespace ordlist { struct ensure_functor { template - void operator ()(bool bNew, T& item, T& val ) + void operator ()(bool bNew, T& item, T& /*val*/ ) { if ( bNew ) ++item.s.nEnsureNewCall; @@ -185,7 +185,7 @@ namespace ordlist { struct find_functor { template - void operator ()( T& item, Q& val ) + void operator ()( T& item, Q& /*val*/ ) { ++item.s.nFindCall; } diff --git a/tests/test-hdr/ordered_list/hdr_lazy.h b/tests/test-hdr/ordered_list/hdr_lazy.h index 0b6bde9d..28c38887 100644 --- a/tests/test-hdr/ordered_list/hdr_lazy.h +++ b/tests/test-hdr/ordered_list/hdr_lazy.h @@ -179,7 +179,7 @@ namespace ordlist { }; struct ensure_functor { - void operator()( bool /*bNew*/, item& i, int n ) + void operator()( bool /*bNew*/, item& i, int /*n*/ ) { i.nVal = i.nKey * 1024; } diff --git a/tests/unit/alloc/michael_allocator.h b/tests/unit/alloc/michael_allocator.h index 7ef01a61..4b4c54ae 100644 --- a/tests/unit/alloc/michael_allocator.h +++ b/tests/unit/alloc/michael_allocator.h @@ -35,12 +35,12 @@ namespace memory { }; - pointer allocate( size_t nSize, const void * pHint ) + pointer allocate( size_t nSize, const void * /*pHint*/ ) { return reinterpret_cast( s_MichaelHeap_NoStat.alloc( sizeof(T) * nSize ) ); } - void deallocate( pointer p, size_t nCount ) + void deallocate( pointer p, size_t /*nCount*/ ) { s_MichaelHeap_NoStat.free( p ); } @@ -59,7 +59,7 @@ namespace memory { alignment = 1 }; - static void stat(summary_stat& s) + static void stat(summary_stat& /*s*/) {} }; @@ -74,12 +74,12 @@ namespace memory { alignment = 1 }; - pointer allocate( size_t nSize, const void * pHint ) + pointer allocate( size_t nSize, const void * /*pHint*/ ) { return reinterpret_cast( s_MichaelHeap_Stat.alloc( sizeof(T) * nSize ) ); } - void deallocate( pointer p, size_t nCount ) + void deallocate( pointer p, size_t /*nCount*/ ) { s_MichaelHeap_Stat.free( p ); } @@ -101,12 +101,12 @@ namespace memory { alignment = ALIGN }; - pointer allocate( size_t nSize, const void * pHint ) + pointer allocate( size_t nSize, const void * /*pHint*/ ) { return reinterpret_cast( s_MichaelHeap_NoStat.alloc_aligned( sizeof(T) * nSize, ALIGN ) ); } - void deallocate( pointer p, size_t nCount ) + void deallocate( pointer p, size_t /*nCount*/ ) { s_MichaelHeap_NoStat.free_aligned( p ); } @@ -127,12 +127,12 @@ namespace memory { alignment = ALIGN }; - pointer allocate( size_t nSize, const void * pHint ) + pointer allocate( size_t nSize, const void * /*pHint*/ ) { return reinterpret_cast( s_MichaelHeap_Stat.alloc_aligned( sizeof(T) * nSize, ALIGN ) ); } - void deallocate( pointer p, size_t nCount ) + void deallocate( pointer p, size_t /*nCount*/ ) { s_MichaelHeap_Stat.free_aligned( p ); } @@ -154,17 +154,17 @@ namespace memory { alignment = ALIGN }; - pointer allocate( size_t nSize, const void * pHint ) + pointer allocate( size_t nSize, const void * /*pHint*/ ) { return reinterpret_cast( cds::OS::aligned_malloc( sizeof(T) * nSize, ALIGN ) ); } - void deallocate( pointer p, size_t nCount ) + void deallocate( pointer p, size_t /*nCount*/ ) { cds::OS::aligned_free( p ); } - static void stat(summary_stat& s) + static void stat(summary_stat& /*s*/) {} }; diff --git a/tests/unit/map2/map_types.h b/tests/unit/map2/map_types.h index c1762959..44c6494d 100644 --- a/tests/unit/map2/map_types.h +++ b/tests/unit/map2/map_types.h @@ -127,7 +127,7 @@ namespace map2 { {} template - bool erase_with( Q const& key, Pred pred ) + bool erase_with( Q const& key, Pred /*pred*/ ) { return cuckoo_base_class::erase_with( key, typename std::conditional< cuckoo_base_class::c_isSorted, Pred, typename Pred::equal_to>::type() ); } @@ -1124,7 +1124,7 @@ namespace map2 { resizing_policy_t m_placeHolder; public: - StripedHashMap_ord( size_t nCapacity, size_t nLoadFactor ) + StripedHashMap_ord( size_t /*nCapacity*/, size_t nLoadFactor ) : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( nLoadFactor * 1024 )) ) {} }; @@ -1228,7 +1228,7 @@ namespace map2 { resizing_policy_t m_placeHolder; public: - RefinableHashMap_ord( size_t nCapacity, size_t nLoadFactor ) + RefinableHashMap_ord( size_t /*nCapacity*/, size_t nLoadFactor ) : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( nLoadFactor * 1024 )) ) {} }; @@ -1726,15 +1726,15 @@ namespace map2 { }; template - static inline void print_stat( Map const& m ) + static inline void print_stat( Map const& /*m*/ ) {} template - static inline void additional_cleanup( Map& m ) + static inline void additional_cleanup( Map& /*m*/ ) {} template - static inline void additional_check( Map& m ) + static inline void additional_check( Map& /*m*/ ) {} @@ -1763,12 +1763,12 @@ namespace map2 { CPPUNIT_MSG( s.statistics() ); } template - static inline void additional_cleanup( cc::EllenBinTreeMap& s ) + static inline void additional_cleanup( cc::EllenBinTreeMap& /*s*/ ) { ellen_bintree_pool::internal_node_counter::reset(); } namespace ellen_bintree_check { - static inline void check_stat( cds::intrusive::ellen_bintree::empty_stat const& s ) + static inline void check_stat( cds::intrusive::ellen_bintree::empty_stat const& /*s*/ ) { // This check is not valid for thread-based RCU /* diff --git a/tests/unit/map2/std_hash_map.h b/tests/unit/map2/std_hash_map.h index 0c808963..cb9cd407 100644 --- a/tests/unit/map2/std_hash_map.h +++ b/tests/unit/map2/std_hash_map.h @@ -32,7 +32,7 @@ namespace map2 { typedef typename base_class::mapped_type value_type; typedef size_t item_counter; - StdHashMap( size_t nMapSize, size_t nLoadFactor ) + StdHashMap( size_t /*nMapSize*/, size_t /*nLoadFactor*/ ) {} bool find( const Key& key ) diff --git a/tests/unit/map2/std_map.h b/tests/unit/map2/std_map.h index 28517449..58508cd6 100644 --- a/tests/unit/map2/std_map.h +++ b/tests/unit/map2/std_map.h @@ -21,7 +21,7 @@ namespace map2 { typedef typename base_class::value_type pair_type; typedef size_t item_counter; - StdMap( size_t nMapSize, size_t nLoadFactor ) + StdMap( size_t /*nMapSize*/, size_t /*nLoadFactor*/ ) {} bool find( const Key& key ) diff --git a/tests/unit/pqueue/pqueue_type.h b/tests/unit/pqueue/pqueue_type.h index 5c271d6a..2eb0dece 100644 --- a/tests/unit/pqueue/pqueue_type.h +++ b/tests/unit/pqueue/pqueue_type.h @@ -288,7 +288,7 @@ namespace pqueue { template - static inline void check_statistics( Stat const& s ) + static inline void check_statistics( Stat const& /*s*/ ) {} static inline void check_statistics( cds::container::ellen_bintree::stat<> const& s ) diff --git a/tests/unit/queue/intrusive_queue_reader_writer.cpp b/tests/unit/queue/intrusive_queue_reader_writer.cpp index c6fa4917..7a0c718e 100644 --- a/tests/unit/queue/intrusive_queue_reader_writer.cpp +++ b/tests/unit/queue/intrusive_queue_reader_writer.cpp @@ -211,7 +211,7 @@ namespace queue { protected: template - void analyze( CppUnitMini::ThreadPool& pool, Queue& testQueue, size_t nLeftOffset, size_t nRightOffset ) + void analyze( CppUnitMini::ThreadPool& pool, Queue& testQueue, size_t /*nLeftOffset*/, size_t nRightOffset ) { typedef Consumer Reader; typedef Producer Writer; diff --git a/tests/unit/queue/intrusive_queue_type.h b/tests/unit/queue/intrusive_queue_type.h index 8e588253..67c30d76 100644 --- a/tests/unit/queue/intrusive_queue_type.h +++ b/tests/unit/queue/intrusive_queue_type.h @@ -507,7 +507,7 @@ namespace std { << "\t\tAdd basket attempts: " << s.m_TryAddBasket.get() << "\n" << "\t\t Add basket success: " << s.m_AddBasketCount.get() << "\n"; } - static inline std::ostream& operator <<(std::ostream& o, cds::intrusive::basket_queue::empty_stat const& s) + static inline std::ostream& operator <<(std::ostream& o, cds::intrusive::basket_queue::empty_stat const& /*s*/) { return o; } @@ -525,7 +525,7 @@ namespace std { << "\t\t Bad tail: " << s.m_BadTail.get() << "\n"; } - static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::msqueue::empty_stat const& s ) + static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::msqueue::empty_stat const& /*s*/ ) { return o; } @@ -550,7 +550,7 @@ namespace std { << "\t\t fix list call: " << s.m_FixListCount.get() << "\n"; } - static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::optimistic_queue::empty_stat const& s ) + static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::optimistic_queue::empty_stat const& /*s*/ ) { return o; } @@ -577,12 +577,12 @@ namespace std { << "\t Release pub-record: " << s.m_nReleasePubRecCount.get()<< "\n"; } - static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::fcqueue::empty_stat const& s ) + static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::fcqueue::empty_stat const& /*s*/ ) { return o; } - static inline std::ostream& operator <<( std::ostream& o, queue::details::empty_stat const& s ) + static inline std::ostream& operator <<( std::ostream& o, queue::details::empty_stat const& /*s*/ ) { return o; } diff --git a/tests/unit/queue/queue_type.h b/tests/unit/queue/queue_type.h index dc2826cc..818e05fe 100644 --- a/tests/unit/queue/queue_type.h +++ b/tests/unit/queue/queue_type.h @@ -544,7 +544,7 @@ namespace std { << "\t\tAdd basket attempts: " << s.m_TryAddBasket.get() << "\n" << "\t\t Add basket success: " << s.m_AddBasketCount.get() << "\n"; } - static inline std::ostream& operator <<(std::ostream& o, cds::container::basket_queue::empty_stat const& s) + static inline std::ostream& operator <<(std::ostream& o, cds::container::basket_queue::empty_stat const& /*s*/) { return o; } @@ -562,7 +562,7 @@ namespace std { << "\t\t Bad tail: " << s.m_BadTail.get() << "\n"; } - static inline std::ostream& operator <<( std::ostream& o, cds::container::msqueue::empty_stat const& s ) + static inline std::ostream& operator <<( std::ostream& o, cds::container::msqueue::empty_stat const& /*s*/ ) { return o; } @@ -587,7 +587,7 @@ namespace std { << "\t\t fix list call: " << s.m_FixListCount.get() << "\n"; } - static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::optimistic_queue::empty_stat const& s ) + static inline std::ostream& operator <<( std::ostream& o, cds::intrusive::optimistic_queue::empty_stat const& /*s*/ ) { return o; } @@ -615,12 +615,12 @@ namespace std { << "\t Release pub-record: " << s.m_nReleasePubRecCount.get()<< "\n"; } - static inline std::ostream& operator <<( std::ostream& o, cds::container::fcqueue::empty_stat const& s ) + static inline std::ostream& operator <<( std::ostream& o, cds::container::fcqueue::empty_stat const& /*s*/ ) { return o; } - static inline ostream& operator <<( ostream& o, cds::container::fcdeque::empty_stat const& s ) + static inline ostream& operator <<( ostream& o, cds::container::fcdeque::empty_stat const& /*s*/ ) { return o; } diff --git a/tests/unit/set2/set_delodd.cpp b/tests/unit/set2/set_delodd.cpp index 25ca23de..dc2b56ad 100644 --- a/tests/unit/set2/set_delodd.cpp +++ b/tests/unit/set2/set_delodd.cpp @@ -128,7 +128,7 @@ namespace boost { namespace set2 { template - static inline void check_before_clear( Set& s ) + static inline void check_before_clear( Set& /*s*/ ) {} template @@ -161,7 +161,7 @@ namespace set2 { struct ensure_func { template - void operator()( bool bNew, key_value_pair const&, Q const& ) + void operator()( bool /*bNew*/, key_value_pair const&, Q const& ) {} }; public: diff --git a/tests/unit/set2/set_insdel_func.h b/tests/unit/set2/set_insdel_func.h index df0ebc04..313ba0df 100644 --- a/tests/unit/set2/set_insdel_func.h +++ b/tests/unit/set2/set_insdel_func.h @@ -184,9 +184,9 @@ namespace set2 { , nModified(0) {} - void operator()( bool bNew, keyval_type& val, size_t nKey ) + void operator()( bool bNew, keyval_type& val, size_t /*nKey*/ ) { - std::unique_lock ac( val.val.m_access ); + std::unique_lock ac( val.val.m_access ); if ( !val.val.bInitialized ) { val.val.nKey = val.key; diff --git a/tests/unit/set2/set_types.h b/tests/unit/set2/set_types.h index 340411b3..20f54a98 100644 --- a/tests/unit/set2/set_types.h +++ b/tests/unit/set2/set_types.h @@ -87,7 +87,7 @@ namespace set2 { {} template - bool erase_with( Q const& key, Pred pred ) + bool erase_with( Q const& key, Pred /*pred*/ ) { return cuckoo_base_class::erase_with( key, typename std::conditional< cuckoo_base_class::c_isSorted, Pred, typename Pred::equal_to>::type() ); } @@ -1014,7 +1014,7 @@ namespace set2 { {} template - bool erase_with( Q const& v, Less pred ) + bool erase_with( Q const& v, Less /*pred*/ ) { return base_class::erase( v ); } @@ -1038,12 +1038,12 @@ namespace set2 { resizing_policy_t m_placeHolder; public: - StripedHashSet_ord( size_t nCapacity, size_t nLoadFactor ) + StripedHashSet_ord( size_t /*nCapacity*/, size_t nLoadFactor ) : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( nLoadFactor * 1024 )) ) {} template - bool erase_with( Q const& v, Less pred ) + bool erase_with( Q const& v, Less /*pred*/ ) { return base_class::erase( v ); } @@ -1142,7 +1142,7 @@ namespace set2 { {} template - bool erase_with( Q const& v, Less pred ) + bool erase_with( Q const& v, Less /*pred*/ ) { return base_class::erase( v ); } @@ -1166,12 +1166,12 @@ namespace set2 { resizing_policy_t m_placeHolder; public: - RefinableHashSet_ord( size_t nCapacity, size_t nLoadFactor ) + RefinableHashSet_ord( size_t /*nCapacity*/, size_t nLoadFactor ) : base_class( 0, *(new(&m_placeHolder) resizing_policy_t( nLoadFactor * 1024 )) ) {} template - bool erase_with( Q const& v, Less pred ) + bool erase_with( Q const& v, Less /*pred*/ ) { return base_class::erase( v ); } @@ -1723,7 +1723,7 @@ namespace set2 { // ************************************************* template - static inline void print_stat( Set const& s ) + static inline void print_stat( Set const& /*s*/ ) {} template @@ -1763,15 +1763,15 @@ namespace set2 { //******************************************************* template - static inline void additional_check( Set& set ) + static inline void additional_check( Set& /*set*/ ) {} template - static inline void additional_cleanup( Set& set ) + static inline void additional_cleanup( Set& /*set*/ ) {} namespace ellen_bintree_check { - static inline void check_stat( cds::intrusive::ellen_bintree::empty_stat const& s ) + static inline void check_stat( cds::intrusive::ellen_bintree::empty_stat const& /*s*/ ) { // Not true for threaded RCU /* @@ -1801,7 +1801,7 @@ namespace set2 { } template - static inline void additional_cleanup( cc::EllenBinTreeSet& s ) + static inline void additional_cleanup( cc::EllenBinTreeSet& /*s*/ ) { ellen_bintree_pool::internal_node_counter::reset(); } diff --git a/tests/unit/stack/intrusive_stack_type.h b/tests/unit/stack/intrusive_stack_type.h index b6530946..e49fbebf 100644 --- a/tests/unit/stack/intrusive_stack_type.h +++ b/tests/unit/stack/intrusive_stack_type.h @@ -361,12 +361,12 @@ namespace std { << "\t m_EliminationFailed: " << s.m_EliminationFailed.get() << "\n"; } - static inline ostream& operator <<( ostream& o, cds::intrusive::treiber_stack::empty_stat const& s ) + static inline ostream& operator <<( ostream& o, cds::intrusive::treiber_stack::empty_stat const& /*s*/ ) { return o; } - static inline ostream& operator <<( ostream& o, cds::intrusive::fcstack::empty_stat const& s ) + static inline ostream& operator <<( ostream& o, cds::intrusive::fcstack::empty_stat const& /*s*/ ) { return o; } diff --git a/tests/unit/stack/stack_intrusive_pushpop.cpp b/tests/unit/stack/stack_intrusive_pushpop.cpp index 6c4aa401..4369bf1c 100644 --- a/tests/unit/stack/stack_intrusive_pushpop.cpp +++ b/tests/unit/stack/stack_intrusive_pushpop.cpp @@ -191,7 +191,7 @@ namespace istack { } template - void analyze( CppUnitMini::ThreadPool& pool, Stack& testStack ) + void analyze( CppUnitMini::ThreadPool& pool, Stack& /*testStack*/ ) { size_t nPushError = 0; size_t nPopEmpty = 0; diff --git a/tests/unit/stack/stack_pushpop.cpp b/tests/unit/stack/stack_pushpop.cpp index e6f8078d..65f65e9e 100644 --- a/tests/unit/stack/stack_pushpop.cpp +++ b/tests/unit/stack/stack_pushpop.cpp @@ -156,7 +156,7 @@ namespace stack { } template - void analyze( CppUnitMini::ThreadPool& pool, Stack& testStack ) + void analyze( CppUnitMini::ThreadPool& pool, Stack& /*testStack*/ ) { size_t nPushError = 0; size_t nPopEmpty = 0; diff --git a/tests/unit/stack/stack_type.h b/tests/unit/stack/stack_type.h index 45d2167c..7fd2fee4 100644 --- a/tests/unit/stack/stack_type.h +++ b/tests/unit/stack/stack_type.h @@ -407,12 +407,12 @@ namespace std { << "\t m_EliminationFailed: " << s.m_EliminationFailed.get() << "\n"; } - static inline ostream& operator <<(ostream& o, cds::container::treiber_stack::empty_stat const& s) + static inline ostream& operator <<(ostream& o, cds::container::treiber_stack::empty_stat const& /*s*/) { return o; } - static inline ostream& operator <<( ostream& o, cds::container::fcstack::empty_stat const& s ) + static inline ostream& operator <<( ostream& o, cds::container::fcstack::empty_stat const& /*s*/ ) { return o; } @@ -438,7 +438,7 @@ namespace std { << "\t Release pub-record: " << s.m_nReleasePubRecCount.get()<< "\n"; } - static inline ostream& operator <<( ostream& o, cds::container::fcdeque::empty_stat const& s ) + static inline ostream& operator <<( ostream& o, cds::container::fcdeque::empty_stat const& /*s*/ ) { return o; } -- 2.34.1