Skip to content

Commit

Permalink
pre-Swift 5.8 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oscbyspro committed Mar 31, 2023
1 parent dee4a6c commit 37f0799
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Sources/ANKFullWidthKit/ANKFullWidth+Arithmetic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// See http://www.apache.org/licenses/LICENSE-2.0 for license information.
//=----------------------------------------------------------------------------=

import ANKFoundation

//*============================================================================*
// MARK: * ANK x Full Width x Arithmetic
//*============================================================================*
Expand Down
2 changes: 2 additions & 0 deletions Sources/ANKFullWidthKit/ANKFullWidth+Bits.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// See http://www.apache.org/licenses/LICENSE-2.0 for license information.
//=----------------------------------------------------------------------------=

import ANKFoundation

//*============================================================================*
// MARK: * ANK x Full Width x Bits
//*============================================================================*
Expand Down
4 changes: 2 additions & 2 deletions Sources/ANKFullWidthKit/ANKFullWidth+Words+Pointers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ extension ANKFullWidth {
/// do stupid stuff. Understood? Cool. Let's go!
///
@_transparent public static func fromUnsafeMutableWords(_ body: (ANKUnsafeMutableWordsPointer<BitPattern>) throws -> Void) rethrows -> Self {
try Swift.withUnsafeTemporaryAllocation(of: Self.self, capacity: 1) { BUFFER in
let SELF = BUFFER.baseAddress.unsafelyUnwrapped
try Swift.withUnsafeTemporaryAllocation(of: Self.self, capacity: 1) { ALLOC in
let SELF = ALLOC.baseAddress.unsafelyUnwrapped
try SELF.withMemoryRebound(to: UInt.self, capacity: Self.count) { WORDS in
try body(ANKUnsafeMutableWordsPointer(WORDS))
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/ANKFoundationTests/ANKCoreInteger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ final class ANKCoreIntegerTests: XCTestCase {
}

func testANKCoreInteger() {
XCTAssertEqual(10, types.count)
XCTAssertEqual(10, types.compactMap({ $0 as any ANKCoreInteger.Type }).count)
}

func testANKFixedWidthInteger() {
Expand Down

0 comments on commit 37f0799

Please sign in to comment.