std/Thread: remove unnecessary @ptrCast (#17766)

This commit is contained in:
XXIV 2023-10-31 07:17:39 +03:00 committed by GitHub
parent 825da34769
commit 34aac2bae1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -552,7 +552,7 @@ const WindowsThreadImpl = struct {
null,
stack_size,
Instance.entryFn,
@as(*anyopaque, @ptrCast(instance)),
instance,
0,
null,
) orelse {

View File

@ -136,8 +136,8 @@ const WindowsImpl = struct {
}
const rc = os.windows.ntdll.RtlWaitOnAddress(
@as(?*const anyopaque, @ptrCast(ptr)),
@as(?*const anyopaque, @ptrCast(&expect)),
ptr,
&expect,
@sizeOf(@TypeOf(expect)),
timeout_ptr,
);
@ -153,7 +153,7 @@ const WindowsImpl = struct {
}
fn wake(ptr: *const Atomic(u32), max_waiters: u32) void {
const address = @as(?*const anyopaque, @ptrCast(ptr));
const address: ?*const anyopaque = ptr;
assert(max_waiters != 0);
switch (max_waiters) {
@ -188,7 +188,7 @@ const DarwinImpl = struct {
// true so that we we know to ignore the ETIMEDOUT result.
var timeout_overflowed = false;
const addr = @as(*const anyopaque, @ptrCast(ptr));
const addr: *const anyopaque = ptr;
const flags = os.darwin.UL_COMPARE_AND_WAIT | os.darwin.ULF_NO_ERRNO;
const status = blk: {
if (supports_ulock_wait2) {
@ -227,7 +227,7 @@ const DarwinImpl = struct {
}
while (true) {
const addr = @as(*const anyopaque, @ptrCast(ptr));
const addr: *const anyopaque = ptr;
const status = os.darwin.__ulock_wake(flags, addr, 0);
if (status >= 0) return;