diff options
| author | XXIV <13811862+thechampagne@users.noreply.github.com> | 2023-10-31 07:17:39 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-31 00:17:39 -0400 |
| commit | 34aac2bae145ae19fcbe36f794ee7054ea4de11f (patch) | |
| tree | 707975178039248078dc8d41c2c458e0dd0d04e0 /lib/std/Thread | |
| parent | 825da34769784c7bdfa0d6be325c7299d992a951 (diff) | |
| download | zig-34aac2bae145ae19fcbe36f794ee7054ea4de11f.tar.gz zig-34aac2bae145ae19fcbe36f794ee7054ea4de11f.zip | |
std/Thread: remove unnecessary `@ptrCast` (#17766)
Diffstat (limited to 'lib/std/Thread')
| -rw-r--r-- | lib/std/Thread/Futex.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/Thread/Futex.zig b/lib/std/Thread/Futex.zig index 0020180bcb..97d55cf71f 100644 --- a/lib/std/Thread/Futex.zig +++ b/lib/std/Thread/Futex.zig @@ -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; |
