Add io_bind history_position arg

This commit is contained in:
Nigel Tao committed 2021-08-15 08:36:14 +10:00
1 parent b60a2cacd9
commit 28a54baa19
11 files changed
+87 -24

No files matched your search

+1 -1
View File
@@ -929,7 +929,7 @@ pri func decoder.decode_id_part2?(dst: ptr base.pixel_buffer, src: base.io_reade
if (this.compressed_ri > this.compressed_wi) or (this.compressed_wi > 4096) {
return "#internal error: inconsistent ri/wi"
}
io_bind (io: r, data: this.compressed[this.compressed_ri .. this.compressed_wi]) {
io_bind (io: r, data: this.compressed[this.compressed_ri .. this.compressed_wi], history_position: 0) {
mark = r.mark()
lzw_status =? this.lzw.transform_io?(
dst: this.util.empty_io_writer(), src: r, workbuf: this.util.empty_slice_u8())
+1 -1
View File
@@ -574,7 +574,7 @@ pri func decoder.decode_pass?(src: base.io_reader, workbuf: slice base.u8) {
this.pass_workbuf_length > args.workbuf.length()) {
return base."#bad workbuf length"
}
io_bind (io: w, data: args.workbuf[this.workbuf_wi .. this.pass_workbuf_length]) {
io_bind (io: w, data: args.workbuf[this.workbuf_wi .. this.pass_workbuf_length], history_position: this.workbuf_wi) {
io_limit (io: args.src, limit: this.chunk_length) {
w_mark = w.mark()
r_mark = args.src.mark()