Updated a lot of packed structs to extern struct
Specified int types for remaining packed structs Instead of manually decoding File & ExtFile structs, decode an extern struct first Fixed some zstd issues Some more File stuff
This commit is contained in:
+2
-2
@@ -57,7 +57,7 @@ fn decomp(d: ?*const Decompressor, alloc: std.mem.Allocator, in: []u8, out: []u8
|
||||
|
||||
inline fn zstdDecomp(buffer: []u8, in: []u8, out: []u8) !usize {
|
||||
var rdr: Reader = .fixed(in);
|
||||
var d = zstd.Decompress.init(&rdr, buffer, .{ .window_len = @truncate(in.len) });
|
||||
var d = zstd.Decompress.init(&rdr, buffer, .{ .window_len = @truncate(out.len) });
|
||||
|
||||
return d.reader.readSliceShort(out);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ inline fn zstdDecomp(buffer: []u8, in: []u8, out: []u8) !usize {
|
||||
pub const stateless_decompressor: Decompressor = .{ .decomp_fn = statelessDecomp };
|
||||
|
||||
fn statelessDecomp(_: ?*const Decompressor, alloc: std.mem.Allocator, in: []u8, out: []u8) Error!usize {
|
||||
const buf = try alloc.alloc(u8, in.len + zstd.block_size_max);
|
||||
const buf = try alloc.alloc(u8, out.len + zstd.block_size_max);
|
||||
defer alloc.free(buf);
|
||||
return zstdDecomp(buf, in, out);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user