Skip to content

Commit d8a4c18

Browse files
authored
Import NSRange from the Darwin overlay (and make it mergable back) and update NSScanner (required for NSRange updates) (#1064)
1 parent 226e078 commit d8a4c18

File tree

9 files changed

+358
-130
lines changed

9 files changed

+358
-130
lines changed

Foundation/NSConcreteValue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ internal class NSConcreteValue : NSValue {
3939

4040
scanner.scanLocation = 1
4141

42-
guard scanner.scanInteger(&count) && count > 0 else {
42+
guard scanner.scanInt(&count) && count > 0 else {
4343
print("NSConcreteValue.TypeInfo: array count is missing or zero")
4444
return nil
4545
}

Foundation/NSGeometry.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ extension CGPoint: NSSpecialValueCoding {
7171
return self.x.hashValue &+ self.y.hashValue
7272
}
7373

74-
var description: String? {
74+
var description: String {
7575
return NSStringFromPoint(self)
7676
}
7777
}
@@ -134,7 +134,7 @@ extension CGSize: NSSpecialValueCoding {
134134
return self.width.hashValue &+ self.height.hashValue
135135
}
136136

137-
var description: String? {
137+
var description: String {
138138
return NSStringFromSize(self)
139139
}
140140
}
@@ -216,7 +216,7 @@ extension CGRect: NSSpecialValueCoding {
216216
return self.origin.hash &+ self.size.hash
217217
}
218218

219-
var description: String? {
219+
var description: String {
220220
return NSStringFromRect(self)
221221
}
222222
}
@@ -316,8 +316,8 @@ extension NSEdgeInsets: NSSpecialValueCoding {
316316
return self.top.hashValue &+ self.left.hashValue &+ self.bottom.hashValue &+ self.right.hashValue
317317
}
318318

319-
var description: String? {
320-
return nil
319+
var description: String {
320+
return ""
321321
}
322322
}
323323

Foundation/NSKeyedArchiver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ open class NSKeyedArchiver : NSCoder {
755755
scanner.scanLocation = 1 // advance past ObJCType
756756

757757
var count : Int = 0
758-
guard scanner.scanInteger(&count) && count > 0 else {
758+
guard scanner.scanInt(&count) && count > 0 else {
759759
fatalError("NSKeyedArchiver.encodeValueOfObjCType: array count is missing or zero")
760760
}
761761

Foundation/NSKeyedUnarchiver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ open class NSKeyedUnarchiver : NSCoder {
813813
scanner.scanLocation = 1
814814

815815
var count : Int = 0
816-
guard scanner.scanInteger(&count) && count > 0 else {
816+
guard scanner.scanInt(&count) && count > 0 else {
817817
fatalError("NSKeyedUnarchiver.decodeValueOfObjCType: array count is missing or zero")
818818
}
819819

0 commit comments

Comments
 (0)