diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-03-18 20:35:19 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-03-19 09:53:55 -0400 |
| commit | 7fa88cc0a678a3690b61054030f5597b623964a4 (patch) | |
| tree | a1cdaabfbbe0fe8b240691a9b1921245973f5107 /lib/std/net.zig | |
| parent | b5dba702fff35c2d9aa86c9d5dd93a4a38d3b75b (diff) | |
| download | zig-7fa88cc0a678a3690b61054030f5597b623964a4.tar.gz zig-7fa88cc0a678a3690b61054030f5597b623964a4.zip | |
std lib fixups for new semantics
std lib tests are passing now
Diffstat (limited to 'lib/std/net.zig')
| -rw-r--r-- | lib/std/net.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/net.zig b/lib/std/net.zig index c2328b9bd0..44efc4644a 100644 --- a/lib/std/net.zig +++ b/lib/std/net.zig @@ -612,8 +612,7 @@ fn linuxLookupName( } else { mem.copy(u8, &sa6.addr, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff"); mem.copy(u8, &da6.addr, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff"); - // TODO https://github.com/ziglang/zig/issues/863 - mem.writeIntNative(u32, @ptrCast(*[4]u8, da6.addr[12..].ptr), addr.addr.in.addr); + mem.writeIntNative(u32, da6.addr[12..], addr.addr.in.addr); da4.addr = addr.addr.in.addr; da = @ptrCast(*os.sockaddr, &da4); dalen = @sizeOf(os.sockaddr_in); @@ -821,7 +820,7 @@ fn linuxLookupNameFromHosts( // Skip to the delimiter in the stream, to fix parsing try stream.skipUntilDelimiterOrEof('\n'); // Use the truncated line. A truncated comment or hostname will be handled correctly. - break :blk line_buf[0..]; + break :blk @as([]u8, &line_buf); // TODO the cast should not be necessary }, else => |e| return e, }) |line| { @@ -958,7 +957,8 @@ fn linuxLookupNameFromDns( } } - var ap = [2][]u8{ apbuf[0][0..0], apbuf[1][0..0] }; + var hack: usize = 0; // TODO remove this hack + var ap = [2][]u8{ apbuf[0][0..hack], apbuf[1][0..hack] }; try resMSendRc(qp[0..nq], ap[0..nq], apbuf[0..nq], rc); var i: usize = 0; @@ -1015,7 +1015,7 @@ fn getResolvConf(allocator: *mem.Allocator, rc: *ResolvConf) !void { // Skip to the delimiter in the stream, to fix parsing try stream.skipUntilDelimiterOrEof('\n'); // Give an empty line to the while loop, which will be skipped. - break :blk line_buf[0..0]; + break :blk @as([]u8, line_buf[0..0]); // TODO the cast should not be necessary }, else => |e| return e, }) |line| { |
