Adds a few single-threaded test cases for queue, stack, and set
[libcds.git] / cds / details / bitop_generic.h
index 38a1dd49e37a0909dca1f75e1c2dea80d1ab1933..a3cac9b604eef6ff5ef69f4d0bbd36b1f87dec44 100644 (file)
@@ -1,11 +1,11 @@
 /*
     This file is a part of libcds - Concurrent Data Structures library
 
-    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
+    (C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2017
 
     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 CDSLIB_DETAILS_BITOP_GENERIC_H
@@ -81,7 +81,7 @@ namespace cds {
                 r -= 2;
             }
             if (!(x & 0x80000000u)) {
-                x <<= 1;
+                //x <<= 1;
                 r -= 1;
             }
             return r;
@@ -143,7 +143,7 @@ namespace cds {
                 r += 2;
             }
             if (!(x & 1)) {
-                x >>= 1;
+                //x >>= 1;
                 r += 1;
             }
             return r;
@@ -164,7 +164,7 @@ namespace cds {
                 return 0;
             if ( x & 0xffffffffu )
                 return lsb32( (uint32_t) x );
-            return lsb32( (uint32_t) (x >> 32) ) + 32;
+            return lsb32( (uint32_t) (x >> 32)) + 32;
         }
 #endif
 
@@ -198,7 +198,7 @@ namespace cds {
         static inline uint64_t rbo64( uint64_t x )
         {
             //                      Low 32bit                                          Hight 32bit
-            return ( static_cast<uint64_t>(rbo32( (uint32_t) x )) << 32 ) | ( static_cast<uint64_t>( rbo32( (uint32_t) (x >> 32) )));
+            return ( static_cast<uint64_t>(rbo32( (uint32_t) x )) << 32 ) | ( static_cast<uint64_t>( rbo32( (uint32_t) (x >> 32))));
         }
 #endif
 
@@ -225,7 +225,7 @@ namespace cds {
 #        ifdef cds_beans_zbc64_DEFINED
             return 64 - zbc64( x );
 #        else
-            return sbc32( (uint32_t) (x >> 32) ) + sbc32( (uint32_t) x );
+            return sbc32( (uint32_t) (x >> 32)) + sbc32( (uint32_t) x );
 #        endif
         }
 #endif