From dc1218fec0496df3a465ec55a83a92da25e6c1b0 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Mon, 14 Oct 2019 09:28:28 +1100 Subject: [PATCH] Spell std/deflate's "literal/length" consistently --- script/make-artificial.go | 6 +++--- std/deflate/decode_huffman_fast.wuffs | 4 ++-- ...te-degenerate-huffman-unused.deflate.make-artificial.txt | 2 +- .../deflate-huffman-primlen-9.deflate.make-artificial.txt | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/script/make-artificial.go b/script/make-artificial.go index 7a16abe2..61468e86 100644 --- a/script/make-artificial.go +++ b/script/make-artificial.go @@ -245,7 +245,7 @@ var deflateGlobals struct { // Dynamic Huffman state. whichHuffman uint32 - // 0=Unused, 1=CodeLength, 2=Length/Literal, 3=Distance. + // 0=Unused, 1=CodeLength, 2=Literal/Length, 3=Distance. huffmans [4]deflateHuffmanTable // DHH (Dynamic Huffman, inside a Huffman table) state. @@ -325,7 +325,7 @@ func deflateGlobalsWriteDynamicHuffmanTables() error { } } - // Write the Huffman tables for Length/Literal and Distance. + // Write the Huffman tables for Literal/Length and Distance. { numZeroes := uint32(0) for i := uint32(0); i < numLCodes+numDCodes; i++ { @@ -419,7 +419,7 @@ func parseDeflateWhichHuffman(s string) (num uint32, remaining string, ok bool) switch s { case "CodeLength": return 1, remaining, true - case "Length/Literal": + case "Literal/Length": return 2, remaining, true case "Distance": return 3, remaining, true diff --git a/std/deflate/decode_huffman_fast.wuffs b/std/deflate/decode_huffman_fast.wuffs index 3d9185bf..8ea84df9 100644 --- a/std/deflate/decode_huffman_fast.wuffs +++ b/std/deflate/decode_huffman_fast.wuffs @@ -55,8 +55,8 @@ pri func decoder.decode_huffman_fast!(dst: base.io_writer, src: base.io_reader) // RFC section 3.2.5. Compressed blocks (length and distance codes). // // For reading, strictly speaking, we only need 6 bytes (48 bits) of - // available input, because the H-L length/literal code is up to 15 bits - // plus up to 5 extra bits, the H-D distance code is up to 15 bits plus up + // available input, because the H-L Literal/Length code is up to 15 bits + // plus up to 5 extra bits, the H-D Distance code is up to 15 bits plus up // to 13 extra bits and 15 + 5 + 15 + 13 == 48. However, // args.src.available() assertions are made in terms of bytes, not bits. // diff --git a/test/data/artificial/deflate-degenerate-huffman-unused.deflate.make-artificial.txt b/test/data/artificial/deflate-degenerate-huffman-unused.deflate.make-artificial.txt index 841a4c89..063f90c9 100644 --- a/test/data/artificial/deflate-degenerate-huffman-unused.deflate.make-artificial.txt +++ b/test/data/artificial/deflate-degenerate-huffman-unused.deflate.make-artificial.txt @@ -10,7 +10,7 @@ blockDynamicHuffman (final) { 18 11 } - huffman Length/Literal { + huffman Literal/Length { # 102='f', 111='o', 256=EOB 111 0 102 10 diff --git a/test/data/artificial/deflate-huffman-primlen-9.deflate.make-artificial.txt b/test/data/artificial/deflate-huffman-primlen-9.deflate.make-artificial.txt index e4d47575..c60631a4 100644 --- a/test/data/artificial/deflate-huffman-primlen-9.deflate.make-artificial.txt +++ b/test/data/artificial/deflate-huffman-primlen-9.deflate.make-artificial.txt @@ -22,7 +22,7 @@ blockDynamicHuffman (final) { # primLen 9: 852 entries = 512 prim + 340 seco # @1 @2 @3 @4 @5 @6 @7 @8 @9 @10 @11 @12 @13 @14 @15 # 1 1 1 0 0 0 0 0 0; 1 229 49 1 1 2 - huffman Length/Literal { + huffman Literal/Length { 0 0 1 10 2 110