-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning ⚠️ in Xcode 10.2.1 Swift 5.0.1 #54
Comments
This may fix with #51 |
No, the warnings are still popping up. The code needs to be refactored for Swift 5. Here's a an example: fileprivate func withUnsafePointers<A0, A1, Result>(
_ arg0: Data,
_ arg1: inout Data,
_ body: (
UnsafePointer<A0>,
UnsafeMutablePointer<A1>) throws -> Result
) rethrows -> Result {
return try arg0.withUnsafeBytes { p0 in
let b0: UnsafePointer<A0> = p0.baseAddress!.assumingMemoryBound(to: A0.self)
return try arg1.withUnsafeMutableBytes { p1 in
let b1: UnsafeMutablePointer<A1> = p1.baseAddress!.assumingMemoryBound(to: A1.self)
return try body(b0, b1)
}
}
} Basically you need to add another variable inside the call to parse either like Another example: public static func generateRandom(_ size: Int) -> Data {
var data = Data(count: size)
data.withUnsafeMutableBytes { dataBytes in
let b0: UnsafeMutablePointer<UInt8> = dataBytes.baseAddress!.assumingMemoryBound(to: UInt8.self)
_ = CCRandomGenerateBytes!(b0, size)
}
return data
} You can read more about here Full refactored file for v5.1.3 attached below. Cheers, |
Thank you @skito |
There are about 38 warning in
SwCrypt.swift
file.The text was updated successfully, but these errors were encountered: