mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib: remove Word and UWord
These types are leftovers from the early pre-1.0 times when Int and UInt were always 64-bit on all platforms. They serve no useful purpose today. Int and UInt are defined to be word-sized and should be used instead. rdar://18693488 Swift SVN r30564
This commit is contained in:
@@ -149,11 +149,11 @@ func isOSAtLeast(major: Int, _ minor: Int, patch: Int = 0) -> Bool {
|
||||
|
||||
func expectTagged(s: NSString, _ expected: Bool) -> NSString {
|
||||
#if arch(x86_64)
|
||||
let mask: UWord = 0x8000000000000001
|
||||
let mask: UInt = 0x8000000000000001
|
||||
#elseif arch(arm64)
|
||||
let mask: UWord = 0x8000000000000000
|
||||
let mask: UInt = 0x8000000000000000
|
||||
#else
|
||||
let mask: UWord = 0
|
||||
let mask: UInt = 0
|
||||
#endif
|
||||
|
||||
var osSupportsTaggedStrings: Bool
|
||||
@@ -170,7 +170,7 @@ func expectTagged(s: NSString, _ expected: Bool) -> NSString {
|
||||
|
||||
let taggedStringsSupported = osSupportsTaggedStrings && mask != 0
|
||||
|
||||
let tagged = unsafeBitCast(s, UWord.self) & mask != 0
|
||||
let tagged = unsafeBitCast(s, UInt.self) & mask != 0
|
||||
|
||||
if taggedStringsSupported && expected == tagged {
|
||||
// okay
|
||||
|
||||
Reference in New Issue
Block a user