Removed redundant spaces
[libcds.git] / test / stress / set / delodd / set_delodd.h
index e07090f70afd042c2dd05ee9ecbb4cbe8aed41cb..4c98268e0b7e6c96760e5f500bd4440875feaa96 100644 (file)
@@ -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 "set_type.h"
@@ -45,6 +45,9 @@ namespace set {
         {}
 
         key_thread()
+            : nKey()
+            , nThread()
+            , pad_( 0 )
         {}
     };
 
@@ -103,6 +106,7 @@ namespace set {
         {
             return std::hash<size_t>()(k.nKey);
         }
+
         size_t operator()( size_t k ) const
         {
             return std::hash<size_t>()(k);
@@ -156,10 +160,10 @@ namespace set {
             struct update_functor
             {
                 template <typename Q>
-                void operator()( bool /*bNew*/, key_value_pair const&, Q const& )
+                void operator()( bool /*bNew*/, key_value_pair const&, Q const& ) const
                 {}
 
-                void operator()(key_value_pair& /*cur*/, key_value_pair * /*prev*/)
+                void operator()(key_value_pair& /*cur*/, key_value_pair * /*prev*/) const
                 {}
             };
         public:
@@ -189,7 +193,7 @@ namespace set {
 
                 std::vector<size_t>& arrData = fixture.m_arrData;
                 for ( size_t i = 0; i < arrData.size(); ++i ) {
-                    if ( rSet.insert( key_type( arrData[i], id() )))
+                    if ( rSet.insert( key_type( arrData[i], id())))
                         ++m_nInsertSuccess;
                     else
                         ++m_nInsertFailed;
@@ -198,7 +202,7 @@ namespace set {
                 update_functor f;
                 for ( size_t i = arrData.size() - 1; i > 0; --i ) {
                     if ( arrData[i] & 1 )
-                        rSet.update( key_type( arrData[i], id() ), f, true );
+                        rSet.update( key_type( arrData[i], id()), f, true );
                 }
 
                 fixture.m_nInsThreadCount.fetch_sub( 1, atomics::memory_order_release );
@@ -307,7 +311,7 @@ namespace set {
             struct eraser {
                 static bool erase( SetType& s, size_t key, size_t /*thread*/)
                 {
-                    return s.erase_with( key, key_less() );
+                    return s.erase_with( key, key_less());
                 }
             };
 
@@ -595,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 )
@@ -637,7 +641,7 @@ namespace set {
             size_t nExtractFailed = 0;
             for ( size_t i = 0; i < pool.size(); ++i ) {
                 cds_test::thread& thr = pool.get( i );
-                switch ( thr.type() ) {
+                switch ( thr.type()) {
                 case inserter_thread:
                     {
                         insert_thread& inserter = static_cast<insert_thread&>( thr );
@@ -665,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 )
@@ -691,7 +695,7 @@ namespace set {
             check_before_clear( testSet );
 
             testSet.clear();
-            EXPECT_TRUE( testSet.empty() ) << "set.size=" << testSet.size();
+            EXPECT_TRUE( testSet.empty()) << "set.size=" << testSet.size();
 
             additional_check( testSet );
             print_stat( propout(), testSet );