diff options
| author | 1998-09-08 03:32:04 +0000 | |
|---|---|---|
| committer | 1998-09-08 03:32:04 +0000 | |
| commit | 7bf9a2763d4c6722c26313e89db41240978c7839 (patch) | |
| tree | 1fc1360041c7c04947b6b5524191ff1923a017b5 /sys/lib/libz/inftrees.c | |
| parent | changed order of ifmedia_add's (purely cosmetic) (diff) | |
| download | wireguard-openbsd-7bf9a2763d4c6722c26313e89db41240978c7839.tar.xz wireguard-openbsd-7bf9a2763d4c6722c26313e89db41240978c7839.zip | |
Update from zlib-1.1.3. These should really just be references to ../../../lib/libz/*
Diffstat (limited to 'sys/lib/libz/inftrees.c')
| -rw-r--r-- | sys/lib/libz/inftrees.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sys/lib/libz/inftrees.c b/sys/lib/libz/inftrees.c index 02ddb678223..90205bd1e57 100644 --- a/sys/lib/libz/inftrees.c +++ b/sys/lib/libz/inftrees.c @@ -1,5 +1,3 @@ -/* $OpenBSD: inftrees.c,v 1.6 1998/05/30 02:20:52 mickey Exp $ */ - /* inftrees.c -- generate Huffman trees for efficient decoding * Copyright (C) 1995-1996 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h @@ -8,8 +6,7 @@ #include "zutil.h" #include "inftrees.h" -const char inflate_copyright[] = "inflate 1.0.4 Copyright 1995-1996 Mark Adler"; - +char inflate_copyright[] = " inflate 1.0.4 Copyright 1995-1996 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome in the documentation of your product. If for some reason you cannot @@ -29,8 +26,8 @@ local int huft_build OF(( uIntf *, /* code lengths in bits */ uInt, /* number of codes */ uInt, /* number of "simple" codes */ - const uIntf *, /* list of base values for non-simple codes */ - const uIntf *, /* list of extra bits for non-simple codes */ + uIntf *, /* list of base values for non-simple codes */ + uIntf *, /* list of extra bits for non-simple codes */ inflate_huft * FAR*,/* result: starting table */ uIntf *, /* maximum lookup bits (returns actual) */ z_streamp )); /* for zalloc function */ @@ -41,18 +38,18 @@ local voidpf falloc OF(( uInt)); /* size of item */ /* Tables for deflate from PKZIP's appnote.txt. */ -local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ +local uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; /* actually lengths - 2; also see note #13 above about 258 */ -local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ +local uInt cplext[31] = { /* Extra bits for literal codes 257..285 */ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 192, 192}; /* 192==invalid */ -local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ +local uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; -local const uInt cpdext[30] = { /* Extra bits for distance codes */ +local uInt cpdext[30] = { /* Extra bits for distance codes */ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; @@ -94,7 +91,7 @@ local const uInt cpdext[30] = { /* Extra bits for distance codes */ #define BMAX 15 /* maximum bit length of any code */ #define N_MAX 288 /* maximum number of codes in any set */ -#ifdef DEBUG_ZLIB +#ifdef DEBUG uInt inflate_hufts; #endif @@ -102,8 +99,8 @@ local int huft_build(b, n, s, d, e, t, m, zs) uIntf *b; /* code lengths in bits (all assumed <= BMAX) */ uInt n; /* number of codes (assumed <= N_MAX) */ uInt s; /* number of simple-valued codes (0..s-1) */ -const uIntf *d; /* list of base values for non-simple codes */ -const uIntf *e; /* list of extra bits for non-simple codes */ +uIntf *d; /* list of base values for non-simple codes */ +uIntf *e; /* list of extra bits for non-simple codes */ inflate_huft * FAR *t; /* result: starting table */ uIntf *m; /* maximum lookup bits, returns actual */ z_streamp zs; /* for zalloc function */ @@ -242,7 +239,7 @@ z_streamp zs; /* for zalloc function */ inflate_trees_free(u[0], zs); return Z_MEM_ERROR; /* not enough memory */ } -#ifdef DEBUG_ZLIB +#ifdef DEBUG inflate_hufts += z + 1; #endif *t = q + 1; /* link to list for huft_free() */ |
