From 8fb56491c6eae8abdabdb2057fa016fcc9d26499 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Fri, 9 Feb 2018 16:19:55 +1100 Subject: [PATCH] Fix set_literal_width effect --- std/gif/decode_gif.wuffs | 2 +- std/gif/decode_lzw.wuffs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/std/gif/decode_gif.wuffs b/std/gif/decode_gif.wuffs index 44d6e888..1e8409e2 100644 --- a/std/gif/decode_gif.wuffs +++ b/std/gif/decode_gif.wuffs @@ -177,7 +177,7 @@ pri func decoder.decode_id?(dst writer1, src reader1)() { if (lw < 2) or (8 < lw) { return error "bad LZW literal width" } - this.lzw.set_literal_width(lw:lw as u32) + this.lzw.set_literal_width!(lw:lw as u32) while true { var block_size u64 = in.src.read_u8?() as u64 diff --git a/std/gif/decode_lzw.wuffs b/std/gif/decode_lzw.wuffs index 80037bb9..05a42b9b 100644 --- a/std/gif/decode_lzw.wuffs +++ b/std/gif/decode_lzw.wuffs @@ -24,8 +24,7 @@ pri struct lzw_decoder?( prefixes[4096] u16[..4095], ) -// TODO: add a ! as this function is impure. -pri func lzw_decoder.set_literal_width(lw u32[2..8] = 8)() { +pri func lzw_decoder.set_literal_width!(lw u32[2..8] = 8)() { this.literal_width = in.lw }