From b5883bccd81062396125a88c9e30bab7ad9e4c2f Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Mon, 22 Aug 2022 14:57:23 +0200 Subject: [PATCH] chore: port build script to zig stage2 --- build.zig | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/build.zig b/build.zig index 9cd5e15..d006927 100755 --- a/build.zig +++ b/build.zig @@ -78,7 +78,7 @@ pub fn main() !void { zip.?, entry.?, &buf, - path, + path.ptr, file, ); }, @@ -138,9 +138,8 @@ fn archiveFile( try handleArchiveErr(c.archive_write_header(archive, entry), archive); const writer = ArchiveWriter{ .context = archive }; - try std.fifo.LinearFifo(u8, .Slice) - .init(buf) - .pump(file.reader(), writer); + var fifo = std.fifo.LinearFifo(u8, .Slice).init(buf); + try fifo.pump(file.reader(), writer); } /// `name` must end with '/'! @@ -313,12 +312,12 @@ fn downloadMods( try handleCurlErr(c.curl_easy_setopt( curl, c.CURLOPT_WRITEFUNCTION, - curlWriteCallback, + &curlWriteCallback, )); try handleCurlErr(c.curl_easy_setopt( curl, c.CURLOPT_XFERINFOFUNCTION, - curlInfoCallback, + &curlInfoCallback, )); try handleCurlErr(c.curl_easy_setopt(curl, c.CURLOPT_NOPROGRESS, @as(c_long, 0))); try handleCurlErr(c.curl_easy_setopt(curl, c.CURLOPT_FOLLOWLOCATION, @as(c_long, 1))); @@ -380,7 +379,7 @@ fn downloadMods( try handleCurlErr(c.curl_easy_setopt( curl, c.CURLOPT_URL, - @ptrCast([*c]const u8, mod_cstr), + mod_cstr.ptr, )); try handleCurlErr(c.curl_easy_perform(curl));