flate

deflate implementation
git clone git://git.suckless.org/flate
Log | Files | Refs | README

commit 97aea87082581ee94005fb302dc28db3dca92083
parent 119a173e850bddf927f16b6363c52b17c7ebba54
Author: nsz <nszabolcs@gmail.com>
Date:   Wed, 13 May 2009 01:14:36 +0200

inflate_simple more fixes
Diffstat:
inflate_simple.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/inflate_simple.c b/inflate_simple.c @@ -149,7 +149,7 @@ static uint decode_symbol(Stream *s, Huff *h) { return h->symbol[sum + cur]; } -/* decode dynamic huffs from stream */ +/* decode dynamic huffman code trees from stream */ static void decode_huffs(Stream *s) { Huff chuff; uchar lens[Nlitlen+Ndist]; @@ -159,13 +159,13 @@ static void decode_huffs(Stream *s) { nlit = 257 + getbits(s, 5); ndist = 1 + getbits(s, 5); nclen = 4 + getbits(s, 4); - /* build code length huff */ + /* build code length code tree */ for (i = 0; i < Nclen; i++) lens[i] = 0; for (i = 0; i < nclen; i++) lens[clenorder[i]] = getbits(s, 3); build_huff(&chuff, lens, Nclen); - /* decode code lengths for the dynamic huffs */ + /* decode code lengths for the dynamic code tree */ for (i = 0; i < nlit + ndist; ) { uint sym = decode_symbol(s, &chuff); uint len; @@ -188,7 +188,7 @@ static void decode_huffs(Stream *s) { lens[i++] = 0; } } - /* build dynamic huffman huffs */ + /* build dynamic huffman code tree */ build_huff(&s->lhuff, lens, nlit); build_huff(&s->dhuff, lens + nlit, ndist); }