mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
std/Thread: remove unnecessary @ptrCast (#17766)
This commit is contained in:
parent
825da34769
commit
34aac2bae1
@ -552,7 +552,7 @@ const WindowsThreadImpl = struct {
|
||||
null,
|
||||
stack_size,
|
||||
Instance.entryFn,
|
||||
@as(*anyopaque, @ptrCast(instance)),
|
||||
instance,
|
||||
0,
|
||||
null,
|
||||
) orelse {
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user