mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
Use u64 for item counts in binary export
They're still clamped to a u32 upon reading, but at least the file will have correct counts and can be read even when it exceeds 4.2 billion items.
This commit is contained in:
parent
49ef7cc34e
commit
252f7fc253
2 changed files with 3 additions and 3 deletions
|
|
@ -39,7 +39,7 @@ pub const ItemKey = enum(u5) {
|
||||||
cumdsize = 8, // u64
|
cumdsize = 8, // u64
|
||||||
shrasize = 9, // u64
|
shrasize = 9, // u64
|
||||||
shrdsize = 10, // u64
|
shrdsize = 10, // u64
|
||||||
items = 11, // u32
|
items = 11, // u64
|
||||||
sub = 12, // itemref only if dir is not empty
|
sub = 12, // itemref only if dir is not empty
|
||||||
// Only for .link
|
// Only for .link
|
||||||
ino = 13, // u64
|
ino = 13, // u64
|
||||||
|
|
@ -217,7 +217,7 @@ pub const Dir = struct {
|
||||||
lock: std.Thread.Mutex = .{},
|
lock: std.Thread.Mutex = .{},
|
||||||
last_sub: u64 = 0,
|
last_sub: u64 = 0,
|
||||||
stat: sink.Stat,
|
stat: sink.Stat,
|
||||||
items: u32 = 0,
|
items: u64 = 0,
|
||||||
size: u64 = 0,
|
size: u64 = 0,
|
||||||
blocks: u64 = 0,
|
blocks: u64 = 0,
|
||||||
err: bool = false,
|
err: bool = false,
|
||||||
|
|
|
||||||
|
|
@ -467,7 +467,7 @@ pub fn get(ref: u64, alloc: std.mem.Allocator) *model.Entry {
|
||||||
.cumdsize => entry.pack.blocks = @intCast(kv.val.int(u64)/512),
|
.cumdsize => entry.pack.blocks = @intCast(kv.val.int(u64)/512),
|
||||||
.shrasize => { if (entry.dir()) |d| d.shared_size = kv.val.int(u64); },
|
.shrasize => { if (entry.dir()) |d| d.shared_size = kv.val.int(u64); },
|
||||||
.shrdsize => { if (entry.dir()) |d| d.shared_blocks = kv.val.int(u64)/512; },
|
.shrdsize => { if (entry.dir()) |d| d.shared_blocks = kv.val.int(u64)/512; },
|
||||||
.items => { if (entry.dir()) |d| d.items = kv.val.int(u32); },
|
.items => { if (entry.dir()) |d| d.items = util.castClamp(u32, kv.val.int(u64)); },
|
||||||
.sub => { if (entry.dir()) |d| d.sub = .{ .ref = kv.val.itemref(ref) }; },
|
.sub => { if (entry.dir()) |d| d.sub = .{ .ref = kv.val.itemref(ref) }; },
|
||||||
|
|
||||||
.ino => { if (entry.link()) |l| l.ino = kv.val.int(u64); },
|
.ino => { if (entry.link()) |l| l.ino = kv.val.int(u64); },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue