From 01a5b96bc24078ff7dda28443a4d097571ec55fc Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Sun, 18 Feb 2024 22:09:44 -0600 Subject: [PATCH] fixed: problems with WASIX definitions --- core/runtime/platform/wasi/platform.onyx | 10 +++++----- core/runtime/platform/wasi/wasi_fs.onyx | 4 ++-- core/runtime/platform/wasi/wasix_net.onyx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/runtime/platform/wasi/platform.onyx b/core/runtime/platform/wasi/platform.onyx index 918392e7..57d142be 100644 --- a/core/runtime/platform/wasi/platform.onyx +++ b/core/runtime/platform/wasi/platform.onyx @@ -152,8 +152,8 @@ __random_get :: (buf: [] u8) { PollDescription :: struct { fd: wasi.FileDescriptor; - input: core.io.PollEvent; - out: core.io.PollEvent; + in_events: core.io.PollEvent; + out_events: core.io.PollEvent; } __poll :: (fds: [] PollDescription, timeout: i32) -> void { @@ -169,7 +169,7 @@ __poll :: (fds: [] PollDescription, timeout: i32) -> void { subs := core.alloc.array_from_stack(wasi.Subscription, count); for i in fds.count { subs[i].userdata = ~~ i; - subs[i].u.tag = switch fds[i].input { + subs[i].u.tag = switch fds[i].in_events { case .None => .FDRead; case .Read => .FDRead; case .Write => .FDWrite; @@ -199,12 +199,12 @@ __poll :: (fds: [] PollDescription, timeout: i32) -> void { if ev.type !=.Clock { if ev.fd_readwrite.nbytes > 0 { i := cast(i32) ev.userdata; - fds[i].out = fds[i].input; + fds[i].out_events = fds[i].in_events; } if ev.fd_readwrite.flags & .ReadWriteHangUp { i := cast(i32) ev.userdata; - fds[i].out = .Closed; + fds[i].out_events = .Closed; } } } diff --git a/core/runtime/platform/wasi/wasi_fs.onyx b/core/runtime/platform/wasi/wasi_fs.onyx index 09300f6a..487d11f0 100644 --- a/core/runtime/platform/wasi/wasi_fs.onyx +++ b/core/runtime/platform/wasi/wasi_fs.onyx @@ -265,12 +265,12 @@ __file_stream_vtable := io.Stream_Vtable.{ poll = (use fs: &os.File, ev: io.PollEvent, timeout: i32) -> (io.Error, bool) { p: [1] PollDescription = .[.{ fd = data.fd, - input = ev, + in_events = ev, }]; runtime.platform.__poll(p, timeout); - return .None, p[0].out == ev; + return .None, p[0].out_events == ev; } } diff --git a/core/runtime/platform/wasi/wasix_net.onyx b/core/runtime/platform/wasi/wasix_net.onyx index 612ca9a4..230a1a7d 100644 --- a/core/runtime/platform/wasi/wasix_net.onyx +++ b/core/runtime/platform/wasi/wasix_net.onyx @@ -182,7 +182,7 @@ __net_resolve :: (host: str, port: u16, out_addrs: [] SocketAddress) -> i32 { #package { socket_addr_to_wasix_addr :: (input: &SocketAddress, out: &wasi.AddrPort) { - switch *innput { + switch *input { case .Unix as &path { *out = .{ Unix = .{ *cast(&[108] u8) path } }; } -- 2.25.1