Skip to content

Commit 6bae6b2

Browse files
authored
Merge pull request #2638 from spevans/pr_minor_warnings
2 parents cf9616b + b180034 commit 6bae6b2

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

Foundation/Decimal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ extension Decimal {
101101
public func pow(_ x: Decimal, _ y: Int) -> Decimal {
102102
var x = x
103103
var result = Decimal()
104-
NSDecimalPower(&result, &x, y, .plain)
104+
_ = NSDecimalPower(&result, &x, y, .plain)
105105
return result
106106
}
107107

Foundation/NSCFCharacterSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ internal class _NSCFCharacterSet : NSMutableCharacterSet {
4343
}
4444

4545
override func copy(with zone: NSZone? = nil) -> Any {
46-
return CFCharacterSetCreateCopy(kCFAllocatorSystemDefault, self._cfObject)
46+
return CFCharacterSetCreateCopy(kCFAllocatorSystemDefault, self._cfObject) as Any
4747
}
4848

4949
override func mutableCopy(with zone: NSZone? = nil) -> Any {

Foundation/NSCharacterSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ open class NSCharacterSet : NSObject, NSCopying, NSMutableCopying, NSSecureCodin
370370
if type(of: self) == NSCharacterSet.self || type(of: self) == NSMutableCharacterSet.self {
371371
return _CFCharacterSetCreateCopy(kCFAllocatorSystemDefault, self._cfObject)
372372
} else if type(of: self) == _NSCFCharacterSet.self {
373-
return CFCharacterSetCreateCopy(kCFAllocatorSystemDefault, self._cfObject)
373+
return CFCharacterSetCreateCopy(kCFAllocatorSystemDefault, self._cfObject) as Any
374374
} else {
375375
NSRequiresConcreteImplementation()
376376
}

Foundation/NSKeyedArchiver.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ open class NSKeyedArchiver : NSCoder {
223223
success = true
224224
}
225225
} else {
226-
success = CFPropertyListWrite(plist, self._stream as! CFWriteStream,
227-
kCFPropertyListXMLFormat_v1_0, 0, nil) > 0
226+
let stream = self._stream as! CFWriteStream
227+
success = CFPropertyListWrite(plist, stream, kCFPropertyListXMLFormat_v1_0, 0, nil) > 0
228228
}
229229

230230
return success

Foundation/NSObject.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ open class NSObject : NSObjectProtocol, Equatable, Hashable {
370370
// On Darwin, avoids dipping into the class hierarchy that exists above this class,
371371
// which is ultimately rooted in the ObjC NSObject class.
372372
guard !(self == NSObject.self) else { return nil }
373-
return _getSuperclass(self) as! NSObject.Type
373+
return _getSuperclass(self) as? NSObject.Type
374374
}
375375

376376
public class var superclass: AnyClass? {

Foundation/NumberFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ open class NumberFormatter : Formatter {
283283

284284
private func defaultFormatWidth() -> Int {
285285
switch numberStyle {
286-
case .ordinal, .ordinal, .spellOut, .currencyPlural:
286+
case .ordinal, .spellOut, .currencyPlural:
287287
return 0
288288

289289
case .none, .decimal, .currency, .percent, .scientific, .currencyISOCode, .currencyAccounting:

Foundation/URLResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ private func getSuggestedFilename(fromHeaderFields headerFields: [String : Strin
356356
else { return nil }
357357
for part in field.parameters where part.attribute == "filename" {
358358
if let path = part.value {
359-
return (path as? NSString)?.pathComponents.map{ $0 == "/" ? "" : $0}.joined(separator: "_")
359+
return (path as NSString).pathComponents.map{ $0 == "/" ? "" : $0}.joined(separator: "_")
360360
} else {
361361
return nil
362362
}

Foundation/URLSession/FoundationNetworking-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>SwiftFoundation</string>
99
<key>CFBundleIdentifier</key>
10-
<string>org.swift.Foundation</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>

0 commit comments

Comments
 (0)