Skip to content

Commit 7b7d7f9

Browse files
committed
Use UInt instead of a pointer for consistency
1 parent bc15cd8 commit 7b7d7f9

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Documentation/ABI/TestContent.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typealias Accessor = @convention(c) (
4545
_ outValue: UnsafeMutableRawPointer,
4646
_ type: UnsafeRawPointer,
4747
_ hint: UnsafeRawPointer?,
48-
_ reserved: UnsafeRawPointer?
48+
_ reserved: UInt
4949
) -> CBool
5050

5151
typealias TestContentRecord = (
@@ -65,7 +65,7 @@ typedef bool (* SWTAccessor)(
6565
void *outValue,
6666
const void *type,
6767
const void *_Nullable hint,
68-
const void *_Nullable reserved
68+
uintptr_t reserved
6969
);
7070

7171
struct SWTTestContentRecord {
@@ -143,7 +143,7 @@ record matches what the caller is looking for. If the caller passes `nil` as the
143143
filtering is performed.)
144144

145145
The fourth argument to this function, `reserved`, is reserved for future use.
146-
Accessor functions should assume it is `nil` and must not access it.
146+
Accessor functions should assume it is `0` and must not access it.
147147

148148
The concrete Swift type of the value written to `outValue`, the type pointed to
149149
by `type`, and the value pointed to by `hint` depend on the kind of record:

Sources/Testing/Discovery+Macro.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public typealias __TestContentRecordAccessor = @convention(c) (
2929
_ outValue: UnsafeMutableRawPointer,
3030
_ type: UnsafeRawPointer,
3131
_ hint: UnsafeRawPointer?,
32-
_ reserved: UnsafeRawPointer?
32+
_ reserved: UInt
3333
) -> CBool
3434

3535
/// The content of a test content record.

Sources/_TestDiscovery/TestContentRecord.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private typealias _TestContentRecordAccessor = @convention(c) (
2525
_ outValue: UnsafeMutableRawPointer,
2626
_ type: UnsafeRawPointer,
2727
_ hint: UnsafeRawPointer?,
28-
_ reserved: UnsafeRawPointer?
28+
_ reserved: UInt
2929
) -> CBool
3030

3131
/// The content of a test content record.
@@ -161,10 +161,10 @@ public struct TestContentRecord<T> where T: DiscoverableAsTestContent & ~Copyabl
161161
withUnsafeTemporaryAllocation(of: T.self, capacity: 1) { buffer in
162162
let initialized = if let hint {
163163
withUnsafePointer(to: hint) { hint in
164-
accessor(buffer.baseAddress!, type, hint, nil)
164+
accessor(buffer.baseAddress!, type, hint, 0)
165165
}
166166
} else {
167-
accessor(buffer.baseAddress!, type, nil, nil)
167+
accessor(buffer.baseAddress!, type, nil, 0)
168168
}
169169
guard initialized else {
170170
return nil

0 commit comments

Comments
 (0)