Skip to content

Commit eef0ed5

Browse files
committed
Fix deprecation warnings
1 parent 4c33531 commit eef0ed5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Foundation/Stream.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ open class InputStream: Stream {
119119

120120
// reads up to length bytes into the supplied buffer, which must be at least of size len. Returns the actual number of bytes read.
121121
open func read(_ buffer: UnsafeMutablePointer<UInt8>, maxLength len: Int) -> Int {
122-
return CFReadStreamRead(_stream, buffer, CFIndex(len._bridgeToObjectiveC()))
122+
return CFReadStreamRead(_stream, buffer, CFIndex(truncating: len._bridgeToObjectiveC()))
123123
}
124124

125125
// returns in O(1) a pointer to the buffer in 'buffer' and by reference in 'len' how many bytes are available. This buffer is only valid until the next stream operation. Subclassers may return NO for this if it is not appropriate for the stream type. This may return NO if the buffer is not available.

TestFoundation/TestDecimal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ class TestDecimal: XCTestCase {
404404
XCTAssertNotEqual(.noError, NSDecimalMultiplyByPowerOf10(&result, &NaN, 5, .plain))
405405
XCTAssertTrue(NSDecimalIsNotANumber(&result), "NaN e5")
406406

407-
XCTAssertFalse(Double(NSDecimalNumber(decimal:Decimal(0))).isNaN)
407+
XCTAssertFalse(Double(truncating: NSDecimalNumber(decimal: Decimal(0))).isNaN)
408408
}
409409

410410
func test_NegativeAndZeroMultiplication() {

0 commit comments

Comments
 (0)