Remove some var refinement lower bounds

This commit is contained in:
Nigel Tao committed 2018-12-26 18:19:19 +11:00
1 parent 7405307173
commit 87b8b44778
2 files changed
+6 -6

No files matched your search

+5 -5
View File
@@ -281,17 +281,17 @@ pri func decoder.init_dynamic_huffman!??(src base.io_reader) {
bits |= b0 << n_bits
n_bits += 8
}
var n_lit base.u32[257..288] = bits.low_bits(n:5) + 257
var n_lit base.u32[..288] = bits.low_bits(n:5) + 257
if n_lit > 286 {
return "?bad literal/length code count"
}
bits >>= 5
var n_dist base.u32[1..32] = bits.low_bits(n:5) + 1
var n_dist base.u32[..32] = bits.low_bits(n:5) + 1
if n_dist > 30 {
return "?bad distance code count"
}
bits >>= 5
var n_clen base.u32[4..19] = bits.low_bits(n:4) + 4
var n_clen base.u32[..19] = bits.low_bits(n:4) + 4
bits >>= 4
n_bits -= 14
@@ -566,7 +566,7 @@ pri func decoder.init_huff!?(which base.u32[..1], n_codes0 base.u32[..320], n_co
// For the clcode example in this package's README.md:
// - min_cl = 3
// - max_cl = 5
var min_cl base.u32[1..9] = 1
var min_cl base.u32[..9] = 1
while true,
inv n_symbols <= 288,
{
@@ -578,7 +578,7 @@ pri func decoder.init_huff!?(which base.u32[..1], n_codes0 base.u32[..320], n_co
}
min_cl += 1
}
var max_cl base.u32[1..15] = 15
var max_cl base.u32[..15] = 15
while true,
inv n_symbols <= 288,
{
+1 -1
View File
@@ -720,7 +720,7 @@ pri func decoder.copy_to_image_buffer!?(pb ptr base.pixel_buffer, src slice base
// TODO: a Wuffs (not just C) name for the WUFFS_BASE__PIXEL_FORMAT__ETC
// magic pixfmt constants. Also, support more formats.
var bytes_per_pixel base.u32[1..64] = 1
var bytes_per_pixel base.u32[..64] = 1
var pixfmt base.u32 = args.pb.pixel_format()
if (pixfmt == 0x45008888) or (pixfmt == 0x55008888) or
(pixfmt == 0x46008888) or (pixfmt == 0x56008888) or