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

+5 -5
View File
@@ -208,7 +208,7 @@ local function inflateChunk(c: Ctx, comp: number, p: number, len: number, out: b
-- a chunk past the end: keep what exists (truncated files)
len = math.max(0, math.min(len, c.limit - p))
if p < c.base or p >= c.limit then
return 0
return 0, nil
end
end
local src, sp = c.b, p
@@ -221,10 +221,10 @@ local function inflateChunk(c: Ctx, comp: number, p: number, len: number, out: b
if comp == 1 then
local n = math.min(len, size)
buffer.copy(out, o, src, sp, n)
return n
return n, nil
elseif comp == 5 then
local n = Lzw.decode(src, sp, len, out, o, size, "tiff")
return n
return n, nil
elseif comp == 8 or comp == 32946 then
local raw = Deflate.zlib(src, sp, len, size)
if not raw then
@@ -235,9 +235,9 @@ local function inflateChunk(c: Ctx, comp: number, p: number, len: number, out: b
end
local n = math.min(buffer.len(raw :: buffer), size)
buffer.copy(out, o, raw :: buffer, 0, n)
return n
return n, nil
elseif comp == 32773 then
return Pixels.packbits(src, sp, len, out, o, size)
return Pixels.packbits(src, sp, len, out, o, size), nil
end
return nil, Err.new(Err.UNSUPPORTED, "compression " .. comp)
end