Let a short_src be either an error or a status.

Error-ness depends on whether there's possibly more source data.

Also rename short_dst and short_src to short_write and short_read, as
the new names don't depend on the function arguments being named exactly
dst and src.
This commit is contained in:
Nigel Tao committed 2017-06-04 12:11:37 +10:00
1 parent 9a27953faf
commit e49ec3fd90
5 files changed
+40 -35

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ pub func lzw_decoder.decode?(dst ptr buf1, src ptr buf1, src_final bool)() {
post n_bits >= width,
{
assert n_bits < 12 via "a < b: a < c; c <= b"(c:width)
bits |= in.src.read_u8?() as u32 // TODO
bits |= in.src.read_u8?() as u32 // TODO: read_u8 should take src_final.
n_bits += 8
}
// TODO: var code u32[..4095] = bits.low_bits(width)