mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 08:47:56 +01:00
Fix some built-in methods' effects
This commit is contained in:
1 parent
2919e51575
commit
131732e7eb
8 files changed
+21
-24
No files matched your search
@@ -123,7 +123,7 @@ pub struct decoder?(
|
||||
|
||||
pub func decoder.decode?(dst base.io_writer, src base.io_reader)() {
|
||||
while true {
|
||||
in.dst.set_mark()
|
||||
in.dst.set_mark!()
|
||||
var z base.status = try this.decode_blocks?(dst:in.dst, src:in.src)
|
||||
if not z.is_suspension() {
|
||||
return z
|
||||
@@ -229,7 +229,7 @@ pri func decoder.decode_uncompressed?(dst base.io_writer, src base.io_reader)()
|
||||
}
|
||||
length = length.low_bits(n:16)
|
||||
while true {
|
||||
var n_copied base.u32 = in.dst.copy_from_reader32(r:in.src, length:length)
|
||||
var n_copied base.u32 = in.dst.copy_from_reader32!(r:in.src, length:length)
|
||||
if length <= n_copied {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -318,13 +318,13 @@ pri func decoder.decode_huffman_fast?(dst base.io_writer, src base.io_reader)()
|
||||
// TODO: copy_from_slice32 should probably update the
|
||||
// "in.dst.available() >= 258" fact. It should certainly
|
||||
// invalidate any fact that was "<=" instead of ">=".
|
||||
n_copied = in.dst.copy_from_slice32(
|
||||
n_copied = in.dst.copy_from_slice32!(
|
||||
s:this.history[hdist & 0x7FFF:], length:hlen)
|
||||
if hlen <= n_copied {
|
||||
break
|
||||
}
|
||||
hlen -= n_copied
|
||||
in.dst.copy_from_slice32(s:this.history[:], length:hlen)
|
||||
in.dst.copy_from_slice32!(s:this.history[:], length:hlen)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -348,7 +348,7 @@ pri func decoder.decode_huffman_fast?(dst base.io_writer, src base.io_reader)()
|
||||
assert (length as base.u64) <= in.dst.available() via "a <= b: a <= c; c <= b"(c:258)
|
||||
|
||||
// Copy from in.dst.
|
||||
in.dst.copy_from_history32(distance:(dist_minus_1 + 1), length:length)
|
||||
in.dst.copy_from_history32!(distance:(dist_minus_1 + 1), length:length)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ pri func decoder.decode_huffman_slow?(dst base.io_writer, src base.io_reader)()
|
||||
|
||||
// Copy from hdist to the end of this.history.
|
||||
while true {
|
||||
n_copied = in.dst.copy_from_slice32(
|
||||
n_copied = in.dst.copy_from_slice32!(
|
||||
s:this.history[hdist & 0x7FFF:], length:hlen)
|
||||
if hlen <= n_copied {
|
||||
hlen = 0
|
||||
@@ -226,7 +226,7 @@ pri func decoder.decode_huffman_slow?(dst base.io_writer, src base.io_reader)()
|
||||
// Copy from the start of this.history, if we wrapped around.
|
||||
if hlen > 0 {
|
||||
while true {
|
||||
n_copied = in.dst.copy_from_slice32(
|
||||
n_copied = in.dst.copy_from_slice32!(
|
||||
s:this.history[hdist & 0x7FFF:], length:hlen)
|
||||
if hlen <= n_copied {
|
||||
hlen = 0
|
||||
@@ -246,7 +246,7 @@ pri func decoder.decode_huffman_slow?(dst base.io_writer, src base.io_reader)()
|
||||
}
|
||||
|
||||
// Copy from in.dst.
|
||||
n_copied = in.dst.copy_from_history32(distance:(dist_minus_1 + 1), length:length)
|
||||
n_copied = in.dst.copy_from_history32!(distance:(dist_minus_1 + 1), length:length)
|
||||
if length <= n_copied {
|
||||
length = 0
|
||||
break
|
||||
|
||||
Reference in new issue
Block a user