ws-cleanup-types: Types, api, host: honest annotations; return the full annotated value count

This commit is contained in:
4DBug committed 2026-10-31 10:43:19 -05:00
1 parent 59a0352ca6
commit f209801579
22 files changed
+147 -147

No files matched your search

+6 -6
View File
@@ -169,7 +169,7 @@ local function decodeFolder(ctx: Ctx, s: Header.Streams, f: Header.Folder): (buf
end
local b = buffer.create(size)
buffer.copy(b, 0, src, so, size)
return b
return b, nil
elseif id == "\3\1\1" then
if buffer.len(c.props) < 5 then
return nil, Err.new(Err.CORRUPT, "bad LZMA properties")
@@ -195,7 +195,7 @@ local function decodeFolder(ctx: Ctx, s: Header.Streams, f: Header.Folder): (buf
if buffer.len(b) ~= size then
return nil, Err.new(Err.CORRUPT, methodName(id) .. " stream decodes to the wrong size")
end
return b
return b, nil
elseif FILTERS[id] then
if sl ~= size then
return nil, Err.new(Err.CORRUPT, "filter size mismatch")
@@ -206,7 +206,7 @@ local function decodeFolder(ctx: Ctx, s: Header.Streams, f: Header.Folder): (buf
if not ok then
return nil, e
end
return b
return b, nil
end
return nil, Err.new(Err.UNSUPPORTED, methodName(id) .. " is not supported")
end
@@ -311,7 +311,7 @@ function SevenZip.decode(r: Bytes.Reader, opts: DecodeOptions?): (Types.Archive?
local function folderData(fi: number): (buffer?, Err.Err?)
local c = cache[fi]
if c then
return c
return c, nil
end
local f = s.folders[fi]
local d, e = decodeFolder(ctx, s, f)
@@ -322,7 +322,7 @@ function SevenZip.decode(r: Bytes.Reader, opts: DecodeOptions?): (Types.Archive?
return nil, Err.new(Err.CHECKSUM, "folder CRC-32 mismatch")
end
cache[fi] = d
return d
return d, nil
end
local si = 0
for _, file in parsed.files do
@@ -376,7 +376,7 @@ function SevenZip.decode(r: Bytes.Reader, opts: DecodeOptions?): (Types.Archive?
if checkCrc and want and Crc32.raw(out, 0, size) ~= want then
return nil, Err.new(Err.CHECKSUM, "CRC-32 mismatch in " .. file.name)
end
return out
return out, nil
end
end
Archive.put(a, e)