Zig 0.15: zig build test

This commit is contained in:
Mitchell Hashimoto
2025-10-01 13:10:40 -07:00
parent 3770f97608
commit cb295b84a0
66 changed files with 1264 additions and 1144 deletions

View File

@@ -6,7 +6,7 @@ const Allocator = std.mem.Allocator;
const help_strings = @import("help_strings");
const vaxis = @import("vaxis");
const framedata = @import("framedata");
const framedata = @embedFile("framedata");
const vxfw = vaxis.vxfw;
@@ -218,17 +218,20 @@ var frames: []const []const u8 = undefined;
/// Decompress the frames into a slice of individual frames
fn decompressFrames(gpa: Allocator) !void {
var fbs = std.io.fixedBufferStream(framedata.compressed);
var list = std.ArrayList(u8).init(gpa);
var src: std.Io.Reader = .fixed(framedata);
try std.compress.flate.decompress(fbs.reader(), list.writer());
decompressed_data = try list.toOwnedSlice();
// var buf: [std.compress.flate.max_window_len]u8 = undefined;
var decompress: std.compress.flate.Decompress = .init(&src, .raw, &.{});
var frame_list = try std.ArrayList([]const u8).initCapacity(gpa, 235);
var out: std.Io.Writer.Allocating = .init(gpa);
_ = try decompress.reader.streamRemaining(&out.writer);
decompressed_data = try out.toOwnedSlice();
var frame_list: std.ArrayList([]const u8) = try .initCapacity(gpa, 235);
var frame_iter = std.mem.splitScalar(u8, decompressed_data, '\x01');
while (frame_iter.next()) |frame| {
try frame_list.append(frame);
try frame_list.append(gpa, frame);
}
frames = try frame_list.toOwnedSlice();
frames = try frame_list.toOwnedSlice(gpa);
}