From: khizmax Date: Mon, 26 Sep 2016 19:52:11 +0000 (+0300) Subject: Fixed minor gcc warnings X-Git-Tag: v2.2.0~118 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=libcds.git;a=commitdiff_plain;h=a113e0600093eee087415c0e7bf20a02dd6c8d86 Fixed minor gcc warnings --- diff --git a/projects/Win/vc14/gtest-stack.vcxproj.filters b/projects/Win/vc14/gtest-stack.vcxproj.filters index 86b7995a..f06141df 100644 --- a/projects/Win/vc14/gtest-stack.vcxproj.filters +++ b/projects/Win/vc14/gtest-stack.vcxproj.filters @@ -9,10 +9,6 @@ {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;hm;inl;inc;xsd - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - diff --git a/test/unit/intrusive-set/test_intrusive_feldman_hashset.h b/test/unit/intrusive-set/test_intrusive_feldman_hashset.h index bbcf320e..d2c9213c 100644 --- a/test/unit/intrusive-set/test_intrusive_feldman_hashset.h +++ b/test/unit/intrusive-set/test_intrusive_feldman_hashset.h @@ -206,7 +206,7 @@ namespace cds_test { } ASSERT_TRUE( s.contains( i.nKey ) ); - EXPECT_EQ( i.nFindCount, 0 ); + EXPECT_EQ( i.nFindCount, 0u ); ASSERT_TRUE( s.find( i.nKey, []( value_type& v ) { ++v.nFindCount; } )); EXPECT_EQ( i.nFindCount, 1u ); } diff --git a/test/unit/misc/cxx11_atomic_class.cpp b/test/unit/misc/cxx11_atomic_class.cpp index cb9aaca7..54f9ddc1 100644 --- a/test/unit/misc/cxx11_atomic_class.cpp +++ b/test/unit/misc/cxx11_atomic_class.cpp @@ -201,7 +201,7 @@ namespace { EXPECT_EQ( (a &= (integral_type) ~mask ), ( prev & (integral_type) ~mask )); prev = a; - EXPECT_EQ( ( prev & mask), 0u); + EXPECT_EQ( ( prev & mask), integral_type( 0 )); EXPECT_EQ( (a ^= mask ), (prev ^ mask )); prev = a; @@ -294,7 +294,7 @@ namespace { EXPECT_EQ( a.fetch_sub( n, order ), prev); } - EXPECT_EQ( a.load( oLoad ), 0 ); + EXPECT_EQ( a.load( oLoad ), integral_type( 0 )); // fetch_or / fetc_xor / fetch_and for ( size_t nBit = 0; nBit < sizeof(integral_type) * 8; ++nBit ) diff --git a/test/unit/misc/cxx11_atomic_func.cpp b/test/unit/misc/cxx11_atomic_func.cpp index fe26e56c..c93e958b 100644 --- a/test/unit/misc/cxx11_atomic_func.cpp +++ b/test/unit/misc/cxx11_atomic_func.cpp @@ -83,8 +83,8 @@ namespace misc { EXPECT_TRUE( atomics::atomic_is_lock_free( &a ) ); atomics::atomic_store( &a, (integral_type) 0 ); - EXPECT_EQ( a, 0 ); - EXPECT_EQ( atomics::atomic_load( &a ), 0 ); + EXPECT_EQ( a, integral_type( 0 )); + EXPECT_EQ( atomics::atomic_load( &a ), integral_type( 0 )); for ( size_t nByte = 0; nByte < sizeof(Integral); ++nByte ) { integral_type n = integral_type(42) << (nByte * 8); @@ -261,7 +261,7 @@ namespace misc { EXPECT_EQ( atomics::atomic_fetch_sub_explicit( &a, n, order ), prev); } - EXPECT_EQ( atomics::atomic_load_explicit( &a, oLoad ), 0 ); + EXPECT_EQ( atomics::atomic_load_explicit( &a, oLoad ), integral_type( 0 )); // fetch_or / fetc_xor / fetch_and for ( size_t nBit = 0; nBit < sizeof(integral_type) * 8; ++nBit ) diff --git a/test/unit/misc/split_bitstring.cpp b/test/unit/misc/split_bitstring.cpp index d5d58f0c..2f40bfd7 100644 --- a/test/unit/misc/split_bitstring.cpp +++ b/test/unit/misc/split_bitstring.cpp @@ -61,7 +61,7 @@ namespace { EXPECT_EQ( res, src ); ASSERT_TRUE( splitter.eos() ); ASSERT_TRUE( !splitter ); - EXPECT_EQ(splitter.safe_cut(sizeof(src) * 8), 0 ); + EXPECT_EQ(splitter.safe_cut(sizeof(src) * 8), 0u ); ASSERT_TRUE( splitter.eos() ); ASSERT_TRUE( !splitter ); splitter.reset(); @@ -71,7 +71,7 @@ namespace { EXPECT_EQ( res, src ); ASSERT_TRUE( splitter.eos() ); ASSERT_TRUE( !splitter ); - EXPECT_EQ( splitter.safe_cut(sizeof(src) * 8), 0 ); + EXPECT_EQ( splitter.safe_cut(sizeof(src) * 8), 0u ); ASSERT_TRUE( splitter.eos() ); ASSERT_TRUE( !splitter ); diff --git a/test/unit/pqueue/intrusive_mspqueue.cpp b/test/unit/pqueue/intrusive_mspqueue.cpp index c5e29c07..20d7acab 100644 --- a/test/unit/pqueue/intrusive_mspqueue.cpp +++ b/test/unit/pqueue/intrusive_mspqueue.cpp @@ -60,7 +60,7 @@ namespace { ASSERT_TRUE( pq.empty() ); ASSERT_FALSE( pq.full() ); - ASSERT_EQ( pq.size(), 0 ); + ASSERT_EQ( pq.size(), 0u ); ASSERT_EQ( pq.capacity(), base_class::c_nCapacity - 1 ); size_t nSize = 0; @@ -94,7 +94,7 @@ namespace { ASSERT_FALSE( pq.empty() ); nSize = pq.size(); - while ( pq.size() > 1 ) { + while ( pq.size() > 1u ) { p = pq.pop(); ASSERT_TRUE( p != nullptr ); EXPECT_EQ( p->k, nPrev - 1 ); @@ -105,7 +105,7 @@ namespace { ASSERT_FALSE( pq.full() ); ASSERT_FALSE( pq.empty() ); - ASSERT_EQ( pq.size(), 1 ); + ASSERT_EQ( pq.size(), 1u ); p = pq.pop(); ASSERT_TRUE( p != nullptr ); @@ -113,7 +113,7 @@ namespace { ASSERT_FALSE( pq.full() ); ASSERT_TRUE( pq.empty() ); - ASSERT_EQ( pq.size(), 0 ); + ASSERT_EQ( pq.size(), 0u ); // Clear test for ( value_type * p = pFirst; p < pLast; ++p ) { @@ -125,7 +125,7 @@ namespace { pq.clear(); EXPECT_TRUE( pq.empty() ); EXPECT_FALSE( pq.full() ); - EXPECT_EQ( pq.size(), 0 ); + EXPECT_EQ( pq.size(), 0u ); // clear_with test for ( value_type * p = pFirst; p < pLast; ++p ) { @@ -140,7 +140,7 @@ namespace { pq.clear_with( std::ref( disp ) ); ASSERT_TRUE( pq.empty() ); ASSERT_FALSE( pq.full() ); - ASSERT_EQ( pq.size(), 0 ); + ASSERT_EQ( pq.size(), 0u ); ASSERT_EQ( disp.m_nCallCount, pq.capacity() ); } } diff --git a/test/unit/queue/fcqueue.cpp b/test/unit/queue/fcqueue.cpp index 4499db33..c2fb187d 100644 --- a/test/unit/queue/fcqueue.cpp +++ b/test/unit/queue/fcqueue.cpp @@ -77,7 +77,7 @@ namespace { for ( size_t i = 0; i < nSize; ++i ) { it = -1; ASSERT_TRUE( q.pop( it ) ); - ASSERT_EQ( it, i ); + ASSERT_EQ( it, static_cast( i )); ASSERT_EQ( q.size(), nSize - i - 1 ); } ASSERT_TRUE( q.empty() ); diff --git a/test/unit/queue/test_generic_queue.h b/test/unit/queue/test_generic_queue.h index d274cdf1..295040ac 100644 --- a/test/unit/queue/test_generic_queue.h +++ b/test/unit/queue/test_generic_queue.h @@ -132,7 +132,7 @@ namespace cds_test { ASSERT_CONTAINER_SIZE( q, 0 ); 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, 0 ); } diff --git a/test/unit/set/test_feldman_hashset.h b/test/unit/set/test_feldman_hashset.h index 1ee5bbf1..deff2f73 100644 --- a/test/unit/set/test_feldman_hashset.h +++ b/test/unit/set/test_feldman_hashset.h @@ -260,7 +260,7 @@ namespace cds_test { ASSERT_FALSE( s.insert( i, []( value_type& v ) { ++v.nFindCount; } )); ASSERT_TRUE( s.find( i.nKey, []( value_type const& v ) { - EXPECT_EQ( v.nFindCount, 1 ); + EXPECT_EQ( v.nFindCount, 1u ); })); break; case 3: @@ -268,7 +268,7 @@ namespace cds_test { ASSERT_FALSE( s.insert( i.key(), []( value_type& v ) { ++v.nFindCount; } )); ASSERT_TRUE( s.find( i.nKey, []( value_type const& v ) { - EXPECT_EQ( v.nFindCount, 1 ); + EXPECT_EQ( v.nFindCount, 1u ); })); break; case 4: @@ -283,7 +283,7 @@ namespace cds_test { updResult = s.update( i, []( value_type& v, value_type * prev ) { ASSERT_TRUE( prev != nullptr ); - EXPECT_EQ( prev->nUpdateNewCount, 1 ); + EXPECT_EQ( prev->nUpdateNewCount, 1u ); EXPECT_EQ( v.key(), prev->key() ); ++v.nUpdateCount; }, false ); @@ -292,8 +292,8 @@ namespace cds_test { ASSERT_TRUE( s.find( i.nKey, []( value_type const& v ) { - EXPECT_EQ( v.nUpdateCount, 1 ); - EXPECT_EQ( v.nUpdateNewCount, 0 ); + EXPECT_EQ( v.nUpdateCount, 1u ); + EXPECT_EQ( v.nUpdateNewCount, 0u ); })); break; case 5: @@ -309,8 +309,8 @@ namespace cds_test { { ASSERT_TRUE( prev != nullptr ); EXPECT_EQ( v.key(), prev->key() ); - EXPECT_EQ( prev->nUpdateNewCount, 1 ); - EXPECT_EQ( v.nUpdateNewCount, 0 ); + EXPECT_EQ( prev->nUpdateNewCount, 1u ); + EXPECT_EQ( v.nUpdateNewCount, 0u ); ++v.nUpdateNewCount; }, false ); EXPECT_TRUE( updResult.first ); @@ -318,7 +318,7 @@ namespace cds_test { ASSERT_TRUE( s.find( i.key(), []( value_type const& v ) { - EXPECT_EQ( v.nUpdateNewCount, 1 ); + EXPECT_EQ( v.nUpdateNewCount, 1u ); } ) ); break; case 6: @@ -366,7 +366,7 @@ namespace cds_test { case 1: ASSERT_TRUE( s.erase( i.key(), [&nKey]( value_type const& v ) { - EXPECT_EQ( v.nFindCount, 1 ); + EXPECT_EQ( v.nFindCount, 1u ); nKey = v.key(); } ) ); EXPECT_EQ( i.key(), nKey ); @@ -384,7 +384,7 @@ namespace cds_test { ASSERT_FALSE( s.find( i.nKey, []( value_type const& ) {} ) ); } ASSERT_TRUE( s.empty() ); - ASSERT_CONTAINER_SIZE( s, 0 ); + ASSERT_CONTAINER_SIZE( s, 0u ); // clear @@ -410,7 +410,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() );