File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ public func scatter<T>(_ a: [T], _ idx: [Int]) -> [T] {
73
73
}
74
74
75
75
public func withArrayOfCStrings< R> (
76
- _ args: [ String ] , _ body: ( [ UnsafePointer < CChar > ? ] ) -> R
76
+ _ args: [ String ] , _ body: ( [ UnsafeMutablePointer < CChar > ? ] ) -> R
77
77
) -> R {
78
78
79
79
let argsCounts = Array ( args. map { $0. utf8. count + 1 } )
@@ -87,10 +87,10 @@ public func withArrayOfCStrings<R>(
87
87
argsBuffer. append ( 0 )
88
88
}
89
89
90
- return argsBuffer. withUnsafeBufferPointer {
90
+ return argsBuffer. withUnsafeMutableBufferPointer {
91
91
( argsBuffer) in
92
- let ptr = UnsafePointer < CChar > ( argsBuffer. baseAddress!)
93
- var cStrings : [ UnsafePointer < CChar > ? ] = argsOffsets. map { ptr + $0 }
92
+ let ptr = UnsafeMutablePointer < CChar > ( argsBuffer. baseAddress!)
93
+ var cStrings : [ UnsafeMutablePointer < CChar > ? ] = argsOffsets. map { ptr + $0 }
94
94
cStrings [ cStrings. count - 1 ] = nil
95
95
return body ( cStrings)
96
96
}
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ func swift_posix_spawn(
55
55
_ file: UnsafePointer < Int8 > ,
56
56
_ file_actions: UnsafePointer < swift_posix_spawn_file_actions_t > ? ,
57
57
_ attrp: UnsafePointer < posix_spawnattr_t > ? ,
58
- _ argv: UnsafePointer < UnsafePointer < Int8 > ? > ,
58
+ _ argv: UnsafePointer < UnsafeMutablePointer < Int8 > ? > ,
59
59
_ envp: UnsafePointer < UnsafeMutablePointer < Int8 > ? > ? ) -> CInt
60
60
61
61
/// Calls POSIX `pipe()`.
You can’t perform that action at this time.
0 commit comments