     @_transparent
     public mutating func compareSet(oldVal: UInt32, _ newVal: UInt32) -> Bool {
         @inline(__always)
-        func cas(oldVal: Int32, _ newVal: Int32, _ theVal: UnsafeMutablePointer<UInt32>) -> Bool {
-            return OSAtomicCompareAndSwap32Barrier(oldVal, newVal, UnsafeMutablePointer(theVal))
-        }
-        return cas(Int32(bitPattern: oldVal), Int32(bitPattern: newVal), &self)
+        func cas(theVal: UnsafeMutablePointer<UInt32>) -> Bool {
+            return OSAtomicCompareAndSwap32Barrier(Int32(bitPattern: oldVal), Int32(bitPattern: newVal), UnsafeMutablePointer(theVal))
+        }
+        return cas(&self)
     }
 }
 

    @_transparent
    public mutating func compareSet(oldVal: UInt, _ newVal: UInt) -> Bool {
        @inline(__always)
        func cas(oldVal: Int, _ newVal: Int, _ theVal: UnsafeMutablePointer<UInt>) -> Bool {
            return OSAtomicCompareAndSwapLongBarrier(oldVal, newVal, UnsafeMutablePointer(theVal))
        }
        return cas(Int(bitPattern: oldVal), Int(bitPattern: newVal), &self)
    }
}


    @_transparent
    public mutating func compareSet(oldVal: UnsafeMutablePointer, _ newVal: UnsafeMutablePointer) -> Bool {
        @inline(__always)
        func cas(theVal: UnsafeMutablePointer<UnsafeMutablePointer<Memory>>) -> Bool {
            return OSAtomicCompareAndSwapPtrBarrier(oldVal, newVal, UnsafeMutablePointer<UnsafeMutablePointer<Void>>(theVal))
        }
        return cas(&self)
    }
}

