From 025501fba2f37ec3e8dd0f187c49fc22c18ed951 Mon Sep 17 00:00:00 2001 From: khizmax Date: Tue, 27 Sep 2016 20:34:35 +0300 Subject: [PATCH] Fixed minor gcc warnings --- test/stress/map/insdel_func/map_insdel_func.h | 4 +-- test/stress/map/insfind_int/map_insfind_int.h | 12 ++++---- test/stress/pqueue/pop.cpp | 8 +++--- test/stress/pqueue/push.cpp | 6 ++-- test/stress/pqueue/push_pop.cpp | 10 +++---- test/stress/queue/bounded_queue_fulness.cpp | 10 +++---- test/stress/queue/intrusive_push_pop.cpp | 8 +++--- test/stress/queue/push.cpp | 6 ++-- test/stress/queue/push_pop.cpp | 8 +++--- test/stress/queue/random.cpp | 10 +++---- test/stress/set/delodd/set_delodd.h | 4 +-- test/stress/stack/intrusive_stack_push_pop.h | 4 +-- test/stress/stack/push.cpp | 2 +- test/stress/stack/push_pop.cpp | 2 +- test/unit/map/skiplist_nogc.cpp | 6 ++-- .../queue/intrusive_segmented_queue_dhp.cpp | 4 +-- test/unit/set/test_set.h | 4 +-- test/unit/set/test_set_nogc.h | 8 +++--- test/unit/set/test_set_rcu.h | 12 ++++---- test/unit/tree/test_intrusive_tree_hp.h | 28 +++++++++---------- test/unit/tree/test_intrusive_tree_rcu.h | 28 +++++++++---------- test/unit/tree/test_tree_set_rcu.h | 8 +++--- 22 files changed, 96 insertions(+), 96 deletions(-) diff --git a/test/stress/map/insdel_func/map_insdel_func.h b/test/stress/map/insdel_func/map_insdel_func.h index 07a920df..856bdcd7 100644 --- a/test/stress/map/insdel_func/map_insdel_func.h +++ b/test/stress/map/insdel_func/map_insdel_func.h @@ -503,9 +503,9 @@ namespace map { << std::make_pair( "update_functor_modify", nEnsFuncModified ) << std::make_pair( "finish_map_size", testMap.size() ); - EXPECT_EQ( nDelValueFailed, 0 ); + EXPECT_EQ( nDelValueFailed, 0u ); EXPECT_EQ( nDelValueSuccess, nDeleteSuccess ); - EXPECT_EQ( nUpdateFailed, 0 ); + EXPECT_EQ( nUpdateFailed, 0u ); EXPECT_EQ( nUpdateCreated + nUpdateModified, nEnsFuncCreated + nEnsFuncModified ); // nInsFuncCalled is call count of insert functor diff --git a/test/stress/map/insfind_int/map_insfind_int.h b/test/stress/map/insfind_int/map_insfind_int.h index 048309e7..7b97aed6 100644 --- a/test/stress/map/insfind_int/map_insfind_int.h +++ b/test/stress/map/insfind_int/map_insfind_int.h @@ -5,7 +5,7 @@ Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "map_type.h" @@ -157,8 +157,8 @@ namespace map { for ( size_t i = 0; i < pool.size(); ++i ) { inserter& thr = static_cast(pool.get( i )); - EXPECT_EQ( thr.m_nInsertFailed, 0 ) << "thread " << thr.id(); - EXPECT_EQ( thr.m_nFindFail, 0 ) << "thread " << thr.id(); + EXPECT_EQ( thr.m_nInsertFailed, 0u ) << "thread " << thr.id(); + EXPECT_EQ( thr.m_nFindFail, 0u ) << "thread " << thr.id(); nInsertSuccess += thr.m_nInsertSuccess; nInsertFailed += thr.m_nInsertFailed; @@ -173,8 +173,8 @@ namespace map { << std::make_pair( "find_failed", nFindFailed ) << std::make_pair( "finish_map_size", testMap.size() ); - EXPECT_EQ( nInsertFailed, 0 ); - EXPECT_EQ( nFindFailed, 0 ); + EXPECT_EQ( nInsertFailed, 0u ); + EXPECT_EQ( nFindFailed, 0u ); check_before_cleanup( testMap ); diff --git a/test/stress/pqueue/pop.cpp b/test/stress/pqueue/pop.cpp index 40314747..89b0241f 100644 --- a/test/stress/pqueue/pop.cpp +++ b/test/stress/pqueue/pop.cpp @@ -177,8 +177,8 @@ namespace { << std::make_pair( "error_priority_violation", nTotalError ); EXPECT_EQ( nTotalPopped, s_nQueueSize ); - EXPECT_EQ( nTotalError, 0 ) << "priority violations"; - EXPECT_EQ( nTotalErrorEq, 0 ) << "double key"; + EXPECT_EQ( nTotalError, 0u ) << "priority violations"; + EXPECT_EQ( nTotalErrorEq, 0u ) << "double key"; } propout() << q.statistics(); @@ -192,9 +192,9 @@ namespace { s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount ); s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize ); - if ( s_nThreadCount == 0 ) + if ( s_nThreadCount == 0u ) s_nThreadCount = 1; - if ( s_nQueueSize == 0 ) + if ( s_nQueueSize == 0u ) s_nQueueSize = 1000; } diff --git a/test/stress/pqueue/push.cpp b/test/stress/pqueue/push.cpp index 95e23aa0..eb5b0813 100644 --- a/test/stress/pqueue/push.cpp +++ b/test/stress/pqueue/push.cpp @@ -94,7 +94,7 @@ namespace pqueue { for ( size_t i = 0; i < pool.size(); ++i ) { Producer& prod = static_cast&>(pool.get( i )); - EXPECT_EQ( prod.m_nPushError, 0 ) << "producer=" << i; + EXPECT_EQ( prod.m_nPushError, 0u ) << "producer=" << i; } EXPECT_FALSE( q.empty()); @@ -153,9 +153,9 @@ namespace pqueue { s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount ); s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize ); - if ( s_nThreadCount == 0 ) + if ( s_nThreadCount == 0u ) s_nThreadCount = 1; - if ( s_nQueueSize == 0 ) + if ( s_nQueueSize == 0u ) s_nQueueSize = 1000; } diff --git a/test/stress/pqueue/push_pop.cpp b/test/stress/pqueue/push_pop.cpp index 3078a666..f1df9d64 100644 --- a/test/stress/pqueue/push_pop.cpp +++ b/test/stress/pqueue/push_pop.cpp @@ -181,7 +181,7 @@ namespace { assert( t.type() == producer_thread ); Producer& prod = static_cast&>(t); nPushFailed += prod.m_nPushError; - EXPECT_EQ( prod.m_nPushError , 0 ) << "producer " << i; + EXPECT_EQ( prod.m_nPushError , 0u ) << "producer " << i; } } @@ -190,7 +190,7 @@ namespace { << std::make_pair( "push_error", nPushFailed ); EXPECT_EQ( nTotalPopped, s_nQueueSize ); - EXPECT_EQ( nPushFailed, 0 ); + EXPECT_EQ( nPushFailed, 0u ); //check_statistics( testQueue.statistics() ); propout() << q.statistics(); @@ -205,11 +205,11 @@ namespace { s_nPopThreadCount = cfg.get_size_t( "PopThreadCount", s_nPopThreadCount ); s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize ); - if ( s_nPushThreadCount == 0 ) + if ( s_nPushThreadCount == 0u ) s_nPushThreadCount = 1; - if ( s_nPopThreadCount == 0 ) + if ( s_nPopThreadCount == 0u ) s_nPopThreadCount = 1; - if ( s_nQueueSize == 0 ) + if ( s_nQueueSize == 0u ) s_nQueueSize = 1000; } diff --git a/test/stress/queue/bounded_queue_fulness.cpp b/test/stress/queue/bounded_queue_fulness.cpp index fbae332e..d133fa06 100644 --- a/test/stress/queue/bounded_queue_fulness.cpp +++ b/test/stress/queue/bounded_queue_fulness.cpp @@ -94,11 +94,11 @@ namespace { s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize ); s_nPassCount = cfg.get_size_t( "PassCount", s_nPassCount ); - if ( s_nThreadCount == 0 ) + if ( s_nThreadCount == 0u ) s_nThreadCount = 1; - if ( s_nQueueSize == 0 ) + if ( s_nQueueSize == 0u ) s_nQueueSize = 1024; - if ( s_nPassCount == 0 ) + if ( s_nPassCount == 0u ) s_nPassCount = 1; } @@ -118,8 +118,8 @@ namespace { nPopError += strain.m_nPopError; } EXPECT_TRUE( !q.empty()); - EXPECT_EQ( nPushError, 0 ); - EXPECT_EQ( nPopError, 0 ); + EXPECT_EQ( nPushError, 0u ); + EXPECT_EQ( nPopError, 0u ); } template diff --git a/test/stress/queue/intrusive_push_pop.cpp b/test/stress/queue/intrusive_push_pop.cpp index 33640dbe..389f70d7 100644 --- a/test/stress/queue/intrusive_push_pop.cpp +++ b/test/stress/queue/intrusive_push_pop.cpp @@ -206,11 +206,11 @@ namespace { s_nFCPassCount = cfg.get_uint( "FCPassCount", s_nFCPassCount ); s_nFCCompactFactor = cfg.get_uint( "FCCompactFactor", s_nFCCompactFactor ); - if ( s_nReaderThreadCount == 0 ) + if ( s_nReaderThreadCount == 0u ) s_nReaderThreadCount = 1; - if ( s_nWriterThreadCount == 0 ) + if ( s_nWriterThreadCount == 0u ) s_nWriterThreadCount = 1; - if ( s_nQueueSize == 0 ) + if ( s_nQueueSize == 0u ) s_nQueueSize = 1000; } @@ -352,7 +352,7 @@ namespace { if ( it->nConsumer == c_nBadConsumer ) ++nBadConsumerCount; } - EXPECT_EQ( nBadConsumerCount, 0 ); + EXPECT_EQ( nBadConsumerCount, 0u ); } analyze( q, nLeftOffset, nRightOffset ); diff --git a/test/stress/queue/push.cpp b/test/stress/queue/push.cpp index f9ba1216..ed4963f8 100644 --- a/test/stress/queue/push.cpp +++ b/test/stress/queue/push.cpp @@ -102,9 +102,9 @@ namespace { s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount ); s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize ); - if ( s_nThreadCount == 0 ) + if ( s_nThreadCount == 0u ) s_nThreadCount = 1; - if ( s_nQueueSize == 0 ) + if ( s_nQueueSize == 0u ) s_nQueueSize = 1000; } @@ -148,7 +148,7 @@ namespace { for ( size_t i = 0; i < pool.size(); ++i ) { Producer& thread = static_cast&>(pool.get( i )); - EXPECT_EQ( thread.m_nPushError, 0 ) << " producer thread " << i; + EXPECT_EQ( thread.m_nPushError, 0u ) << " producer thread " << i; } EXPECT_TRUE( !q.empty() ); diff --git a/test/stress/queue/push_pop.cpp b/test/stress/queue/push_pop.cpp index 409db310..7c3ff6f4 100644 --- a/test/stress/queue/push_pop.cpp +++ b/test/stress/queue/push_pop.cpp @@ -219,7 +219,7 @@ namespace { nTotalPops += consumer.m_nPopped; nPopFalse += consumer.m_nPopEmpty; arrConsumer.push_back( &consumer ); - EXPECT_EQ( consumer.m_nBadWriter, 0 ) << "consumer_thread_no " << i; + EXPECT_EQ( consumer.m_nBadWriter, 0u ) << "consumer_thread_no " << i; size_t nPopped = 0; for ( size_t n = 0; n < s_nProducerThreadCount; ++n ) @@ -307,11 +307,11 @@ namespace { s_nProducerThreadCount = cfg.get_size_t( "ProducerCount", s_nProducerThreadCount ); s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize ); - if ( s_nConsumerThreadCount == 0 ) + if ( s_nConsumerThreadCount == 0u ) s_nConsumerThreadCount = 1; - if ( s_nProducerThreadCount == 0 ) + if ( s_nProducerThreadCount == 0u ) s_nProducerThreadCount = 1; - if ( s_nQueueSize == 0 ) + if ( s_nQueueSize == 0u ) s_nQueueSize = 1000; } diff --git a/test/stress/queue/random.cpp b/test/stress/queue/random.cpp index bdd154a5..1094d82e 100644 --- a/test/stress/queue/random.cpp +++ b/test/stress/queue/random.cpp @@ -168,9 +168,9 @@ namespace { s_nThreadCount = cfg.get_size_t( "ThreadCount", s_nThreadCount ); s_nQueueSize = cfg.get_size_t( "QueueSize", s_nQueueSize ); - if ( s_nThreadCount == 0 ) + if ( s_nThreadCount == 0u ) s_nThreadCount = 1; - if ( s_nQueueSize == 0 ) + if ( s_nQueueSize == 0u ) s_nQueueSize = 1000; } @@ -192,9 +192,9 @@ namespace { cds_test::thread_pool& pool = get_pool(); for ( size_t i = 0; i < pool.size(); ++i ) { Strain& thr = static_cast &>( pool.get(i)); - EXPECT_EQ( thr.m_nUndefWriter, 0 ); - EXPECT_EQ( thr.m_nRepeatValue, 0 ); - EXPECT_EQ( thr.m_nPushError, 0 ); + EXPECT_EQ( thr.m_nUndefWriter, 0u ); + EXPECT_EQ( thr.m_nRepeatValue, 0u ); + EXPECT_EQ( thr.m_nPushError, 0u ); nPushError += thr.m_nPushError; arrPushCount[ thr.id() ] += thr.m_nPushCount; diff --git a/test/stress/set/delodd/set_delodd.h b/test/stress/set/delodd/set_delodd.h index 5d8df8aa..97007851 100644 --- a/test/stress/set/delodd/set_delodd.h +++ b/test/stress/set/delodd/set_delodd.h @@ -599,7 +599,7 @@ namespace set { } EXPECT_EQ( nInsertSuccess, s_nSetSize * s_nInsThreadCount ); - EXPECT_EQ( nInsertFailed, 0 ); + EXPECT_EQ( nInsertFailed, 0u ); propout() << std::make_pair( "insert_success", nInsertSuccess ) @@ -669,7 +669,7 @@ namespace set { } EXPECT_EQ( nInsertSuccess, s_nSetSize * s_nInsThreadCount ); - EXPECT_EQ( nInsertFailed, 0 ); + EXPECT_EQ( nInsertFailed, 0u ); propout() << std::make_pair( "insert_success", nInsertSuccess ) diff --git a/test/stress/stack/intrusive_stack_push_pop.h b/test/stress/stack/intrusive_stack_push_pop.h index 4c7804ca..28adf8a7 100644 --- a/test/stress/stack/intrusive_stack_push_pop.h +++ b/test/stress/stack/intrusive_stack_push_pop.h @@ -230,8 +230,8 @@ namespace cds_test { } EXPECT_EQ( nPopCount, s_nStackSize ); - EXPECT_EQ( nDirtyPop, 0 ); - EXPECT_EQ( nPushError, 0 ); + EXPECT_EQ( nDirtyPop, 0u ); + EXPECT_EQ( nPushError, 0u ); for ( size_t i = 0; i < sizeof( arrVal ) / sizeof( arrVal[0] ); ++i ) { EXPECT_EQ( arrVal[i], 0 ) << "i=" << i; diff --git a/test/stress/stack/push.cpp b/test/stress/stack/push.cpp index 8fd5f19b..6ef3dee0 100644 --- a/test/stress/stack/push.cpp +++ b/test/stress/stack/push.cpp @@ -167,7 +167,7 @@ namespace { for ( size_t i = 0; i < pool.size(); ++i ) { Producer& producer = static_cast&>( pool.get( i )); - EXPECT_EQ( producer.m_nPushError, 0 ) << "Producer=" << i; + EXPECT_EQ( producer.m_nPushError, 0u ) << "Producer=" << i; aThread[producer.id()] = producer.m_nEndItem - 1; } EXPECT_FALSE( testStack.empty()); diff --git a/test/stress/stack/push_pop.cpp b/test/stress/stack/push_pop.cpp index 1c0654a1..ad3dd676 100644 --- a/test/stress/stack/push_pop.cpp +++ b/test/stress/stack/push_pop.cpp @@ -263,7 +263,7 @@ namespace { } EXPECT_EQ( nPopCount, s_nStackSize ); - EXPECT_EQ( nDirtyPop, 0 ); + EXPECT_EQ( nDirtyPop, 0u ); for ( size_t i = 0; i < sizeof( arrVal ) / sizeof( arrVal[0] ); ++i ) { EXPECT_EQ( arrVal[i], 0 ); diff --git a/test/unit/map/skiplist_nogc.cpp b/test/unit/map/skiplist_nogc.cpp index a2f79572..47fa0fdd 100644 --- a/test/unit/map/skiplist_nogc.cpp +++ b/test/unit/map/skiplist_nogc.cpp @@ -5,7 +5,7 @@ Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test_map_nogc.h" @@ -65,7 +65,7 @@ namespace { p = m.get_max(); ASSERT_TRUE( p != nullptr ); - EXPECT_EQ( p->first.nKey, kkSize ); + EXPECT_EQ( p->first.nKey, static_cast( kkSize )); } m.clear(); diff --git a/test/unit/queue/intrusive_segmented_queue_dhp.cpp b/test/unit/queue/intrusive_segmented_queue_dhp.cpp index 51d93e07..5e7d25d3 100644 --- a/test/unit/queue/intrusive_segmented_queue_dhp.cpp +++ b/test/unit/queue/intrusive_segmented_queue_dhp.cpp @@ -63,8 +63,8 @@ namespace { void check_array( V& arr ) { for ( size_t i = 0; i < arr.size(); ++i ) { - EXPECT_EQ( arr[i].nDisposeCount, 2 ); - EXPECT_EQ( arr[i].nDispose2Count, 1 ); + EXPECT_EQ( arr[i].nDisposeCount, 2u ); + EXPECT_EQ( arr[i].nDispose2Count, 1u ); } } }; diff --git a/test/unit/set/test_set.h b/test/unit/set/test_set.h index 6ccc9666..af88b5b5 100644 --- a/test/unit/set/test_set.h +++ b/test/unit/set/test_set.h @@ -146,7 +146,7 @@ namespace cds_test { ASSERT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) { EXPECT_EQ( v.key(), key ); - EXPECT_EQ( v.nUpdateNewCount, 2 ); + EXPECT_EQ( v.nUpdateNewCount, 2u ); })); break; case 5: @@ -171,7 +171,7 @@ namespace cds_test { ASSERT_TRUE( s.find( i, []( value_type const& v, value_type const& arg ) { EXPECT_EQ( v.key(), arg.key() ); - EXPECT_EQ( v.nUpdateNewCount, 2 ); + EXPECT_EQ( v.nUpdateNewCount, 2u ); })); break; case 6: diff --git a/test/unit/set/test_set_nogc.h b/test/unit/set/test_set_nogc.h index 8fbcbdfb..ef4567c7 100644 --- a/test/unit/set/test_set_nogc.h +++ b/test/unit/set/test_set_nogc.h @@ -5,7 +5,7 @@ Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CDSUNIT_SET_TEST_SET_NOGC_H @@ -315,7 +315,7 @@ namespace cds_test { it = s.contains( i.nKey ); ASSERT_TRUE( it != s.end() ); - EXPECT_EQ( it->nFindCount, it->nKey ); + EXPECT_EQ( it->nFindCount, static_cast( it->nKey )); ASSERT_TRUE( s.contains( i ) != s.end() ); ASSERT_TRUE( s.contains( other_item( i.key() ), other_less() ) != s.end()); } @@ -329,7 +329,7 @@ namespace cds_test { } for ( auto it = s.cbegin(); it != s.cend(); ++it ) { - EXPECT_EQ( it->nFindCount, it->key() * 3 ); + EXPECT_EQ( it->nFindCount, static_cast( it->key() * 3 )); } // clear diff --git a/test/unit/set/test_set_rcu.h b/test/unit/set/test_set_rcu.h index 9f720d90..876972ac 100644 --- a/test/unit/set/test_set_rcu.h +++ b/test/unit/set/test_set_rcu.h @@ -5,7 +5,7 @@ Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CDSUNIT_SET_TEST_SET_RCU_H @@ -76,7 +76,7 @@ namespace cds_test { } for ( auto it = s.cbegin(); it != s.cend(); ++it ) { - EXPECT_EQ( it->nFindCount, it->key() * 3 ); + EXPECT_EQ( it->nFindCount, static_cast( it->key() * 3 )); } typedef typename Set::exempt_ptr exempt_ptr; @@ -105,7 +105,7 @@ namespace cds_test { ASSERT_FALSE( !rp ); } EXPECT_EQ( rp->key(), i.key() ); - EXPECT_EQ( rp->nFindCount, i.key() * 3 ); + EXPECT_EQ( rp->nFindCount, static_cast( i.key() * 3 )); rp->nFindCount *= 2; } } @@ -135,7 +135,7 @@ namespace cds_test { break; } EXPECT_EQ( xp->key(), i.key() ); - EXPECT_EQ( xp->nFindCount, i.key() * 6 ); + EXPECT_EQ( xp->nFindCount, static_cast( i.key() * 6 )); } xp.release(); @@ -172,7 +172,7 @@ namespace cds_test { break; } EXPECT_EQ( xp->key(), i.key() ); - EXPECT_EQ( xp->nFindCount, i.key() * 6 ); + EXPECT_EQ( xp->nFindCount, static_cast( i.key() * 6 )); switch ( idx % 3 ) { case 0: diff --git a/test/unit/tree/test_intrusive_tree_hp.h b/test/unit/tree/test_intrusive_tree_hp.h index 0b350c97..07a1762e 100644 --- a/test/unit/tree/test_intrusive_tree_hp.h +++ b/test/unit/tree/test_intrusive_tree_hp.h @@ -5,7 +5,7 @@ Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CDSUNIT_TREE_TEST_INTRUSIVE_TREE_HP_H @@ -106,23 +106,23 @@ namespace cds_test { for ( auto idx : indices ) { auto& i = data[idx]; - EXPECT_EQ( i.nFindCount, 0 ); + EXPECT_EQ( i.nFindCount, 0u ); gp = t.get( i ); ASSERT_FALSE( !gp ); ++gp->nFindCount; - EXPECT_EQ( i.nFindCount, 1 ); + EXPECT_EQ( i.nFindCount, 1u ); gp = t.get( i.key() ); ASSERT_FALSE( !gp ); ++gp->nFindCount; - EXPECT_EQ( i.nFindCount, 2 ); + EXPECT_EQ( i.nFindCount, 2u ); gp = t.get_with( other_item( i.key()), other_less()); ASSERT_FALSE( !gp ); ++gp->nFindCount; - EXPECT_EQ( i.nFindCount, 3 ); + EXPECT_EQ( i.nFindCount, 3u ); - EXPECT_EQ( i.nEraseCount, 0 ); + EXPECT_EQ( i.nEraseCount, 0u ); switch ( i.key() % 3 ) { case 0: gp = t.extract( i.key()); @@ -136,7 +136,7 @@ namespace cds_test { } ASSERT_FALSE( !gp ); ++gp->nEraseCount; - EXPECT_EQ( i.nEraseCount, 1 ); + EXPECT_EQ( i.nEraseCount, 1u ); gp = t.extract( i ); ASSERT_TRUE( !gp ); @@ -149,12 +149,12 @@ namespace cds_test { gp.release(); ASSERT_TRUE( t.empty() ); - ASSERT_CONTAINER_SIZE( t, 0 ); + ASSERT_CONTAINER_SIZE( t, 0u ); // Force retiring cycle Tree::gc::force_dispose(); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } // extract_min @@ -175,13 +175,13 @@ namespace cds_test { } gp.release(); ASSERT_TRUE( t.empty() ); - ASSERT_CONTAINER_SIZE( t, 0 ); + ASSERT_CONTAINER_SIZE( t, 0u ); EXPECT_EQ( nCount, data.size() ); // Force retiring cycle Tree::gc::force_dispose(); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } // extract_max @@ -202,13 +202,13 @@ namespace cds_test { } gp.release(); ASSERT_TRUE( t.empty() ); - ASSERT_CONTAINER_SIZE( t, 0 ); + ASSERT_CONTAINER_SIZE( t, 0u ); EXPECT_EQ( nCount, data.size() ); // Force retiring cycle Tree::gc::force_dispose(); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } } diff --git a/test/unit/tree/test_intrusive_tree_rcu.h b/test/unit/tree/test_intrusive_tree_rcu.h index ceca126d..8f1eb99c 100644 --- a/test/unit/tree/test_intrusive_tree_rcu.h +++ b/test/unit/tree/test_intrusive_tree_rcu.h @@ -5,7 +5,7 @@ Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CDSUNIT_TREE_TEST_INTRUSIVE_TREE_RCU_H @@ -116,24 +116,24 @@ namespace cds_test { rcu_lock l; value_type * p; - EXPECT_EQ( i.nFindCount, 0 ); + EXPECT_EQ( i.nFindCount, 0u ); p = t.get( i ); ASSERT_FALSE( !p ); ++p->nFindCount; - EXPECT_EQ( i.nFindCount, 1 ); + EXPECT_EQ( i.nFindCount, 1u ); p = t.get( i.key() ); ASSERT_FALSE( !p ); ++p->nFindCount; - EXPECT_EQ( i.nFindCount, 2 ); + EXPECT_EQ( i.nFindCount, 2u ); p = t.get_with( other_item( i.key() ), other_less() ); ASSERT_FALSE( !p ); ++p->nFindCount; - EXPECT_EQ( i.nFindCount, 3 ); + EXPECT_EQ( i.nFindCount, 3u ); } - EXPECT_EQ( i.nEraseCount, 0 ); + EXPECT_EQ( i.nEraseCount, 0u ); switch ( i.key() % 3 ) { case 0: xp = t.extract( i.key()); @@ -147,7 +147,7 @@ namespace cds_test { } ASSERT_FALSE( !xp ); ++xp->nEraseCount; - EXPECT_EQ( i.nEraseCount, 1 ); + EXPECT_EQ( i.nEraseCount, 1u ); xp = t.extract( i ); ASSERT_TRUE( !xp ); @@ -158,12 +158,12 @@ namespace cds_test { } ASSERT_TRUE( t.empty() ); - ASSERT_CONTAINER_SIZE( t, 0 ); + ASSERT_CONTAINER_SIZE( t, 0u ); // Force retiring cycle Tree::gc::force_dispose(); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } // extract_min @@ -184,13 +184,13 @@ namespace cds_test { } xp.release(); ASSERT_TRUE( t.empty() ); - ASSERT_CONTAINER_SIZE( t, 0 ); + ASSERT_CONTAINER_SIZE( t, 0u ); EXPECT_EQ( nCount, data.size() ); // Force retiring cycle Tree::gc::force_dispose(); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } // extract_max @@ -211,13 +211,13 @@ namespace cds_test { } xp.release(); ASSERT_TRUE( t.empty() ); - ASSERT_CONTAINER_SIZE( t, 0 ); + ASSERT_CONTAINER_SIZE( t, 0u ); EXPECT_EQ( nCount, data.size() ); // Force retiring cycle Tree::gc::force_dispose(); for ( auto& i : data ) { - EXPECT_EQ( i.nDisposeCount, 1 ); + EXPECT_EQ( i.nDisposeCount, 1u ); } } }; diff --git a/test/unit/tree/test_tree_set_rcu.h b/test/unit/tree/test_tree_set_rcu.h index e6f9ddaf..43845867 100644 --- a/test/unit/tree/test_tree_set_rcu.h +++ b/test/unit/tree/test_tree_set_rcu.h @@ -5,7 +5,7 @@ Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CDSUNIT_TREE_TEST_TREE_SET_RCU_H @@ -125,7 +125,7 @@ namespace cds_test { break; } EXPECT_EQ( xp->key(), i.key() ); - EXPECT_EQ( xp->nFindCount, i.key() * 3 ); + EXPECT_EQ( xp->nFindCount, static_cast( i.key() * 3 )); } xp.release(); @@ -162,7 +162,7 @@ namespace cds_test { break; } EXPECT_EQ( xp->key(), i.key() ); - EXPECT_EQ( xp->nFindCount, i.key() * 3 ); + EXPECT_EQ( xp->nFindCount, static_cast( i.key() * 3 )); switch ( idx % 3 ) { case 0: -- 2.34.1