Skip to content

Commit dd7f982

Browse files
committed
[SE-0127] Add "to:" argument label to withUnsafe[Mutable]Pointer.
rdar://problem/26529498
1 parent 14427c0 commit dd7f982

23 files changed

+76
-76
lines changed

Diff for: Foundation/DateInterval.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public struct DateInterval : ReferenceConvertible, Comparable, Hashable {
155155

156156
public var hashValue: Int {
157157
var buf: (UInt, UInt) = (UInt(start.timeIntervalSinceReferenceDate), UInt(end.timeIntervalSinceReferenceDate))
158-
return withUnsafeMutablePointer(&buf) {
158+
return withUnsafeMutablePointer(to: &buf) {
159159
return Int(bitPattern: CFHashBytes(unsafeBitCast($0, to: UnsafeMutablePointer<UInt8>.self), CFIndex(sizeof(UInt.self) * 2)))
160160
}
161161
}

Diff for: Foundation/NSArray.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NS
6969
// We're stuck with (int) here (rather than unsigned int)
7070
// because that's the way the code was originally written, unless
7171
// we go to a new version of the class, which has its own problems.
72-
withUnsafeMutablePointer(&cnt) { (ptr: UnsafeMutablePointer<UInt32>) -> Void in
72+
withUnsafeMutablePointer(to: &cnt) { (ptr: UnsafeMutablePointer<UInt32>) -> Void in
7373
aDecoder.decodeValue(ofObjCType: "i", at: UnsafeMutableRawPointer(ptr))
7474
}
7575
let objects = UnsafeMutablePointer<AnyObject?>.allocate(capacity: Int(cnt))

Diff for: Foundation/NSAttributedString.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private extension AttributedString {
119119

120120
func _attributesAtIndex(_ location: Int, rangeInfo: RangeInfo) -> [String : AnyObject] {
121121
var cfRange = CFRange()
122-
return withUnsafeMutablePointer(&cfRange) { (cfRangePointer: UnsafeMutablePointer<CFRange>) -> [String : AnyObject] in
122+
return withUnsafeMutablePointer(to: &cfRange) { (cfRangePointer: UnsafeMutablePointer<CFRange>) -> [String : AnyObject] in
123123
// Get attributes value using CoreFoundation function
124124
let value: CFDictionary
125125
if rangeInfo.shouldFetchLongestEffectiveRange, let searchRange = rangeInfo.longestEffectiveRangeSearchRange {
@@ -149,7 +149,7 @@ private extension AttributedString {
149149

150150
func _attribute(_ attrName: String, atIndex location: Int, rangeInfo: RangeInfo) -> AnyObject? {
151151
var cfRange = CFRange()
152-
return withUnsafeMutablePointer(&cfRange) { (cfRangePointer: UnsafeMutablePointer<CFRange>) -> AnyObject? in
152+
return withUnsafeMutablePointer(to: &cfRange) { (cfRangePointer: UnsafeMutablePointer<CFRange>) -> AnyObject? in
153153
// Get attribute value using CoreFoundation function
154154
let attribute: AnyObject?
155155
if rangeInfo.shouldFetchLongestEffectiveRange, let searchRange = rangeInfo.longestEffectiveRangeSearchRange {

Diff for: Foundation/NSBundle.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class Bundle: NSObject {
7878

7979
public func preflight() throws {
8080
var unmanagedError:Unmanaged<CFError>? = nil
81-
try withUnsafeMutablePointer(&unmanagedError) { (unmanagedCFError: UnsafeMutablePointer<Unmanaged<CFError>?>) in
81+
try withUnsafeMutablePointer(to: &unmanagedError) { (unmanagedCFError: UnsafeMutablePointer<Unmanaged<CFError>?>) in
8282
CFBundlePreflightExecutable(_bundle, unmanagedCFError)
8383
if let error = unmanagedCFError.pointee {
8484
throw error.takeRetainedValue()._nsObject
@@ -88,7 +88,7 @@ public class Bundle: NSObject {
8888

8989
public func loadAndReturnError() throws {
9090
var unmanagedError:Unmanaged<CFError>? = nil
91-
try withUnsafeMutablePointer(&unmanagedError) { (unmanagedCFError: UnsafeMutablePointer<Unmanaged<CFError>?>) in
91+
try withUnsafeMutablePointer(to: &unmanagedError) { (unmanagedCFError: UnsafeMutablePointer<Unmanaged<CFError>?>) in
9292
CFBundleLoadExecutableAndReturnError(_bundle, unmanagedCFError)
9393
if let error = unmanagedCFError.pointee {
9494
let retainedValue = error.takeRetainedValue()

Diff for: Foundation/NSCalendar.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ public class Calendar: NSObject, NSCopying, NSSecureCoding {
394394
public func range(of unit: Unit, forDate date: Date) -> DateInterval? {
395395
var start: CFAbsoluteTime = 0.0
396396
var ti: CFTimeInterval = 0.0
397-
let res: Bool = withUnsafeMutablePointer(&start) { startp in
398-
withUnsafeMutablePointer(&ti) { tip in
397+
let res: Bool = withUnsafeMutablePointer(to: &start) { startp in
398+
withUnsafeMutablePointer(to: &ti) { tip in
399399
return CFCalendarGetTimeRangeOfUnit(_cfObject, unit._cfValue, date.timeIntervalSinceReferenceDate, startp, tip)
400400
}
401401
}
@@ -452,7 +452,7 @@ public class Calendar: NSObject, NSCopying, NSSecureCoding {
452452
self.timeZone = comps.timeZone ?? timeZone
453453

454454
var at: CFAbsoluteTime = 0.0
455-
let res: Bool = withUnsafeMutablePointer(&at) { t in
455+
let res: Bool = withUnsafeMutablePointer(to: &at) { t in
456456
return vector.withUnsafeMutableBufferPointer { (vectorBuffer: inout UnsafeMutableBufferPointer<Int32>) in
457457
return _CFCalendarComposeAbsoluteTimeV(_cfObject, t, compDesc, vectorBuffer.baseAddress!, Int32(vectorBuffer.count))
458458
}
@@ -556,7 +556,7 @@ public class Calendar: NSObject, NSCopying, NSSecureCoding {
556556
var (vector, compDesc) = _convert(comps)
557557
var at: CFAbsoluteTime = 0.0
558558

559-
let res: Bool = withUnsafeMutablePointer(&at) { t in
559+
let res: Bool = withUnsafeMutablePointer(to: &at) { t in
560560
return vector.withUnsafeMutableBufferPointer { (vectorBuffer: inout UnsafeMutableBufferPointer<Int32>) in
561561
return _CFCalendarAddComponentsV(_cfObject, t, CFOptionFlags(opts.rawValue), compDesc, vectorBuffer.baseAddress!, Int32(vector.count))
562562
}
@@ -942,7 +942,7 @@ public class Calendar: NSObject, NSCopying, NSSecureCoding {
942942
/// - Note: Since this API is under consideration it may be either removed or revised in the near future
943943
public func nextWeekendAfter(_ date: Date, options: Options) -> DateInterval? {
944944
var range = _CFCalendarWeekendRange()
945-
let res = withUnsafeMutablePointer(&range) { rangep in
945+
let res = withUnsafeMutablePointer(to: &range) { rangep in
946946
return _CFCalendarGetNextWeekend(_cfObject, rangep)
947947
}
948948
if res {

Diff for: Foundation/NSCoder.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class NSCoder : NSObject {
9999

100100
public func encode(_ object: AnyObject?) {
101101
var object = object
102-
withUnsafePointer(&object) { (ptr: UnsafePointer<AnyObject?>) -> Void in
102+
withUnsafePointer(to: &object) { (ptr: UnsafePointer<AnyObject?>) -> Void in
103103
encodeValue(ofObjCType: "@", at: unsafeBitCast(ptr, to: UnsafeRawPointer.self))
104104
}
105105
}
@@ -126,11 +126,11 @@ public class NSCoder : NSObject {
126126

127127
public func encodeBytes(_ byteaddr: UnsafeRawPointer?, length: Int) {
128128
var newLength = UInt32(length)
129-
withUnsafePointer(&newLength) { (ptr: UnsafePointer<UInt32>) -> Void in
129+
withUnsafePointer(to: &newLength) { (ptr: UnsafePointer<UInt32>) -> Void in
130130
encodeValue(ofObjCType: "I", at: ptr)
131131
}
132132
var empty: [Int8] = []
133-
withUnsafePointer(&empty) {
133+
withUnsafePointer(to: &empty) {
134134
encodeArray(ofObjCType: "c", count: length, at: byteaddr ?? UnsafeRawPointer($0))
135135
}
136136
}
@@ -141,7 +141,7 @@ public class NSCoder : NSObject {
141141
}
142142

143143
var obj: AnyObject? = nil
144-
withUnsafeMutablePointer(&obj) { (ptr: UnsafeMutablePointer<AnyObject?>) -> Void in
144+
withUnsafeMutablePointer(to: &obj) { (ptr: UnsafeMutablePointer<AnyObject?>) -> Void in
145145
decodeValue(ofObjCType: "@", at: unsafeBitCast(ptr, to: UnsafeMutableRawPointer.self))
146146
}
147147
return obj
@@ -155,7 +155,7 @@ public class NSCoder : NSObject {
155155
// TODO: This is disabled, as functions which return unsafe interior pointers are inherently unsafe when we have no autorelease pool.
156156
public func decodeBytes(withReturnedLength lengthp: UnsafeMutablePointer<Int>) -> UnsafeMutableRawPointer? {
157157
var length: UInt32 = 0
158-
withUnsafeMutablePointer(&length) { (ptr: UnsafeMutablePointer<UInt32>) -> Void in
158+
withUnsafeMutablePointer(to: &length) { (ptr: UnsafeMutablePointer<UInt32>) -> Void in
159159
decodeValue(ofObjCType: "I", at: unsafeBitCast(ptr, to: UnsafeMutableRawPointer.self))
160160
}
161161
// we cannot autorelease here so instead the pending buffers will manage the lifespan of the returned data... this is wasteful but good enough...

Diff for: Foundation/NSData.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ extension NSData {
270270
}
271271

272272
var info = stat()
273-
let ret = withUnsafeMutablePointer(&info) { infoPointer -> Bool in
273+
let ret = withUnsafeMutablePointer(to: &info) { infoPointer -> Bool in
274274
if fstat(fd, infoPointer) < 0 {
275275
return false
276276
}
@@ -574,7 +574,7 @@ extension NSData {
574574

575575
public func enumerateBytes(_ block: @noescape (UnsafeRawPointer, NSRange, UnsafeMutablePointer<Bool>) -> Void) {
576576
var stop = false
577-
withUnsafeMutablePointer(&stop) { stopPointer in
577+
withUnsafeMutablePointer(to: &stop) { stopPointer in
578578
block(bytes, NSMakeRange(0, length), stopPointer)
579579
}
580580
}

Diff for: Foundation/NSDate.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class NSDate : NSObject, NSCopying, NSSecureCoding, NSCoding {
5353

5454
public convenience override init() {
5555
var tv = timeval()
56-
let _ = withUnsafeMutablePointer(&tv) { t in
56+
let _ = withUnsafeMutablePointer(to: &tv) { t in
5757
gettimeofday(t, nil)
5858
}
5959
var timestamp = TimeInterval(tv.tv_sec) - NSTimeIntervalSince1970
@@ -71,7 +71,7 @@ public class NSDate : NSObject, NSCopying, NSSecureCoding, NSCoding {
7171
self.init(timeIntervalSinceReferenceDate: ti)
7272
} else {
7373
var ti: TimeInterval = 0.0
74-
withUnsafeMutablePointer(&ti) { (ptr: UnsafeMutablePointer<Double>) -> Void in
74+
withUnsafeMutablePointer(to: &ti) { (ptr: UnsafeMutablePointer<Double>) -> Void in
7575
aDecoder.decodeValue(ofObjCType: "d", at: UnsafeMutableRawPointer(ptr))
7676
}
7777
self.init(timeIntervalSinceReferenceDate: ti)

Diff for: Foundation/NSDateFormatter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public class DateFormatter : Formatter {
5656

5757
public func date(from string: String) -> Date? {
5858
var range = CFRange(location: 0, length: string.length)
59-
let date = withUnsafeMutablePointer(&range) { (rangep: UnsafeMutablePointer<CFRange>) -> Date? in
59+
let date = withUnsafeMutablePointer(to: &range) { (rangep: UnsafeMutablePointer<CFRange>) -> Date? in
6060
guard let res = CFDateFormatterCreateDateFromString(kCFAllocatorSystemDefault, _cfObject, string._cfObject, rangep) else {
6161
return nil
6262
}

Diff for: Foundation/NSDictionary.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public class NSDictionary : NSObject, NSCopying, NSMutableCopying, NSSecureCodin
125125
// We're stuck with (int) here (rather than unsigned int)
126126
// because that's the way the code was originally written, unless
127127
// we go to a new version of the class, which has its own problems.
128-
withUnsafeMutablePointer(&cnt) { (ptr: UnsafeMutablePointer<UInt32>) -> Void in
128+
withUnsafeMutablePointer(to: &cnt) { (ptr: UnsafeMutablePointer<UInt32>) -> Void in
129129
aDecoder.decodeValue(ofObjCType: "i", at: UnsafeMutableRawPointer(ptr))
130130
}
131131
let keys = UnsafeMutablePointer<NSObject>.allocate(capacity: Int(cnt))
@@ -486,7 +486,7 @@ public class NSDictionary : NSObject, NSCopying, NSMutableCopying, NSSecureCodin
486486
getObjects(&objects, andKeys: &keys, count: count)
487487
var stop = ObjCBool(false)
488488
for idx in 0..<count {
489-
withUnsafeMutablePointer(&stop, { stop in
489+
withUnsafeMutablePointer(to: &stop, { stop in
490490
block(keys[idx] as! NSObject, objects[idx], stop)
491491
})
492492

Diff for: Foundation/NSFileManager.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public class FileManager: NSObject {
252252
}
253253

254254
while let entry = readdir(dir!) {
255-
if let entryName = withUnsafePointer(&entry.pointee.d_name, { (ptr) -> String? in
255+
if let entryName = withUnsafePointer(to: &entry.pointee.d_name, { (ptr) -> String? in
256256
return String(cString: UnsafePointer<Int8>(ptr))
257257
}) {
258258
// TODO: `entryName` should be limited in length to `entry.memory.d_namlen`.
@@ -294,15 +294,15 @@ public class FileManager: NSObject {
294294
var entry = readdir(dir!)
295295

296296
while entry != nil {
297-
if let entryName = withUnsafePointer(&entry!.pointee.d_name, { (ptr) -> String? in
297+
if let entryName = withUnsafePointer(to: &entry!.pointee.d_name, { (ptr) -> String? in
298298
let int8Ptr = unsafeBitCast(ptr, to: UnsafePointer<Int8>.self)
299299
return String(cString: int8Ptr)
300300
}) {
301301
// TODO: `entryName` should be limited in length to `entry.memory.d_namlen`.
302302
if entryName != "." && entryName != ".." {
303303
contents.append(entryName)
304304

305-
if let entryType = withUnsafePointer(&entry!.pointee.d_type, { (ptr) -> Int32? in
305+
if let entryType = withUnsafePointer(to: &entry!.pointee.d_type, { (ptr) -> Int32? in
306306
let int32Ptr = unsafeBitCast(ptr, to: UnsafePointer<UInt8>.self)
307307
return Int32(int32Ptr.pointee)
308308
}) {

Diff for: Foundation/NSKeyedCoderOldStyleArray.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ internal final class _NSKeyedCoderOldStyleArray : NSObject, NSCopying, NSSecureC
6868
for idx in 0..<self._count {
6969
var type = Int8(self._type)
7070

71-
withUnsafePointer(&type) { typep in
71+
withUnsafePointer(to: &type) { typep in
7272
let addr = self._addr.advanced(by: idx * self._size)
7373
aDecoder.decodeValue(ofObjCType: typep, at: addr)
7474
}
@@ -83,7 +83,7 @@ internal final class _NSKeyedCoderOldStyleArray : NSObject, NSCopying, NSSecureC
8383
for idx in 0..<self._count {
8484
var type = Int8(self._type)
8585

86-
withUnsafePointer(&type) { typep in
86+
withUnsafePointer(to: &type) { typep in
8787
aCoder.encodeValue(ofObjCType: typep, at: self._addr + (idx * self._size))
8888
}
8989
}

Diff for: Foundation/NSLock.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public class RecursiveLock: NSObject, Locking {
141141
public override init() {
142142
super.init()
143143
var attrib = pthread_mutexattr_t()
144-
withUnsafeMutablePointer(&attrib) { attrs in
144+
withUnsafeMutablePointer(to: &attrib) { attrs in
145145
pthread_mutexattr_settype(attrs, Int32(PTHREAD_MUTEX_RECURSIVE))
146146
pthread_mutex_init(mutex, attrs)
147147
}
@@ -208,12 +208,12 @@ public class Condition: NSObject, Locking {
208208
ts.tv_sec = Int(floor(ti))
209209
ts.tv_nsec = Int((ti - Double(ts.tv_sec)) * 1000000000.0)
210210
var tv = timeval()
211-
withUnsafeMutablePointer(&tv) { t in
211+
withUnsafeMutablePointer(to: &tv) { t in
212212
gettimeofday(t, nil)
213213
ts.tv_sec += t.pointee.tv_sec
214214
ts.tv_nsec += Int((t.pointee.tv_usec * 1000000) / 1000000000)
215215
}
216-
let retVal: Int32 = withUnsafePointer(&ts) { t in
216+
let retVal: Int32 = withUnsafePointer(to: &ts) { t in
217217
return pthread_cond_timedwait(cond, mutex, t)
218218
}
219219

Diff for: Foundation/NSNumber.swift

+13-13
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public class NSNumber : NSValue {
272272
public required convenience init?(coder aDecoder: NSCoder) {
273273
if !aDecoder.allowsKeyedCoding {
274274
var objCType: UnsafeMutablePointer<Int8>? = nil
275-
withUnsafeMutablePointer(&objCType, { (ptr: UnsafeMutablePointer<UnsafeMutablePointer<Int8>?>) -> Void in
275+
withUnsafeMutablePointer(to: &objCType, { (ptr: UnsafeMutablePointer<UnsafeMutablePointer<Int8>?>) -> Void in
276276
aDecoder.decodeValue(ofObjCType: String(_NSSimpleObjCType.CharPtr), at: UnsafeMutableRawPointer(ptr))
277277
})
278278
if objCType == nil {
@@ -310,79 +310,79 @@ public class NSNumber : NSValue {
310310

311311
public var int8Value: Int8 {
312312
var val: Int8 = 0
313-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<Int8>) -> Void in
313+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<Int8>) -> Void in
314314
CFNumberGetValue(_cfObject, kCFNumberCharType, value)
315315
}
316316
return val
317317
}
318318

319319
public var uint8Value: UInt8 {
320320
var val: UInt8 = 0
321-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<UInt8>) -> Void in
321+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<UInt8>) -> Void in
322322
CFNumberGetValue(_cfObject, kCFNumberCharType, value)
323323
}
324324
return val
325325
}
326326

327327
public var int16Value: Int16 {
328328
var val: Int16 = 0
329-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<Int16>) -> Void in
329+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<Int16>) -> Void in
330330
CFNumberGetValue(_cfObject, kCFNumberShortType, value)
331331
}
332332
return val
333333
}
334334

335335
public var uint16Value: UInt16 {
336336
var val: UInt16 = 0
337-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<UInt16>) -> Void in
337+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<UInt16>) -> Void in
338338
CFNumberGetValue(_cfObject, kCFNumberShortType, value)
339339
}
340340
return val
341341
}
342342

343343
public var int32Value: Int32 {
344344
var val: Int32 = 0
345-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<Int32>) -> Void in
345+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<Int32>) -> Void in
346346
CFNumberGetValue(_cfObject, kCFNumberIntType, value)
347347
}
348348
return val
349349
}
350350

351351
public var uint32Value: UInt32 {
352352
var val: UInt32 = 0
353-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<UInt32>) -> Void in
353+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<UInt32>) -> Void in
354354
CFNumberGetValue(_cfObject, kCFNumberIntType, value)
355355
}
356356
return val
357357
}
358358

359359
public var int64Value: Int64 {
360360
var val: Int64 = 0
361-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<Int64>) -> Void in
361+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<Int64>) -> Void in
362362
CFNumberGetValue(_cfObject, kCFNumberLongLongType, value)
363363
}
364364
return val
365365
}
366366

367367
public var uint64Value: UInt64 {
368368
var val: UInt64 = 0
369-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<UInt64>) -> Void in
369+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<UInt64>) -> Void in
370370
CFNumberGetValue(_cfObject, kCFNumberLongLongType, value)
371371
}
372372
return val
373373
}
374374

375375
public var floatValue: Float {
376376
var val: Float = 0
377-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<Float>) -> Void in
377+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<Float>) -> Void in
378378
CFNumberGetValue(_cfObject, kCFNumberFloatType, value)
379379
}
380380
return val
381381
}
382382

383383
public var doubleValue: Double {
384384
var val: Double = 0
385-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<Double>) -> Void in
385+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<Double>) -> Void in
386386
CFNumberGetValue(_cfObject, kCFNumberDoubleType, value)
387387
}
388388
return val
@@ -394,15 +394,15 @@ public class NSNumber : NSValue {
394394

395395
public var intValue: Int {
396396
var val: Int = 0
397-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<Int>) -> Void in
397+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<Int>) -> Void in
398398
CFNumberGetValue(_cfObject, kCFNumberLongType, value)
399399
}
400400
return val
401401
}
402402

403403
public var uintValue: UInt {
404404
var val: UInt = 0
405-
withUnsafeMutablePointer(&val) { (value: UnsafeMutablePointer<UInt>) -> Void in
405+
withUnsafeMutablePointer(to: &val) { (value: UnsafeMutablePointer<UInt>) -> Void in
406406
CFNumberGetValue(_cfObject, kCFNumberLongType, value)
407407
}
408408
return val

0 commit comments

Comments
 (0)