Skip to content

Commit 1833187

Browse files
authored
Merge pull request #85803 from tbkka/tbkka-FPToString-unsafe
Fill in missing `unsafe` markers
2 parents 5ba064c + f607cd9 commit 1833187

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

stdlib/public/Concurrency/Executor.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,8 +812,8 @@ public struct UnownedSerialExecutor: Sendable {
812812
// any SerialExecutor needs a raw witness table pointer, so mask off the low
813813
// bits, knowing the witness table pointer is aligned to the pointer size.
814814
let rawExecutorData = unsafe unsafeBitCast(executor, to: (UInt, UInt).self)
815-
let mask = ~(UInt(MemoryLayout<UnsafeRawPointer>.alignment) - 1)
816-
let alignedExecutor = unsafe (rawExecutorData.0, rawExecutorData.1 & mask)
815+
let mask = unsafe ~(UInt(MemoryLayout<UnsafeRawPointer>.alignment) - 1)
816+
let alignedExecutor = (rawExecutorData.0, rawExecutorData.1 & mask)
817817
return unsafe unsafeBitCast(alignedExecutor, to: (any SerialExecutor)?.self)
818818
}
819819
}

stdlib/public/core/FloatingPointToString.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public func _float16ToStringImpl(
158158
_unchecked: textBuffer,
159159
count: Int(bufferLength))
160160
for i in 0..<Int(bufferLength) {
161-
buffer[unchecked: i] = 0x30
161+
unsafe buffer[unchecked: i] = 0x30
162162
}
163163
let textRange = _Float16ToASCII(value: value, buffer: &buffer)
164164
let textLength = textRange.upperBound - textRange.lowerBound
@@ -450,7 +450,7 @@ internal func _float32ToStringImpl(
450450
_unchecked: textBuffer,
451451
count: Int(bufferLength))
452452
for i in 0..<Int(bufferLength) {
453-
buffer[unchecked: i] = 0x30
453+
unsafe buffer[unchecked: i] = 0x30
454454
}
455455
let textRange = _Float32ToASCII(value: value, buffer: &buffer)
456456
let textLength = textRange.upperBound - textRange.lowerBound
@@ -701,7 +701,7 @@ internal func _float64ToStringImpl(
701701
_unchecked: textBuffer,
702702
count: Int(bufferLength))
703703
for i in 0..<Int(bufferLength) {
704-
buffer[unchecked: i] = 0x30
704+
unsafe buffer[unchecked: i] = 0x30
705705
}
706706
let textRange = _Float64ToASCII(value: value, buffer: &buffer)
707707
let textLength = textRange.upperBound - textRange.lowerBound
@@ -1207,7 +1207,7 @@ internal func _float80ToStringImpl(
12071207
_unchecked: textBuffer,
12081208
count: Int(bufferLength))
12091209
for i in 0..<Int(bufferLength) {
1210-
buffer[unchecked: i] = 0x30
1210+
unsafe buffer[unchecked: i] = 0x30
12111211
}
12121212
let textRange = _Float80ToASCII(value: value, buffer: &buffer)
12131213
let textLength = textRange.upperBound - textRange.lowerBound

0 commit comments

Comments
 (0)