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 {...@@ -552,7 +552,7 @@ const WindowsThreadImpl = struct {
552 null,552 null,
553 stack_size,553 stack_size,
554 Instance.entryFn,554 Instance.entryFn,
555 @as(*anyopaque, @ptrCast(instance)),555 instance,
556 0,556 0,
557 null,557 null,
558 ) orelse {558 ) orelse {
lib/std/Thread/Futex.zig+5-5
...@@ -136,8 +136,8 @@ const WindowsImpl = struct {...@@ -136,8 +136,8 @@ const WindowsImpl = struct {
136 }136 }
137137
138 const rc = os.windows.ntdll.RtlWaitOnAddress(138 const rc = os.windows.ntdll.RtlWaitOnAddress(
139 @as(?*const anyopaque, @ptrCast(ptr)),139 ptr,
140 @as(?*const anyopaque, @ptrCast(&expect)),140 &expect,
141 @sizeOf(@TypeOf(expect)),141 @sizeOf(@TypeOf(expect)),
142 timeout_ptr,142 timeout_ptr,
143 );143 );
...@@ -153,7 +153,7 @@ const WindowsImpl = struct {...@@ -153,7 +153,7 @@ const WindowsImpl = struct {
153 }153 }
154154
155 fn wake(ptr: *const Atomic(u32), max_waiters: u32) void {155 fn wake(ptr: *const Atomic(u32), max_waiters: u32) void {
156 const address = @as(?*const anyopaque, @ptrCast(ptr));156 const address: ?*const anyopaque = ptr;
157 assert(max_waiters != 0);157 assert(max_waiters != 0);
158158
159 switch (max_waiters) {159 switch (max_waiters) {
...@@ -188,7 +188,7 @@ const DarwinImpl = struct {...@@ -188,7 +188,7 @@ const DarwinImpl = struct {
188 // true so that we we know to ignore the ETIMEDOUT result.188 // true so that we we know to ignore the ETIMEDOUT result.
189 var timeout_overflowed = false;189 var timeout_overflowed = false;
190190
191 const addr = @as(*const anyopaque, @ptrCast(ptr));191 const addr: *const anyopaque = ptr;
192 const flags = os.darwin.UL_COMPARE_AND_WAIT | os.darwin.ULF_NO_ERRNO;192 const flags = os.darwin.UL_COMPARE_AND_WAIT | os.darwin.ULF_NO_ERRNO;
193 const status = blk: {193 const status = blk: {
194 if (supports_ulock_wait2) {194 if (supports_ulock_wait2) {
...@@ -227,7 +227,7 @@ const DarwinImpl = struct {...@@ -227,7 +227,7 @@ const DarwinImpl = struct {
227 }227 }
228228
229 while (true) {229 while (true) {
230 const addr = @as(*const anyopaque, @ptrCast(ptr));230 const addr: *const anyopaque = ptr;
231 const status = os.darwin.__ulock_wake(flags, addr, 0);231 const status = os.darwin.__ulock_wake(flags, addr, 0);
232232
233 if (status >= 0) return;233 if (status >= 0) return;