Adopted Span and MutableSpan for buffers across the library to adapt to Swift 6.4.
This commit is contained in:
@@ -307,8 +307,12 @@ extension System {
|
||||
/// Sends data over the mirror connection. Returns `false` if mirroring is
|
||||
/// not active or the send fails.
|
||||
@discardableResult
|
||||
public static func sendMirrorData(command: UInt8, data: UnsafeMutableRawBufferPointer) -> Bool {
|
||||
api.pointee.sendMirrorData.unsafelyUnwrapped(command, data.baseAddress, Int32(data.count))
|
||||
public static func sendMirrorData(command: UInt8, data: Span<UInt8>) -> Bool {
|
||||
data.withUnsafeBufferPointer { buffer in
|
||||
// The C API takes a non-const pointer but only reads the data.
|
||||
api.pointee.sendMirrorData.unsafelyUnwrapped(
|
||||
command, UnsafeMutableRawPointer(mutating: buffer.baseAddress), Int32(buffer.count))
|
||||
}
|
||||
}
|
||||
|
||||
/// OS, language, and pdx version information.
|
||||
|
||||
Reference in New Issue
Block a user