Fixed minor gcc warnings
authorkhizmax <libcds.dev@gmail.com>
Mon, 26 Sep 2016 19:52:11 +0000 (22:52 +0300)
committerkhizmax <libcds.dev@gmail.com>
Mon, 26 Sep 2016 19:52:11 +0000 (22:52 +0300)
projects/Win/vc14/gtest-stack.vcxproj.filters
test/unit/intrusive-set/test_intrusive_feldman_hashset.h
test/unit/misc/cxx11_atomic_class.cpp
test/unit/misc/cxx11_atomic_func.cpp
test/unit/misc/split_bitstring.cpp
test/unit/pqueue/intrusive_mspqueue.cpp
test/unit/queue/fcqueue.cpp
test/unit/queue/test_generic_queue.h
test/unit/set/test_feldman_hashset.h

index 86b7995..f06141d 100644 (file)
@@ -9,10 +9,6 @@
       <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
       <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
     </Filter>\r
-    <Filter Include="Resource Files">\r
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>\r
-    </Filter>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClCompile Include="..\..\..\test\unit\stack\fcstack.cpp">\r
index bbcf320..d2c9213 100644 (file)
@@ -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 );
             }
index cb9aaca..54f9ddc 100644 (file)
@@ -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 ), );
+            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 )
index fe26e56..c93e958 100644 (file)
@@ -83,8 +83,8 @@ namespace misc {
 
             EXPECT_TRUE( atomics::atomic_is_lock_free( &a ) );
             atomics::atomic_store( &a, (integral_type) 0 );
-            EXPECT_EQ( a, );
-            EXPECT_EQ( atomics::atomic_load( &a ), );
+            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 ), );
+            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 )
index d5d58f0..2f40bfd 100644 (file)
@@ -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 );
 
index c5e29c0..20d7aca 100644 (file)
@@ -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() );
             }
         }
index 4499db3..c2fb187 100644 (file)
@@ -77,7 +77,7 @@ namespace {
             for ( size_t i = 0; i < nSize; ++i ) {
                 it = -1;
                 ASSERT_TRUE( q.pop( it ) );
-                ASSERT_EQ( it, );
+                ASSERT_EQ( it, static_cast<value_type>( i ));
                 ASSERT_EQ( q.size(), nSize - i - 1 );
             }
             ASSERT_TRUE( q.empty() );
index d274cdf..295040a 100644 (file)
@@ -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<value_type>( nSize * 2 ));
             ASSERT_TRUE( q.empty() );
             ASSERT_CONTAINER_SIZE( q, 0 );
         }
index 1ee5bbf..deff2f7 100644 (file)
@@ -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() );