diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2023-06-22 18:46:56 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-24 16:56:39 -0700 |
| commit | f26dda21171e26f44aeec8c59a75bbb3331eeb2e (patch) | |
| tree | c935248861ae2693b314f2c8bc78fe38d9961b6d /lib/std/event/loop.zig | |
| parent | 447ca4e3fff021f471b748187b53f0a4744ad0bc (diff) | |
| download | zig-f26dda21171e26f44aeec8c59a75bbb3331eeb2e.tar.gz zig-f26dda21171e26f44aeec8c59a75bbb3331eeb2e.zip | |
all: migrate code to new cast builtin syntax
Most of this migration was performed automatically with `zig fmt`. There
were a few exceptions which I had to manually fix:
* `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten
* `@truncate`'s fixup is incorrect for vectors
* Test cases are not formatted, and their error locations change
Diffstat (limited to 'lib/std/event/loop.zig')
| -rw-r--r-- | lib/std/event/loop.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/event/loop.zig b/lib/std/event/loop.zig index 7eec26a2b1..b5021a5378 100644 --- a/lib/std/event/loop.zig +++ b/lib/std/event/loop.zig @@ -556,7 +556,7 @@ pub const Loop = struct { self.linuxWaitFd(fd, os.linux.EPOLL.ET | os.linux.EPOLL.ONESHOT | os.linux.EPOLL.IN); }, .macos, .ios, .tvos, .watchos, .freebsd, .netbsd, .dragonfly, .openbsd => { - self.bsdWaitKev(@intCast(usize, fd), os.system.EVFILT_READ, os.system.EV_ONESHOT); + self.bsdWaitKev(@as(usize, @intCast(fd)), os.system.EVFILT_READ, os.system.EV_ONESHOT); }, else => @compileError("Unsupported OS"), } @@ -568,7 +568,7 @@ pub const Loop = struct { self.linuxWaitFd(fd, os.linux.EPOLL.ET | os.linux.EPOLL.ONESHOT | os.linux.EPOLL.OUT); }, .macos, .ios, .tvos, .watchos, .freebsd, .netbsd, .dragonfly, .openbsd => { - self.bsdWaitKev(@intCast(usize, fd), os.system.EVFILT_WRITE, os.system.EV_ONESHOT); + self.bsdWaitKev(@as(usize, @intCast(fd)), os.system.EVFILT_WRITE, os.system.EV_ONESHOT); }, else => @compileError("Unsupported OS"), } @@ -580,8 +580,8 @@ pub const Loop = struct { self.linuxWaitFd(fd, os.linux.EPOLL.ET | os.linux.EPOLL.ONESHOT | os.linux.EPOLL.OUT | os.linux.EPOLL.IN); }, .macos, .ios, .tvos, .watchos, .freebsd, .netbsd, .dragonfly, .openbsd => { - self.bsdWaitKev(@intCast(usize, fd), os.system.EVFILT_READ, os.system.EV_ONESHOT); - self.bsdWaitKev(@intCast(usize, fd), os.system.EVFILT_WRITE, os.system.EV_ONESHOT); + self.bsdWaitKev(@as(usize, @intCast(fd)), os.system.EVFILT_READ, os.system.EV_ONESHOT); + self.bsdWaitKev(@as(usize, @intCast(fd)), os.system.EVFILT_WRITE, os.system.EV_ONESHOT); }, else => @compileError("Unsupported OS"), } @@ -1415,7 +1415,7 @@ pub const Loop = struct { var events: [1]os.linux.epoll_event = undefined; const count = os.epoll_wait(self.os_data.epollfd, events[0..], -1); for (events[0..count]) |ev| { - const resume_node = @ptrFromInt(*ResumeNode, ev.data.ptr); + const resume_node = @as(*ResumeNode, @ptrFromInt(ev.data.ptr)); const handle = resume_node.handle; const resume_node_id = resume_node.id; switch (resume_node_id) { @@ -1439,7 +1439,7 @@ pub const Loop = struct { const empty_kevs = &[0]os.Kevent{}; const count = os.kevent(self.os_data.kqfd, empty_kevs, eventlist[0..], null) catch unreachable; for (eventlist[0..count]) |ev| { - const resume_node = @ptrFromInt(*ResumeNode, ev.udata); + const resume_node = @as(*ResumeNode, @ptrFromInt(ev.udata)); const handle = resume_node.handle; const resume_node_id = resume_node.id; switch (resume_node_id) { |
