authorgravatar for 13811862+thechampagne@users.noreply.github.comXXIV <13811862+thechampagne@users.noreply.github.com> 2023-10-31 07:17:39+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-10-31 00:17:39-04:00
log34aac2bae145ae19fcbe36f794ee7054ea4de11f
tree707975178039248078dc8d41c2c458e0dd0d04e0
parent825da34769784c7bdfa0d6be325c7299d992a951
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

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


2 files changed, 6 insertions(+), 6 deletions(-)

lib/std/Thread.zig+1-1
......@@ -552,7 +552,7 @@ const WindowsThreadImpl = struct {
552552 null,
553553 stack_size,
554554 Instance.entryFn,
555 @as(*anyopaque, @ptrCast(instance)),
555 instance,
556556 0,
557557 null,
558558 ) orelse {
lib/std/Thread/Futex.zig+5-5
......@@ -136,8 +136,8 @@ const WindowsImpl = struct {
136136 }
137137
138138 const rc = os.windows.ntdll.RtlWaitOnAddress(
139 @as(?*const anyopaque, @ptrCast(ptr)),
140 @as(?*const anyopaque, @ptrCast(&expect)),
139 ptr,
140 &expect,
141141 @sizeOf(@TypeOf(expect)),
142142 timeout_ptr,
143143 );
......@@ -153,7 +153,7 @@ const WindowsImpl = struct {
153153 }
154154
155155 fn wake(ptr: *const Atomic(u32), max_waiters: u32) void {
156 const address = @as(?*const anyopaque, @ptrCast(ptr));
156 const address: ?*const anyopaque = ptr;
157157 assert(max_waiters != 0);
158158
159159 switch (max_waiters) {
......@@ -188,7 +188,7 @@ const DarwinImpl = struct {
188188 // true so that we we know to ignore the ETIMEDOUT result.
189189 var timeout_overflowed = false;
190190
191 const addr = @as(*const anyopaque, @ptrCast(ptr));
191 const addr: *const anyopaque = ptr;
192192 const flags = os.darwin.UL_COMPARE_AND_WAIT | os.darwin.ULF_NO_ERRNO;
193193 const status = blk: {
194194 if (supports_ulock_wait2) {
......@@ -227,7 +227,7 @@ const DarwinImpl = struct {
227227 }
228228
229229 while (true) {
230 const addr = @as(*const anyopaque, @ptrCast(ptr));
230 const addr: *const anyopaque = ptr;
231231 const status = os.darwin.__ulock_wake(flags, addr, 0);
232232
233233 if (status >= 0) return;