Переглянути джерело

Remove the warnings with Xcode 8.0 beta 2

tokorom 9 роки тому
батько
коміт
787f30d9f8
1 змінених файлів з 3 додано та 3 видалено
  1. 3 3
      Sources/String+MD5.swift

+ 3 - 3
Sources/String+MD5.swift

@@ -48,7 +48,7 @@ func arrayOfBytes<T>(_ value: T, length: Int? = nil) -> [UInt8] {
     
     
     let bytesPointer = UnsafeMutablePointer<UInt8>(valuePointer)
     let bytesPointer = UnsafeMutablePointer<UInt8>(valuePointer)
     var bytes = [UInt8](repeating: 0, count: totalBytes)
     var bytes = [UInt8](repeating: 0, count: totalBytes)
-    for j in 0..<min(sizeof(T), totalBytes) {
+    for j in 0..<min(sizeof(T.self), totalBytes) {
         bytes[totalBytes - 1 - j] = (bytesPointer + j).pointee
         bytes[totalBytes - 1 - j] = (bytesPointer + j).pointee
     }
     }
     
     
@@ -60,7 +60,7 @@ func arrayOfBytes<T>(_ value: T, length: Int? = nil) -> [UInt8] {
 
 
 extension Int {
 extension Int {
     /** Array of bytes with optional padding (little-endian) */
     /** Array of bytes with optional padding (little-endian) */
-    func bytes(_ totalBytes: Int = sizeof(Int)) -> [UInt8] {
+    func bytes(_ totalBytes: Int = sizeof(Int.self)) -> [UInt8] {
         return arrayOfBytes(self, length: totalBytes)
         return arrayOfBytes(self, length: totalBytes)
     }
     }
     
     
@@ -108,7 +108,7 @@ func toUInt32Array(_ slice: ArraySlice<UInt8>) -> Array<UInt32> {
     var result = Array<UInt32>()
     var result = Array<UInt32>()
     result.reserveCapacity(16)
     result.reserveCapacity(16)
     
     
-    for idx in stride(from: slice.startIndex, to: slice.endIndex, by: sizeof(UInt32)) {
+    for idx in stride(from: slice.startIndex, to: slice.endIndex, by: sizeof(UInt32.self)) {
         let d0 = UInt32(slice[idx.advanced(by: 3)]) << 24
         let d0 = UInt32(slice[idx.advanced(by: 3)]) << 24
         let d1 = UInt32(slice[idx.advanced(by: 2)]) << 16
         let d1 = UInt32(slice[idx.advanced(by: 2)]) << 16
         let d2 = UInt32(slice[idx.advanced(by: 1)]) << 8
         let d2 = UInt32(slice[idx.advanced(by: 1)]) << 8