From 4dff946e6dcad27d1c193902d50ba7f4c4772091 Mon Sep 17 00:00:00 2001 From: khizmax Date: Mon, 26 Sep 2016 23:46:42 +0300 Subject: [PATCH] fixed minor gcc warnings --- test/stress/map/find_int/map_find_int.h | 8 +++---- test/stress/map/find_string/map_find_string.h | 8 +++---- .../test_intrusive_michael_lazy_rcu.h | 10 ++++---- .../test_intrusive_michael_michael_rcu.h | 10 ++++---- .../intrusive-set/test_intrusive_set_nogc.h | 2 +- test/unit/queue/test_bounded_queue.h | 4 ++-- test/unit/set/test_michael_iterable.h | 24 +++++++++---------- test/unit/set/test_michael_lazy_rcu.h | 6 ++--- test/unit/set/test_michael_michael_rcu.h | 6 ++--- test/unit/set/test_set.h | 12 +++++----- test/unit/striped-set/test_striped_set.h | 4 ++-- 11 files changed, 47 insertions(+), 47 deletions(-) diff --git a/test/stress/map/find_int/map_find_int.h b/test/stress/map/find_int/map_find_int.h index 56d0b62c..c7c69de5 100644 --- a/test/stress/map/find_int/map_find_int.h +++ b/test/stress/map/find_int/map_find_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" @@ -198,9 +198,9 @@ namespace map { nMissingSuccess += w.m_KeyNotExists.nSuccess; nMissingFailed += w.m_KeyNotExists.nFailed; - EXPECT_EQ( w.m_KeyExists.nFailed, 0 ) << "thread " << i; + EXPECT_EQ( w.m_KeyExists.nFailed, 0u ) << "thread " << i; EXPECT_EQ( w.m_KeyExists.nSuccess, s_nRealMapSize * s_nPassCount ) << "thread " << i; - EXPECT_EQ( w.m_KeyNotExists.nFailed, 0 ) << "thread " << i; + EXPECT_EQ( w.m_KeyNotExists.nFailed, 0u ) << "thread " << i; EXPECT_EQ( w.m_KeyNotExists.nSuccess, (s_Data.size() - s_nRealMapSize) * s_nPassCount ) << "thread " << i; } diff --git a/test/stress/map/find_string/map_find_string.h b/test/stress/map/find_string/map_find_string.h index 3aa9ac6a..0b2e050b 100644 --- a/test/stress/map/find_string/map_find_string.h +++ b/test/stress/map/find_string/map_find_string.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: @@ -200,9 +200,9 @@ namespace map { nMissingFailed += w.m_KeyNotExists.nFailed; EXPECT_EQ( w.m_KeyExists.nSuccess, s_nMapSize * s_nPassCount ) << "thread " << i; - EXPECT_EQ( w.m_KeyExists.nFailed, 0 ) << "thread " << i; + EXPECT_EQ( w.m_KeyExists.nFailed, 0u ) << "thread " << i; EXPECT_EQ( w.m_KeyNotExists.nSuccess, (s_Data.size() - s_nMapSize) * s_nPassCount ) << "thread " << i; - EXPECT_EQ( w.m_KeyNotExists.nFailed, 0 ) << "thread " << i; + EXPECT_EQ( w.m_KeyNotExists.nFailed, 0u ) << "thread " << i; } propout() @@ -222,7 +222,7 @@ namespace map { template void run_test() { - ASSERT_GT( s_Data.size(), 0 ); + ASSERT_GT( s_Data.size(), 0u ); Map testMap( *this ); test( testMap ); 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 9ce91d0f..4dcf8ade 100644 --- a/test/unit/intrusive-set/test_intrusive_michael_lazy_rcu.h +++ b/test/unit/intrusive-set/test_intrusive_michael_lazy_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: @@ -196,7 +196,7 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, base_stat ) set_type s( TestFixture::kSize, 2 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( IntrusiveMichaelLazySet, base_wrapped_stat ) @@ -224,7 +224,7 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, base_wrapped_stat ) set_type s( TestFixture::kSize, 2 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( IntrusiveMichaelLazySet, member_cmp ) @@ -366,7 +366,7 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, member_stat ) set_type s( TestFixture::kSize, 2 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( IntrusiveMichaelLazySet, member_wrapped_stat ) @@ -394,7 +394,7 @@ TYPED_TEST_P( IntrusiveMichaelLazySet, member_wrapped_stat ) set_type s( TestFixture::kSize, 2 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } // GCC 5: All test names should be written on single line, otherwise a runtime error will be encountered like as 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 17b15535..66bb8182 100644 --- a/test/unit/intrusive-set/test_intrusive_michael_michael_rcu.h +++ b/test/unit/intrusive-set/test_intrusive_michael_michael_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: @@ -168,7 +168,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, base_stat ) set_type s( TestFixture::kSize, 2 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( IntrusiveMichaelSet, base_wrapped_stat ) @@ -197,7 +197,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, base_wrapped_stat ) set_type s( TestFixture::kSize, 2 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( IntrusiveMichaelSet, member_cmp ) @@ -312,7 +312,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_stat ) set_type s( TestFixture::kSize, 2 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( IntrusiveMichaelSet, member_wrapped_stat ) @@ -340,7 +340,7 @@ TYPED_TEST_P( IntrusiveMichaelSet, member_wrapped_stat ) set_type s( TestFixture::kSize, 2 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } // GCC 5: All test names should be written on single line, otherwise a runtime error will be encountered like as diff --git a/test/unit/intrusive-set/test_intrusive_set_nogc.h b/test/unit/intrusive-set/test_intrusive_set_nogc.h index f4f4b2c2..062a251e 100644 --- a/test/unit/intrusive-set/test_intrusive_set_nogc.h +++ b/test/unit/intrusive-set/test_intrusive_set_nogc.h @@ -315,7 +315,7 @@ namespace cds_test { EXPECT_EQ( i.nUpdateCount, 1u ); break; case 1: - EXPECT_EQ( i.nUpdateNewCount, 0 ); + EXPECT_EQ( i.nUpdateNewCount, 0u ); updResult = s.update( i, []( bool bNew, value_type& val, value_type& arg ) { EXPECT_TRUE( bNew ); diff --git a/test/unit/queue/test_bounded_queue.h b/test/unit/queue/test_bounded_queue.h index ff7ffa17..263ed5f8 100644 --- a/test/unit/queue/test_bounded_queue.h +++ b/test/unit/queue/test_bounded_queue.h @@ -136,12 +136,12 @@ namespace cds_test { // pop from empty queue it = static_cast(nSize * 2); ASSERT_FALSE( q.pop( it ) ); - ASSERT_EQ( it, nSize * 2 ); + ASSERT_EQ( it, static_cast( nSize * 2 )); ASSERT_TRUE( q.empty() ); ASSERT_CONTAINER_SIZE( q, 0u ); ASSERT_FALSE( q.dequeue( it ) ); - ASSERT_EQ( it, nSize * 2 ); + ASSERT_EQ( it, static_cast( nSize * 2 )); ASSERT_TRUE( q.empty() ); ASSERT_CONTAINER_SIZE( q, 0u ); } diff --git a/test/unit/set/test_michael_iterable.h b/test/unit/set/test_michael_iterable.h index 607b277f..01501cb1 100644 --- a/test/unit/set/test_michael_iterable.h +++ b/test/unit/set/test_michael_iterable.h @@ -113,7 +113,7 @@ namespace cds_test { EXPECT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) { EXPECT_EQ( v.key(), key ); - EXPECT_EQ( v.nFindCount, 1 ); + EXPECT_EQ( v.nFindCount, 1u ); })); break; case 3: @@ -122,7 +122,7 @@ namespace cds_test { EXPECT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) { EXPECT_EQ( v.key(), key ); - EXPECT_EQ( v.nFindCount, 1 ); + EXPECT_EQ( v.nFindCount, 1u ); })); break; case 4: @@ -139,7 +139,7 @@ namespace cds_test { { ASSERT_FALSE( old == nullptr ); EXPECT_EQ( v.key(), old->key() ); - EXPECT_EQ( old->nUpdateNewCount, 1 ); + EXPECT_EQ( old->nUpdateNewCount, 1u ); v.nUpdateNewCount = old->nUpdateNewCount; ++v.nUpdateCount; }, false ); @@ -149,8 +149,8 @@ namespace cds_test { EXPECT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) { EXPECT_EQ( v.key(), key ); - EXPECT_EQ( v.nUpdateNewCount, 1 ); - EXPECT_EQ( v.nUpdateCount, 1 ); + EXPECT_EQ( v.nUpdateNewCount, 1u ); + EXPECT_EQ( v.nUpdateCount, 1u ); })); break; case 5: @@ -167,7 +167,7 @@ namespace cds_test { { EXPECT_FALSE( old == nullptr ); EXPECT_EQ( v.key(), old->key() ); - EXPECT_EQ( old->nUpdateNewCount, 1 ); + EXPECT_EQ( old->nUpdateNewCount, 1u ); v.nUpdateNewCount = old->nUpdateNewCount; ++v.nUpdateCount; }, false ); @@ -177,8 +177,8 @@ namespace cds_test { EXPECT_TRUE( s.find( i, []( value_type const& v, value_type const& arg ) { EXPECT_EQ( v.key(), arg.key() ); - EXPECT_EQ( v.nUpdateNewCount, 1 ); - EXPECT_EQ( v.nUpdateCount, 1 ); + EXPECT_EQ( v.nUpdateNewCount, 1u ); + EXPECT_EQ( v.nUpdateCount, 1u ); })); break; case 6: @@ -280,11 +280,11 @@ namespace cds_test { })); EXPECT_TRUE( s.find( i, []( value_type& v, value_type const& ) { - EXPECT_EQ( ++v.nFindCount, 2 ); + EXPECT_EQ( ++v.nFindCount, 2u ); })); EXPECT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type& v, other_item const& ) { - EXPECT_EQ( ++v.nFindCount, 3 ); + EXPECT_EQ( ++v.nFindCount, 3u ); })); int nKey = i.key() - 1; @@ -353,7 +353,7 @@ namespace cds_test { EXPECT_FALSE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} )); } EXPECT_TRUE( s.empty() ); - EXPECT_CONTAINER_SIZE( s, 0 ); + EXPECT_CONTAINER_SIZE( s, 0u ); // clear @@ -367,7 +367,7 @@ namespace cds_test { s.clear(); EXPECT_TRUE( s.empty() ); - EXPECT_CONTAINER_SIZE( s, 0 ); + EXPECT_CONTAINER_SIZE( s, 0u ); EXPECT_TRUE( s.begin() == s.end() ); EXPECT_TRUE( s.cbegin() == s.cend() ); diff --git a/test/unit/set/test_michael_lazy_rcu.h b/test/unit/set/test_michael_lazy_rcu.h index 89a94025..d7e76df6 100644 --- a/test/unit/set/test_michael_lazy_rcu.h +++ b/test/unit/set/test_michael_lazy_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: @@ -238,7 +238,7 @@ TYPED_TEST_P( MichaelLazySet, stat ) set_type s( TestFixture::kSize, 4 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( MichaelLazySet, wrapped_stat ) @@ -263,7 +263,7 @@ TYPED_TEST_P( MichaelLazySet, wrapped_stat ) set_type s( TestFixture::kSize, 4 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } // GCC 5: All test names should be written on single line, otherwise a runtime error will be encountered like as diff --git a/test/unit/set/test_michael_michael_rcu.h b/test/unit/set/test_michael_michael_rcu.h index 5762e94e..d744eec7 100644 --- a/test/unit/set/test_michael_michael_rcu.h +++ b/test/unit/set/test_michael_michael_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: @@ -214,7 +214,7 @@ TYPED_TEST_P( MichaelSet, stat ) set_type s( TestFixture::kSize, 4 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } TYPED_TEST_P( MichaelSet, wrapped_stat ) @@ -239,7 +239,7 @@ TYPED_TEST_P( MichaelSet, wrapped_stat ) set_type s( TestFixture::kSize, 4 ); this->test( s ); - EXPECT_GE( s.statistics().m_nInsertSuccess, 0 ); + EXPECT_GE( s.statistics().m_nInsertSuccess, 0u ); } // GCC 5: All test names should be written on single line, otherwise a runtime error will be encountered like as diff --git a/test/unit/set/test_set.h b/test/unit/set/test_set.h index c1b25991..6ccc9666 100644 --- a/test/unit/set/test_set.h +++ b/test/unit/set/test_set.h @@ -112,7 +112,7 @@ namespace cds_test { ASSERT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) { EXPECT_EQ( v.key(), key ); - EXPECT_EQ( v.nFindCount, 1 ); + EXPECT_EQ( v.nFindCount, 1u ); })); break; case 3: @@ -121,7 +121,7 @@ namespace cds_test { ASSERT_TRUE( s.find( i.nKey, []( value_type const& v, int key ) { EXPECT_EQ( v.key(), key ); - EXPECT_EQ( v.nFindCount, 1 ); + EXPECT_EQ( v.nFindCount, 1u ); })); break; case 4: @@ -223,11 +223,11 @@ namespace cds_test { })); ASSERT_TRUE( s.find( i, []( value_type& v, value_type const& ) { - EXPECT_EQ( ++v.nFindCount, 2 ); + EXPECT_EQ( ++v.nFindCount, 2u ); })); ASSERT_TRUE( s.find_with( other_item( i.key() ), other_less(), []( value_type& v, other_item const& ) { - EXPECT_EQ( ++v.nFindCount, 3 ); + EXPECT_EQ( ++v.nFindCount, 3u ); })); int nKey = i.key() - 1; @@ -296,7 +296,7 @@ namespace cds_test { ASSERT_FALSE( s.find_with( other_item( i.key()), other_less(), []( value_type&, other_item const& ) {} )); } ASSERT_TRUE( s.empty() ); - ASSERT_CONTAINER_SIZE( s, 0 ); + ASSERT_CONTAINER_SIZE( s, 0u ); // clear @@ -310,7 +310,7 @@ namespace cds_test { s.clear(); ASSERT_TRUE( s.empty() ); - ASSERT_CONTAINER_SIZE( s, 0 ); + ASSERT_CONTAINER_SIZE( s, 0u ); ASSERT_TRUE( s.begin() == s.end() ); ASSERT_TRUE( s.cbegin() == s.cend() ); diff --git a/test/unit/striped-set/test_striped_set.h b/test/unit/striped-set/test_striped_set.h index fed3e069..85210b55 100644 --- a/test/unit/striped-set/test_striped_set.h +++ b/test/unit/striped-set/test_striped_set.h @@ -233,7 +233,7 @@ namespace { 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: @@ -258,7 +258,7 @@ namespace { 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: -- 2.34.1