diff options
Diffstat (limited to 'src/io/io_darwin.zig')
-rw-r--r-- | src/io/io_darwin.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/io/io_darwin.zig b/src/io/io_darwin.zig index 902ae2ae4..8045cbdf6 100644 --- a/src/io/io_darwin.zig +++ b/src/io/io_darwin.zig @@ -245,7 +245,7 @@ const system = darwin; pub fn asError(err: anytype) Errno { const int = if (@typeInfo(@TypeOf(err)) == .Enum) - @enumToInt(err) + @intFromEnum(err) else err; @@ -772,7 +772,7 @@ fn flush(self: *IO, comptime _: @Type(.EnumLiteral)) !void { continue; } - const completion = @intToPtr(*Completion, kevent.udata); + const completion = @ptrFromInt(*Completion, kevent.udata); completion.next = null; self.completed.push(completion); } @@ -837,7 +837,7 @@ fn flush_io(_: *IO, events: []Kevent64, io_pending_top: *?*Completion) usize { .flags = @intCast(u16, event_info[2]), .fflags = 0, .data = 0, - .udata = @ptrToInt(completion), + .udata = @intFromPtr(completion), }; } @@ -995,7 +995,7 @@ fn submitWithIncrementPending( // Complete the Completion return callback( - @intToPtr(Context, @ptrToInt(_completion.context)), + @ptrFromInt(Context, @intFromPtr(_completion.context)), _completion, result, ); @@ -1203,7 +1203,7 @@ pub fn connect( const rc = system.getsockopt(op.socket, os.SOL.SOCKET, os.SO.ERROR, @ptrCast([*]u8, &err_code), &size); assert(size == 4); break :brk switch (darwin.getErrno(rc)) { - .SUCCESS => switch (@intToEnum(os.E, err_code)) { + .SUCCESS => switch (@enumFromInt(os.E, err_code)) { .SUCCESS => {}, .ACCES => error.PermissionDenied, .PERM => error.PermissionDenied, @@ -1351,7 +1351,7 @@ pub fn read( op.buf, op.len, ); - return switch (@enumToInt(os.errno(rc))) { + return switch (@intFromEnum(os.errno(rc))) { 0 => @intCast(usize, rc), os.EINTR => continue, os.EAGAIN => error.WouldBlock, |