Commit ff8009c0 authored by Jörn Engel's avatar Jörn Engel Committed by Linus Torvalds

[PATCH] zlib cleanup: remove FAR macro

This removes FAR, the typedefs using FAR (Bytef and friends) and the
function prototypes for zalloc and zfree that should have gone earlier
already.
parent 412858d5
...@@ -66,21 +66,10 @@ ...@@ -66,21 +66,10 @@
#ifndef ZEXTERN #ifndef ZEXTERN
# define ZEXTERN extern # define ZEXTERN extern
#endif #endif
#ifndef FAR
# define FAR
#endif
typedef unsigned char Byte; /* 8 bits */ typedef unsigned char Byte; /* 8 bits */
typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */ typedef unsigned long uLong; /* 32 bits or more */
typedef Byte FAR Bytef;
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
typedef void FAR *voidpf;
typedef void *voidp; typedef void *voidp;
#include <linux/types.h> /* for off_t */ #include <linux/types.h> /* for off_t */
......
...@@ -60,22 +60,19 @@ extern "C" { ...@@ -60,22 +60,19 @@ extern "C" {
crash even in case of corrupted input. crash even in case of corrupted input.
*/ */
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
typedef void (*free_func) OF((voidpf opaque, voidpf address));
struct internal_state; struct internal_state;
typedef struct z_stream_s { typedef struct z_stream_s {
Bytef *next_in; /* next input byte */ Byte *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */ uInt avail_in; /* number of bytes available at next_in */
uLong total_in; /* total nb of input bytes read so far */ uLong total_in; /* total nb of input bytes read so far */
Bytef *next_out; /* next output byte should be put there */ Byte *next_out; /* next output byte should be put there */
uInt avail_out; /* remaining free space at next_out */ uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */ uLong total_out; /* total nb of bytes output so far */
char *msg; /* last error message, NULL if no error */ char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */ struct internal_state *state; /* not visible by applications */
void *workspace; /* memory allocated for this stream */ void *workspace; /* memory allocated for this stream */
...@@ -84,7 +81,7 @@ typedef struct z_stream_s { ...@@ -84,7 +81,7 @@ typedef struct z_stream_s {
uLong reserved; /* reserved for future use */ uLong reserved; /* reserved for future use */
} z_stream; } z_stream;
typedef z_stream FAR *z_streamp; typedef z_stream *z_streamp;
/* /*
The application must update next_in and avail_in when avail_in has The application must update next_in and avail_in when avail_in has
...@@ -452,7 +449,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, ...@@ -452,7 +449,7 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
*/ */
ZEXTERN int ZEXPORT zlib_deflateSetDictionary OF((z_streamp strm, ZEXTERN int ZEXPORT zlib_deflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary, const Byte *dictionary,
uInt dictLength)); uInt dictLength));
/* /*
Initializes the compression dictionary from the given byte sequence Initializes the compression dictionary from the given byte sequence
...@@ -561,7 +558,7 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, ...@@ -561,7 +558,7 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
*/ */
ZEXTERN int ZEXPORT zlib_inflateSetDictionary OF((z_streamp strm, ZEXTERN int ZEXPORT zlib_inflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary, const Byte *dictionary,
uInt dictLength)); uInt dictLength));
/* /*
Initializes the decompression dictionary from the given uncompressed byte Initializes the decompression dictionary from the given uncompressed byte
...@@ -643,9 +640,9 @@ ZEXTERN int ZEXPORT zlib_inflateInit2_ OF((z_streamp strm, int windowBits, ...@@ -643,9 +640,9 @@ ZEXTERN int ZEXPORT zlib_inflateInit2_ OF((z_streamp strm, int windowBits,
struct internal_state {int dummy;}; /* hack for buggy compilers */ struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif #endif
ZEXTERN const char * ZEXPORT zlib_zError OF((int err)); ZEXTERN const char * ZEXPORT zlib_zError OF((int err));
ZEXTERN int ZEXPORT zlib_inflateSyncPoint OF((z_streamp z)); ZEXTERN int ZEXPORT zlib_inflateSyncPoint OF((z_streamp z));
ZEXTERN const uLongf * ZEXPORT zlib_get_crc_table OF((void)); ZEXTERN const uLong * ZEXPORT zlib_get_crc_table OF((void));
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
/* compile with -Dlocal if your debugger can't find static symbols */ /* compile with -Dlocal if your debugger can't find static symbols */
typedef unsigned char uch; typedef unsigned char uch;
typedef uch FAR uchf;
typedef unsigned short ush; typedef unsigned short ush;
typedef ush FAR ushf;
typedef unsigned long ulg; typedef unsigned long ulg;
/* common constants */ /* common constants */
...@@ -64,7 +62,7 @@ typedef unsigned long ulg; ...@@ -64,7 +62,7 @@ typedef unsigned long ulg;
/* functions */ /* functions */
typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, typedef uLong (ZEXPORT *check_func) OF((uLong check, const Byte *buf,
uInt len)); uInt len));
...@@ -96,7 +94,7 @@ typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, ...@@ -96,7 +94,7 @@ typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
if (adler != original_adler) error(); if (adler != original_adler) error();
*/ */
static inline uLong zlib_adler32(uLong adler, static inline uLong zlib_adler32(uLong adler,
const Bytef *buf, const Byte *buf,
uInt len) uInt len)
{ {
unsigned long s1 = adler & 0xffff; unsigned long s1 = adler & 0xffff;
......
...@@ -73,7 +73,7 @@ local block_state deflate_slow OF((deflate_state *s, int flush)); ...@@ -73,7 +73,7 @@ local block_state deflate_slow OF((deflate_state *s, int flush));
local void lm_init OF((deflate_state *s)); local void lm_init OF((deflate_state *s));
local void putShortMSB OF((deflate_state *s, uInt b)); local void putShortMSB OF((deflate_state *s, uInt b));
local void flush_pending OF((z_streamp strm)); local void flush_pending OF((z_streamp strm));
local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); local int read_buf OF((z_streamp strm, Byte *buf, unsigned size));
local uInt longest_match OF((deflate_state *s, IPos cur_match)); local uInt longest_match OF((deflate_state *s, IPos cur_match));
#ifdef DEBUG_ZLIB #ifdef DEBUG_ZLIB
...@@ -161,7 +161,7 @@ local const config configuration_table[10] = { ...@@ -161,7 +161,7 @@ local const config configuration_table[10] = {
*/ */
#define CLEAR_HASH(s) \ #define CLEAR_HASH(s) \
s->head[s->hash_size-1] = NIL; \ s->head[s->hash_size-1] = NIL; \
memset((charf *)s->head, 0, (unsigned)(s->hash_size-1)*sizeof(*s->head)); memset((char *)s->head, 0, (unsigned)(s->hash_size-1)*sizeof(*s->head));
/* ========================================================================= */ /* ========================================================================= */
int zlib_deflateInit_( int zlib_deflateInit_(
...@@ -194,7 +194,7 @@ int zlib_deflateInit2_( ...@@ -194,7 +194,7 @@ int zlib_deflateInit2_(
static char* my_version = ZLIB_VERSION; static char* my_version = ZLIB_VERSION;
deflate_workspace *mem; deflate_workspace *mem;
ushf *overlay; ush *overlay;
/* We overlay pending_buf and d_buf+l_buf. This works since the average /* We overlay pending_buf and d_buf+l_buf. This works since the average
* output size for (length,distance) codes is <= 24 bits. * output size for (length,distance) codes is <= 24 bits.
*/ */
...@@ -221,7 +221,7 @@ int zlib_deflateInit2_( ...@@ -221,7 +221,7 @@ int zlib_deflateInit2_(
return Z_STREAM_ERROR; return Z_STREAM_ERROR;
} }
s = (deflate_state *) &(mem->deflate_memory); s = (deflate_state *) &(mem->deflate_memory);
strm->state = (struct internal_state FAR *)s; strm->state = (struct internal_state *)s;
s->strm = strm; s->strm = strm;
s->noheader = noheader; s->noheader = noheader;
...@@ -234,14 +234,14 @@ int zlib_deflateInit2_( ...@@ -234,14 +234,14 @@ int zlib_deflateInit2_(
s->hash_mask = s->hash_size - 1; s->hash_mask = s->hash_size - 1;
s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
s->window = (Bytef *) mem->window_memory; s->window = (Byte *) mem->window_memory;
s->prev = (Posf *) mem->prev_memory; s->prev = (Pos *) mem->prev_memory;
s->head = (Posf *) mem->head_memory; s->head = (Pos *) mem->head_memory;
s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */ s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
overlay = (ushf *) mem->overlay_memory; overlay = (ush *) mem->overlay_memory;
s->pending_buf = (uchf *) overlay; s->pending_buf = (uch *) overlay;
s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L); s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
s->d_buf = overlay + s->lit_bufsize/sizeof(ush); s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
...@@ -257,7 +257,7 @@ int zlib_deflateInit2_( ...@@ -257,7 +257,7 @@ int zlib_deflateInit2_(
/* ========================================================================= */ /* ========================================================================= */
int zlib_deflateSetDictionary( int zlib_deflateSetDictionary(
z_streamp strm, z_streamp strm,
const Bytef *dictionary, const Byte *dictionary,
uInt dictLength uInt dictLength
) )
{ {
...@@ -281,7 +281,7 @@ int zlib_deflateSetDictionary( ...@@ -281,7 +281,7 @@ int zlib_deflateSetDictionary(
dictionary += dictLength - length; /* use the tail of the dictionary */ dictionary += dictLength - length; /* use the tail of the dictionary */
#endif #endif
} }
memcpy((charf *)s->window, dictionary, length); memcpy((char *)s->window, dictionary, length);
s->strstart = length; s->strstart = length;
s->block_start = (long)length; s->block_start = (long)length;
...@@ -580,7 +580,7 @@ int zlib_deflateCopy ( ...@@ -580,7 +580,7 @@ int zlib_deflateCopy (
#else #else
deflate_state *ds; deflate_state *ds;
deflate_state *ss; deflate_state *ss;
ushf *overlay; ush *overlay;
deflate_workspace *mem; deflate_workspace *mem;
...@@ -596,15 +596,15 @@ int zlib_deflateCopy ( ...@@ -596,15 +596,15 @@ int zlib_deflateCopy (
ds = &(mem->deflate_memory); ds = &(mem->deflate_memory);
dest->state = (struct internal_state FAR *) ds; dest->state = (struct internal_state *) ds;
*ds = *ss; *ds = *ss;
ds->strm = dest; ds->strm = dest;
ds->window = (Bytef *) mem->window_memory; ds->window = (Byte *) mem->window_memory;
ds->prev = (Posf *) mem->prev_memory; ds->prev = (Pos *) mem->prev_memory;
ds->head = (Posf *) mem->head_memory; ds->head = (Pos *) mem->head_memory;
overlay = (ushf *) mem->overlay_memory; overlay = (ush *) mem->overlay_memory;
ds->pending_buf = (uchf *) overlay; ds->pending_buf = (uch *) overlay;
memcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte)); memcpy(ds->window, ss->window, ds->w_size * 2 * sizeof(Byte));
memcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos)); memcpy(ds->prev, ss->prev, ds->w_size * sizeof(Pos));
...@@ -632,7 +632,7 @@ int zlib_deflateCopy ( ...@@ -632,7 +632,7 @@ int zlib_deflateCopy (
*/ */
local int read_buf( local int read_buf(
z_streamp strm, z_streamp strm,
Bytef *buf, Byte *buf,
unsigned size unsigned size
) )
{ {
...@@ -695,8 +695,8 @@ local uInt longest_match(s, cur_match) ...@@ -695,8 +695,8 @@ local uInt longest_match(s, cur_match)
IPos cur_match; /* current match */ IPos cur_match; /* current match */
{ {
unsigned chain_length = s->max_chain_length;/* max hash chain length */ unsigned chain_length = s->max_chain_length;/* max hash chain length */
register Bytef *scan = s->window + s->strstart; /* current string */ register Byte *scan = s->window + s->strstart; /* current string */
register Bytef *match; /* matched string */ register Byte *match; /* matched string */
register int len; /* length of current match */ register int len; /* length of current match */
int best_len = s->prev_length; /* best match length so far */ int best_len = s->prev_length; /* best match length so far */
int nice_match = s->nice_match; /* stop if match long enough */ int nice_match = s->nice_match; /* stop if match long enough */
...@@ -705,18 +705,18 @@ local uInt longest_match(s, cur_match) ...@@ -705,18 +705,18 @@ local uInt longest_match(s, cur_match)
/* Stop when cur_match becomes <= limit. To simplify the code, /* Stop when cur_match becomes <= limit. To simplify the code,
* we prevent matches with the string of window index 0. * we prevent matches with the string of window index 0.
*/ */
Posf *prev = s->prev; Pos *prev = s->prev;
uInt wmask = s->w_mask; uInt wmask = s->w_mask;
#ifdef UNALIGNED_OK #ifdef UNALIGNED_OK
/* Compare two bytes at a time. Note: this is not always beneficial. /* Compare two bytes at a time. Note: this is not always beneficial.
* Try with and without -DUNALIGNED_OK to check. * Try with and without -DUNALIGNED_OK to check.
*/ */
register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; register Byte *strend = s->window + s->strstart + MAX_MATCH - 1;
register ush scan_start = *(ushf*)scan; register ush scan_start = *(ush*)scan;
register ush scan_end = *(ushf*)(scan+best_len-1); register ush scan_end = *(ush*)(scan+best_len-1);
#else #else
register Bytef *strend = s->window + s->strstart + MAX_MATCH; register Byte *strend = s->window + s->strstart + MAX_MATCH;
register Byte scan_end1 = scan[best_len-1]; register Byte scan_end1 = scan[best_len-1];
register Byte scan_end = scan[best_len]; register Byte scan_end = scan[best_len];
#endif #endif
...@@ -748,8 +748,8 @@ local uInt longest_match(s, cur_match) ...@@ -748,8 +748,8 @@ local uInt longest_match(s, cur_match)
/* This code assumes sizeof(unsigned short) == 2. Do not use /* This code assumes sizeof(unsigned short) == 2. Do not use
* UNALIGNED_OK if your compiler uses a different size. * UNALIGNED_OK if your compiler uses a different size.
*/ */
if (*(ushf*)(match+best_len-1) != scan_end || if (*(ush*)(match+best_len-1) != scan_end ||
*(ushf*)match != scan_start) continue; *(ush*)match != scan_start) continue;
/* It is not necessary to compare scan[2] and match[2] since they are /* It is not necessary to compare scan[2] and match[2] since they are
* always equal when the other bytes match, given that the hash keys * always equal when the other bytes match, given that the hash keys
...@@ -763,10 +763,10 @@ local uInt longest_match(s, cur_match) ...@@ -763,10 +763,10 @@ local uInt longest_match(s, cur_match)
Assert(scan[2] == match[2], "scan[2]?"); Assert(scan[2] == match[2], "scan[2]?");
scan++, match++; scan++, match++;
do { do {
} while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) && } while (*(ush*)(scan+=2) == *(ush*)(match+=2) &&
*(ushf*)(scan+=2) == *(ushf*)(match+=2) && *(ush*)(scan+=2) == *(ush*)(match+=2) &&
*(ushf*)(scan+=2) == *(ushf*)(match+=2) && *(ush*)(scan+=2) == *(ush*)(match+=2) &&
*(ushf*)(scan+=2) == *(ushf*)(match+=2) && *(ush*)(scan+=2) == *(ush*)(match+=2) &&
scan < strend); scan < strend);
/* The funny "do {}" generates better code on most compilers */ /* The funny "do {}" generates better code on most compilers */
...@@ -815,7 +815,7 @@ local uInt longest_match(s, cur_match) ...@@ -815,7 +815,7 @@ local uInt longest_match(s, cur_match)
best_len = len; best_len = len;
if (len >= nice_match) break; if (len >= nice_match) break;
#ifdef UNALIGNED_OK #ifdef UNALIGNED_OK
scan_end = *(ushf*)(scan+best_len-1); scan_end = *(ush*)(scan+best_len-1);
#else #else
scan_end1 = scan[best_len-1]; scan_end1 = scan[best_len-1];
scan_end = scan[best_len]; scan_end = scan[best_len];
...@@ -838,8 +838,8 @@ local void check_match(s, start, match, length) ...@@ -838,8 +838,8 @@ local void check_match(s, start, match, length)
int length; int length;
{ {
/* check that the match is indeed a match */ /* check that the match is indeed a match */
if (memcmp((charf *)s->window + match, if (memcmp((char *)s->window + match,
(charf *)s->window + start, length) != EQUAL) { (char *)s->window + start, length) != EQUAL) {
fprintf(stderr, " start %u, match %u, length %d\n", fprintf(stderr, " start %u, match %u, length %d\n",
start, match, length); start, match, length);
do { do {
...@@ -870,7 +870,7 @@ local void fill_window(s) ...@@ -870,7 +870,7 @@ local void fill_window(s)
deflate_state *s; deflate_state *s;
{ {
register unsigned n, m; register unsigned n, m;
register Posf *p; register Pos *p;
unsigned more; /* Amount of free space at the end of the window. */ unsigned more; /* Amount of free space at the end of the window. */
uInt wsize = s->w_size; uInt wsize = s->w_size;
...@@ -892,7 +892,7 @@ local void fill_window(s) ...@@ -892,7 +892,7 @@ local void fill_window(s)
*/ */
} else if (s->strstart >= wsize+MAX_DIST(s)) { } else if (s->strstart >= wsize+MAX_DIST(s)) {
memcpy((charf *)s->window, (charf *)s->window+wsize, memcpy((char *)s->window, (char *)s->window+wsize,
(unsigned)wsize); (unsigned)wsize);
s->match_start -= wsize; s->match_start -= wsize;
s->strstart -= wsize; /* we now have strstart >= MAX_DIST */ s->strstart -= wsize; /* we now have strstart >= MAX_DIST */
...@@ -961,8 +961,8 @@ local void fill_window(s) ...@@ -961,8 +961,8 @@ local void fill_window(s)
*/ */
#define FLUSH_BLOCK_ONLY(s, eof) { \ #define FLUSH_BLOCK_ONLY(s, eof) { \
zlib_tr_flush_block(s, (s->block_start >= 0L ? \ zlib_tr_flush_block(s, (s->block_start >= 0L ? \
(charf *)&s->window[(unsigned)s->block_start] : \ (char *)&s->window[(unsigned)s->block_start] : \
(charf *)Z_NULL), \ (char *)Z_NULL), \
(ulg)((long)s->strstart - s->block_start), \ (ulg)((long)s->strstart - s->block_start), \
(eof)); \ (eof)); \
s->block_start = s->strstart; \ s->block_start = s->strstart; \
......
...@@ -113,7 +113,7 @@ local int base_dist[D_CODES]; ...@@ -113,7 +113,7 @@ local int base_dist[D_CODES];
struct static_tree_desc_s { struct static_tree_desc_s {
const ct_data *static_tree; /* static tree or NULL */ const ct_data *static_tree; /* static tree or NULL */
const intf *extra_bits; /* extra bits for each code or NULL */ const int *extra_bits; /* extra bits for each code or NULL */
int extra_base; /* base index for extra_bits */ int extra_base; /* base index for extra_bits */
int elems; /* max number of elements in the tree */ int elems; /* max number of elements in the tree */
int max_length; /* max bit length for the codes */ int max_length; /* max bit length for the codes */
...@@ -136,7 +136,7 @@ local void tr_static_init OF((void)); ...@@ -136,7 +136,7 @@ local void tr_static_init OF((void));
local void init_block OF((deflate_state *s)); local void init_block OF((deflate_state *s));
local void pqdownheap OF((deflate_state *s, ct_data *tree, int k)); local void pqdownheap OF((deflate_state *s, ct_data *tree, int k));
local void gen_bitlen OF((deflate_state *s, tree_desc *desc)); local void gen_bitlen OF((deflate_state *s, tree_desc *desc));
local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count)); local void gen_codes OF((ct_data *tree, int max_code, ush *bl_count));
local void build_tree OF((deflate_state *s, tree_desc *desc)); local void build_tree OF((deflate_state *s, tree_desc *desc));
local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code)); local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));
local void send_tree OF((deflate_state *s, ct_data *tree, int max_code)); local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
...@@ -149,7 +149,7 @@ local void set_data_type OF((deflate_state *s)); ...@@ -149,7 +149,7 @@ local void set_data_type OF((deflate_state *s));
local unsigned bi_reverse OF((unsigned value, int length)); local unsigned bi_reverse OF((unsigned value, int length));
local void bi_windup OF((deflate_state *s)); local void bi_windup OF((deflate_state *s));
local void bi_flush OF((deflate_state *s)); local void bi_flush OF((deflate_state *s));
local void copy_block OF((deflate_state *s, charf *buf, unsigned len, local void copy_block OF((deflate_state *s, char *buf, unsigned len,
int header)); int header));
#ifndef DEBUG_ZLIB #ifndef DEBUG_ZLIB
...@@ -414,7 +414,7 @@ local void gen_bitlen( ...@@ -414,7 +414,7 @@ local void gen_bitlen(
ct_data *tree = desc->dyn_tree; ct_data *tree = desc->dyn_tree;
int max_code = desc->max_code; int max_code = desc->max_code;
const ct_data *stree = desc->stat_desc->static_tree; const ct_data *stree = desc->stat_desc->static_tree;
const intf *extra = desc->stat_desc->extra_bits; const int *extra = desc->stat_desc->extra_bits;
int base = desc->stat_desc->extra_base; int base = desc->stat_desc->extra_base;
int max_length = desc->stat_desc->max_length; int max_length = desc->stat_desc->max_length;
int h; /* heap index */ int h; /* heap index */
...@@ -497,7 +497,7 @@ local void gen_bitlen( ...@@ -497,7 +497,7 @@ local void gen_bitlen(
local void gen_codes( local void gen_codes(
ct_data *tree, /* the tree to decorate */ ct_data *tree, /* the tree to decorate */
int max_code, /* largest code with non zero frequency */ int max_code, /* largest code with non zero frequency */
ushf *bl_count /* number of codes at each bit length */ ush *bl_count /* number of codes at each bit length */
) )
{ {
ush next_code[MAX_BITS+1]; /* next code value for each bit length */ ush next_code[MAX_BITS+1]; /* next code value for each bit length */
...@@ -793,7 +793,7 @@ local void send_all_trees( ...@@ -793,7 +793,7 @@ local void send_all_trees(
*/ */
void zlib_tr_stored_block( void zlib_tr_stored_block(
deflate_state *s, deflate_state *s,
charf *buf, /* input block */ char *buf, /* input block */
ulg stored_len, /* length of input block */ ulg stored_len, /* length of input block */
int eof /* true if this is the last block for a file */ int eof /* true if this is the last block for a file */
) )
...@@ -857,7 +857,7 @@ void zlib_tr_align( ...@@ -857,7 +857,7 @@ void zlib_tr_align(
*/ */
ulg zlib_tr_flush_block( ulg zlib_tr_flush_block(
deflate_state *s, deflate_state *s,
charf *buf, /* input block, or NULL if too old */ char *buf, /* input block, or NULL if too old */
ulg stored_len, /* length of input block */ ulg stored_len, /* length of input block */
int eof /* true if this is the last block for a file */ int eof /* true if this is the last block for a file */
) )
...@@ -914,7 +914,7 @@ ulg zlib_tr_flush_block( ...@@ -914,7 +914,7 @@ ulg zlib_tr_flush_block(
if (stored_len <= opt_lenb && eof && s->compressed_len==0L && seekable()) { if (stored_len <= opt_lenb && eof && s->compressed_len==0L && seekable()) {
# endif # endif
/* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */ /* Since LIT_BUFSIZE <= 2*WSIZE, the input data must be there: */
if (buf == (charf*)0) error ("block vanished"); if (buf == (char*)0) error ("block vanished");
copy_block(s, buf, (unsigned)stored_len, 0); /* without header */ copy_block(s, buf, (unsigned)stored_len, 0); /* without header */
s->compressed_len = stored_len << 3; s->compressed_len = stored_len << 3;
...@@ -1090,7 +1090,7 @@ local void set_data_type( ...@@ -1090,7 +1090,7 @@ local void set_data_type(
*/ */
local void copy_block( local void copy_block(
deflate_state *s, deflate_state *s,
charf *buf, /* the input data */ char *buf, /* the input data */
unsigned len, /* its length */ unsigned len, /* its length */
int header /* true if block header must be written */ int header /* true if block header must be written */
) )
......
...@@ -46,7 +46,7 @@ typedef struct ct_data_s { ...@@ -46,7 +46,7 @@ typedef struct ct_data_s {
ush dad; /* father node in Huffman tree */ ush dad; /* father node in Huffman tree */
ush len; /* length of bit string */ ush len; /* length of bit string */
} dl; } dl;
} FAR ct_data; } ct_data;
#define Freq fc.freq #define Freq fc.freq
#define Code fc.code #define Code fc.code
...@@ -59,10 +59,9 @@ typedef struct tree_desc_s { ...@@ -59,10 +59,9 @@ typedef struct tree_desc_s {
ct_data *dyn_tree; /* the dynamic tree */ ct_data *dyn_tree; /* the dynamic tree */
int max_code; /* largest code with non zero frequency */ int max_code; /* largest code with non zero frequency */
static_tree_desc *stat_desc; /* the corresponding static tree */ static_tree_desc *stat_desc; /* the corresponding static tree */
} FAR tree_desc; } tree_desc;
typedef ush Pos; typedef ush Pos;
typedef Pos FAR Posf;
typedef unsigned IPos; typedef unsigned IPos;
/* A Pos is an index in the character window. We use short instead of int to /* A Pos is an index in the character window. We use short instead of int to
...@@ -72,9 +71,9 @@ typedef unsigned IPos; ...@@ -72,9 +71,9 @@ typedef unsigned IPos;
typedef struct deflate_state { typedef struct deflate_state {
z_streamp strm; /* pointer back to this zlib stream */ z_streamp strm; /* pointer back to this zlib stream */
int status; /* as the name implies */ int status; /* as the name implies */
Bytef *pending_buf; /* output still pending */ Byte *pending_buf; /* output still pending */
ulg pending_buf_size; /* size of pending_buf */ ulg pending_buf_size; /* size of pending_buf */
Bytef *pending_out; /* next pending byte to output to the stream */ Byte *pending_out; /* next pending byte to output to the stream */
int pending; /* nb of bytes in the pending buffer */ int pending; /* nb of bytes in the pending buffer */
int noheader; /* suppress zlib header and adler32 */ int noheader; /* suppress zlib header and adler32 */
Byte data_type; /* UNKNOWN, BINARY or ASCII */ Byte data_type; /* UNKNOWN, BINARY or ASCII */
...@@ -87,7 +86,7 @@ typedef struct deflate_state { ...@@ -87,7 +86,7 @@ typedef struct deflate_state {
uInt w_bits; /* log2(w_size) (8..16) */ uInt w_bits; /* log2(w_size) (8..16) */
uInt w_mask; /* w_size - 1 */ uInt w_mask; /* w_size - 1 */
Bytef *window; Byte *window;
/* Sliding window. Input bytes are read into the second half of the window, /* Sliding window. Input bytes are read into the second half of the window,
* and move to the first half later to keep a dictionary of at least wSize * and move to the first half later to keep a dictionary of at least wSize
* bytes. With this organization, matches are limited to a distance of * bytes. With this organization, matches are limited to a distance of
...@@ -102,13 +101,13 @@ typedef struct deflate_state { ...@@ -102,13 +101,13 @@ typedef struct deflate_state {
* is directly used as sliding window. * is directly used as sliding window.
*/ */
Posf *prev; Pos *prev;
/* Link to older string with same hash index. To limit the size of this /* Link to older string with same hash index. To limit the size of this
* array to 64K, this link is maintained only for the last 32K strings. * array to 64K, this link is maintained only for the last 32K strings.
* An index in this array is thus a window index modulo 32K. * An index in this array is thus a window index modulo 32K.
*/ */
Posf *head; /* Heads of the hash chains or NIL. */ Pos *head; /* Heads of the hash chains or NIL. */
uInt ins_h; /* hash index of string to be inserted */ uInt ins_h; /* hash index of string to be inserted */
uInt hash_size; /* number of elements in hash table */ uInt hash_size; /* number of elements in hash table */
...@@ -188,7 +187,7 @@ typedef struct deflate_state { ...@@ -188,7 +187,7 @@ typedef struct deflate_state {
/* Depth of each subtree used as tie breaker for trees of equal frequency /* Depth of each subtree used as tie breaker for trees of equal frequency
*/ */
uchf *l_buf; /* buffer for literals or lengths */ uch *l_buf; /* buffer for literals or lengths */
uInt lit_bufsize; uInt lit_bufsize;
/* Size of match buffer for literals/lengths. There are 4 reasons for /* Size of match buffer for literals/lengths. There are 4 reasons for
...@@ -212,7 +211,7 @@ typedef struct deflate_state { ...@@ -212,7 +211,7 @@ typedef struct deflate_state {
uInt last_lit; /* running index in l_buf */ uInt last_lit; /* running index in l_buf */
ushf *d_buf; ush *d_buf;
/* Buffer for distances. To simplify the code, d_buf and l_buf have /* Buffer for distances. To simplify the code, d_buf and l_buf have
* the same number of elements. To use different lengths, an extra flag * the same number of elements. To use different lengths, an extra flag
* array would be necessary. * array would be necessary.
...@@ -237,7 +236,7 @@ typedef struct deflate_state { ...@@ -237,7 +236,7 @@ typedef struct deflate_state {
* are always zero. * are always zero.
*/ */
} FAR deflate_state; } deflate_state;
typedef struct deflate_workspace { typedef struct deflate_workspace {
/* State memory for the deflator */ /* State memory for the deflator */
...@@ -267,10 +266,10 @@ typedef struct deflate_workspace { ...@@ -267,10 +266,10 @@ typedef struct deflate_workspace {
/* in trees.c */ /* in trees.c */
void zlib_tr_init OF((deflate_state *s)); void zlib_tr_init OF((deflate_state *s));
int zlib_tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); int zlib_tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
ulg zlib_tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, ulg zlib_tr_flush_block OF((deflate_state *s, char *buf, ulg stored_len,
int eof)); int eof));
void zlib_tr_align OF((deflate_state *s)); void zlib_tr_align OF((deflate_state *s));
void zlib_tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, void zlib_tr_stored_block OF((deflate_state *s, char *buf, ulg stored_len,
int eof)); int eof));
void zlib_tr_stored_type_only OF((deflate_state *)); void zlib_tr_stored_type_only OF((deflate_state *));
......
...@@ -68,7 +68,7 @@ local const uInt border[] = { /* Order of the bit length code lengths */ ...@@ -68,7 +68,7 @@ local const uInt border[] = { /* Order of the bit length code lengths */
void zlib_inflate_blocks_reset( void zlib_inflate_blocks_reset(
inflate_blocks_statef *s, inflate_blocks_statef *s,
z_streamp z, z_streamp z,
uLongf *c uLong *c
) )
{ {
if (c != Z_NULL) if (c != Z_NULL)
...@@ -80,7 +80,7 @@ void zlib_inflate_blocks_reset( ...@@ -80,7 +80,7 @@ void zlib_inflate_blocks_reset(
s->bitb = 0; s->bitb = 0;
s->read = s->write = s->window; s->read = s->write = s->window;
if (s->checkfn != Z_NULL) if (s->checkfn != Z_NULL)
z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0); z->adler = s->check = (*s->checkfn)(0L, (const Byte *)Z_NULL, 0);
} }
inflate_blocks_statef *zlib_inflate_blocks_new( inflate_blocks_statef *zlib_inflate_blocks_new(
...@@ -111,9 +111,9 @@ int zlib_inflate_blocks( ...@@ -111,9 +111,9 @@ int zlib_inflate_blocks(
uInt t; /* temporary storage */ uInt t; /* temporary storage */
uLong b; /* bit buffer */ uLong b; /* bit buffer */
uInt k; /* bits in bit buffer */ uInt k; /* bits in bit buffer */
Bytef *p; /* input data pointer */ Byte *p; /* input data pointer */
uInt n; /* bytes available there */ uInt n; /* bytes available there */
Bytef *q; /* output window write pointer */ Byte *q; /* output window write pointer */
uInt m; /* bytes to end of window or read pointer */ uInt m; /* bytes to end of window or read pointer */
/* copy input/output information to locals (UPDATE macro restores) */ /* copy input/output information to locals (UPDATE macro restores) */
...@@ -340,7 +340,7 @@ int zlib_inflate_blocks_free( ...@@ -340,7 +340,7 @@ int zlib_inflate_blocks_free(
void zlib_inflate_set_dictionary( void zlib_inflate_set_dictionary(
inflate_blocks_statef *s, inflate_blocks_statef *s,
const Bytef *d, const Byte *d,
uInt n uInt n
) )
{ {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#define _INFBLOCK_H #define _INFBLOCK_H
struct inflate_blocks_state; struct inflate_blocks_state;
typedef struct inflate_blocks_state FAR inflate_blocks_statef; typedef struct inflate_blocks_state inflate_blocks_statef;
extern inflate_blocks_statef * zlib_inflate_blocks_new OF(( extern inflate_blocks_statef * zlib_inflate_blocks_new OF((
z_streamp z, z_streamp z,
...@@ -27,7 +27,7 @@ extern int zlib_inflate_blocks OF(( ...@@ -27,7 +27,7 @@ extern int zlib_inflate_blocks OF((
extern void zlib_inflate_blocks_reset OF(( extern void zlib_inflate_blocks_reset OF((
inflate_blocks_statef *, inflate_blocks_statef *,
z_streamp , z_streamp ,
uLongf *)); /* check value on output */ uLong *)); /* check value on output */
extern int zlib_inflate_blocks_free OF(( extern int zlib_inflate_blocks_free OF((
inflate_blocks_statef *, inflate_blocks_statef *,
...@@ -35,7 +35,7 @@ extern int zlib_inflate_blocks_free OF(( ...@@ -35,7 +35,7 @@ extern int zlib_inflate_blocks_free OF((
extern void zlib_inflate_set_dictionary OF(( extern void zlib_inflate_set_dictionary OF((
inflate_blocks_statef *s, inflate_blocks_statef *s,
const Bytef *d, /* dictionary */ const Byte *d, /* dictionary */
uInt n)); /* dictionary length */ uInt n)); /* dictionary length */
extern int zlib_inflate_blocks_sync_point OF(( extern int zlib_inflate_blocks_sync_point OF((
......
...@@ -47,11 +47,11 @@ int zlib_inflate_codes( ...@@ -47,11 +47,11 @@ int zlib_inflate_codes(
uInt e; /* extra bits or operation */ uInt e; /* extra bits or operation */
uLong b; /* bit buffer */ uLong b; /* bit buffer */
uInt k; /* bits in bit buffer */ uInt k; /* bits in bit buffer */
Bytef *p; /* input data pointer */ Byte *p; /* input data pointer */
uInt n; /* bytes available there */ uInt n; /* bytes available there */
Bytef *q; /* output window write pointer */ Byte *q; /* output window write pointer */
uInt m; /* bytes to end of window or read pointer */ uInt m; /* bytes to end of window or read pointer */
Bytef *f; /* pointer to copy strings from */ Byte *f; /* pointer to copy strings from */
inflate_codes_statef *c = s->sub.decode.codes; /* codes state */ inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
/* copy input/output information to locals (UPDATE macro restores) */ /* copy input/output information to locals (UPDATE macro restores) */
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "infblock.h" #include "infblock.h"
struct inflate_codes_state; struct inflate_codes_state;
typedef struct inflate_codes_state FAR inflate_codes_statef; typedef struct inflate_codes_state inflate_codes_statef;
extern inflate_codes_statef *zlib_inflate_codes_new OF(( extern inflate_codes_statef *zlib_inflate_codes_new OF((
uInt, uInt, uInt, uInt,
......
...@@ -38,15 +38,15 @@ int zlib_inflate_fast( ...@@ -38,15 +38,15 @@ int zlib_inflate_fast(
uInt e; /* extra bits or operation */ uInt e; /* extra bits or operation */
uLong b; /* bit buffer */ uLong b; /* bit buffer */
uInt k; /* bits in bit buffer */ uInt k; /* bits in bit buffer */
Bytef *p; /* input data pointer */ Byte *p; /* input data pointer */
uInt n; /* bytes available there */ uInt n; /* bytes available there */
Bytef *q; /* output window write pointer */ Byte *q; /* output window write pointer */
uInt m; /* bytes to end of window or read pointer */ uInt m; /* bytes to end of window or read pointer */
uInt ml; /* mask for literal/length tree */ uInt ml; /* mask for literal/length tree */
uInt md; /* mask for distance tree */ uInt md; /* mask for distance tree */
uInt c; /* bytes to copy */ uInt c; /* bytes to copy */
uInt d; /* distance back to copy from */ uInt d; /* distance back to copy from */
Bytef *r; /* copy source pointer */ Byte *r; /* copy source pointer */
/* load input, output, bit values */ /* load input, output, bit values */
LOAD LOAD
......
...@@ -23,16 +23,16 @@ struct internal_state; ...@@ -23,16 +23,16 @@ struct internal_state;
local int huft_build OF(( local int huft_build OF((
uIntf *, /* code lengths in bits */ uInt *, /* code lengths in bits */
uInt, /* number of codes */ uInt, /* number of codes */
uInt, /* number of "simple" codes */ uInt, /* number of "simple" codes */
const uIntf *, /* list of base values for non-simple codes */ const uInt *, /* list of base values for non-simple codes */
const uIntf *, /* list of extra bits for non-simple codes */ const uInt *, /* list of extra bits for non-simple codes */
inflate_huft * FAR*,/* result: starting table */ inflate_huft **, /* result: starting table */
uIntf *, /* maximum lookup bits (returns actual) */ uInt *, /* maximum lookup bits (returns actual) */
inflate_huft *, /* space for trees */ inflate_huft *, /* space for trees */
uInt *, /* hufts used in space */ uInt *, /* hufts used in space */
uIntf * )); /* space for values */ uInt * )); /* space for values */
/* Tables for deflate from PKZIP's appnote.txt. */ /* Tables for deflate from PKZIP's appnote.txt. */
local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */ local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
...@@ -88,16 +88,16 @@ local const uInt cpdext[30] = { /* Extra bits for distance codes */ ...@@ -88,16 +88,16 @@ local const uInt cpdext[30] = { /* Extra bits for distance codes */
#define BMAX 15 /* maximum bit length of any code */ #define BMAX 15 /* maximum bit length of any code */
local int huft_build( local int huft_build(
uIntf *b, /* code lengths in bits (all assumed <= BMAX) */ uInt *b, /* code lengths in bits (all assumed <= BMAX) */
uInt n, /* number of codes (assumed <= 288) */ uInt n, /* number of codes (assumed <= 288) */
uInt s, /* number of simple-valued codes (0..s-1) */ uInt s, /* number of simple-valued codes (0..s-1) */
const uIntf *d, /* list of base values for non-simple codes */ const uInt *d, /* list of base values for non-simple codes */
const uIntf *e, /* list of extra bits for non-simple codes */ const uInt *e, /* list of extra bits for non-simple codes */
inflate_huft * FAR *t, /* result: starting table */ inflate_huft **t, /* result: starting table */
uIntf *m, /* maximum lookup bits, returns actual */ uInt *m, /* maximum lookup bits, returns actual */
inflate_huft *hp, /* space for trees */ inflate_huft *hp, /* space for trees */
uInt *hn, /* hufts used in space */ uInt *hn, /* hufts used in space */
uIntf *v /* working area: values in order of bit length */ uInt *v /* working area: values in order of bit length */
) )
/* Given a list of code lengths and a maximum table size, make a set of /* Given a list of code lengths and a maximum table size, make a set of
tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
...@@ -116,13 +116,13 @@ local int huft_build( ...@@ -116,13 +116,13 @@ local int huft_build(
register int k; /* number of bits in current code */ register int k; /* number of bits in current code */
int l; /* bits per table (returned in m) */ int l; /* bits per table (returned in m) */
uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */ uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
register uIntf *p; /* pointer into c[], b[], or v[] */ register uInt *p; /* pointer into c[], b[], or v[] */
inflate_huft *q; /* points to current table */ inflate_huft *q; /* points to current table */
struct inflate_huft_s r; /* table entry for structure assignment */ struct inflate_huft_s r; /* table entry for structure assignment */
inflate_huft *u[BMAX]; /* table stack */ inflate_huft *u[BMAX]; /* table stack */
register int w; /* bits before this table == (l * h) */ register int w; /* bits before this table == (l * h) */
uInt x[BMAX+1]; /* bit offsets, then code stack */ uInt x[BMAX+1]; /* bit offsets, then code stack */
uIntf *xp; /* pointer into x */ uInt *xp; /* pointer into x */
int y; /* number of dummy codes added */ int y; /* number of dummy codes added */
uInt z; /* number of entries in current table */ uInt z; /* number of entries in current table */
...@@ -290,19 +290,19 @@ local int huft_build( ...@@ -290,19 +290,19 @@ local int huft_build(
int zlib_inflate_trees_bits( int zlib_inflate_trees_bits(
uIntf *c, /* 19 code lengths */ uInt *c, /* 19 code lengths */
uIntf *bb, /* bits tree desired/actual depth */ uInt *bb, /* bits tree desired/actual depth */
inflate_huft * FAR *tb, /* bits tree result */ inflate_huft **tb, /* bits tree result */
inflate_huft *hp, /* space for trees */ inflate_huft *hp, /* space for trees */
z_streamp z /* for messages */ z_streamp z /* for messages */
) )
{ {
int r; int r;
uInt hn = 0; /* hufts used in space */ uInt hn = 0; /* hufts used in space */
uIntf *v; /* work area for huft_build */ uInt *v; /* work area for huft_build */
v = WS(z)->tree_work_area_1; v = WS(z)->tree_work_area_1;
r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL, r = huft_build(c, 19, 19, (uInt*)Z_NULL, (uInt*)Z_NULL,
tb, bb, hp, &hn, v); tb, bb, hp, &hn, v);
if (r == Z_DATA_ERROR) if (r == Z_DATA_ERROR)
z->msg = (char*)"oversubscribed dynamic bit lengths tree"; z->msg = (char*)"oversubscribed dynamic bit lengths tree";
...@@ -317,18 +317,18 @@ int zlib_inflate_trees_bits( ...@@ -317,18 +317,18 @@ int zlib_inflate_trees_bits(
int zlib_inflate_trees_dynamic( int zlib_inflate_trees_dynamic(
uInt nl, /* number of literal/length codes */ uInt nl, /* number of literal/length codes */
uInt nd, /* number of distance codes */ uInt nd, /* number of distance codes */
uIntf *c, /* that many (total) code lengths */ uInt *c, /* that many (total) code lengths */
uIntf *bl, /* literal desired/actual bit depth */ uInt *bl, /* literal desired/actual bit depth */
uIntf *bd, /* distance desired/actual bit depth */ uInt *bd, /* distance desired/actual bit depth */
inflate_huft * FAR *tl, /* literal/length tree result */ inflate_huft **tl, /* literal/length tree result */
inflate_huft * FAR *td, /* distance tree result */ inflate_huft **td, /* distance tree result */
inflate_huft *hp, /* space for trees */ inflate_huft *hp, /* space for trees */
z_streamp z /* for messages */ z_streamp z /* for messages */
) )
{ {
int r; int r;
uInt hn = 0; /* hufts used in space */ uInt hn = 0; /* hufts used in space */
uIntf *v; /* work area for huft_build */ uInt *v; /* work area for huft_build */
/* allocate work area */ /* allocate work area */
v = WS(z)->tree_work_area_2; v = WS(z)->tree_work_area_2;
...@@ -380,10 +380,10 @@ int zlib_inflate_trees_dynamic( ...@@ -380,10 +380,10 @@ int zlib_inflate_trees_dynamic(
int zlib_inflate_trees_fixed( int zlib_inflate_trees_fixed(
uIntf *bl, /* literal desired/actual bit depth */ uInt *bl, /* literal desired/actual bit depth */
uIntf *bd, /* distance desired/actual bit depth */ uInt *bd, /* distance desired/actual bit depth */
inflate_huft * FAR *tl, /* literal/length tree result */ inflate_huft **tl, /* literal/length tree result */
inflate_huft * FAR *td, /* distance tree result */ inflate_huft **td, /* distance tree result */
z_streamp z /* for memory allocation */ z_streamp z /* for memory allocation */
) )
{ {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#ifndef _INFTREES_H #ifndef _INFTREES_H
#define _INFTREES_H #define _INFTREES_H
typedef struct inflate_huft_s FAR inflate_huft; typedef struct inflate_huft_s inflate_huft;
struct inflate_huft_s { struct inflate_huft_s {
union { union {
...@@ -36,28 +36,28 @@ struct inflate_huft_s { ...@@ -36,28 +36,28 @@ struct inflate_huft_s {
#define MANY 1440 #define MANY 1440
extern int zlib_inflate_trees_bits OF(( extern int zlib_inflate_trees_bits OF((
uIntf *, /* 19 code lengths */ uInt *, /* 19 code lengths */
uIntf *, /* bits tree desired/actual depth */ uInt *, /* bits tree desired/actual depth */
inflate_huft * FAR *, /* bits tree result */ inflate_huft **, /* bits tree result */
inflate_huft *, /* space for trees */ inflate_huft *, /* space for trees */
z_streamp)); /* for messages */ z_streamp)); /* for messages */
extern int zlib_inflate_trees_dynamic OF(( extern int zlib_inflate_trees_dynamic OF((
uInt, /* number of literal/length codes */ uInt, /* number of literal/length codes */
uInt, /* number of distance codes */ uInt, /* number of distance codes */
uIntf *, /* that many (total) code lengths */ uInt *, /* that many (total) code lengths */
uIntf *, /* literal desired/actual bit depth */ uInt *, /* literal desired/actual bit depth */
uIntf *, /* distance desired/actual bit depth */ uInt *, /* distance desired/actual bit depth */
inflate_huft * FAR *, /* literal/length tree result */ inflate_huft **, /* literal/length tree result */
inflate_huft * FAR *, /* distance tree result */ inflate_huft **, /* distance tree result */
inflate_huft *, /* space for trees */ inflate_huft *, /* space for trees */
z_streamp)); /* for messages */ z_streamp)); /* for messages */
extern int zlib_inflate_trees_fixed OF(( extern int zlib_inflate_trees_fixed OF((
uIntf *, /* literal desired/actual bit depth */ uInt *, /* literal desired/actual bit depth */
uIntf *, /* distance desired/actual bit depth */ uInt *, /* distance desired/actual bit depth */
inflate_huft * FAR *, /* literal/length tree result */ inflate_huft **, /* literal/length tree result */
inflate_huft * FAR *, /* distance tree result */ inflate_huft **, /* distance tree result */
z_streamp)); /* for memory allocation */ z_streamp)); /* for memory allocation */
#endif /* _INFTREES_H */ #endif /* _INFTREES_H */
...@@ -27,8 +27,8 @@ int zlib_inflate_flush( ...@@ -27,8 +27,8 @@ int zlib_inflate_flush(
) )
{ {
uInt n; uInt n;
Bytef *p; Byte *p;
Bytef *q; Byte *q;
/* local copies of source and destination pointers */ /* local copies of source and destination pointers */
p = z->next_out; p = z->next_out;
......
...@@ -40,7 +40,7 @@ struct inflate_blocks_state { ...@@ -40,7 +40,7 @@ struct inflate_blocks_state {
struct { struct {
uInt table; /* table lengths (14 bits) */ uInt table; /* table lengths (14 bits) */
uInt index; /* index into blens (or border) */ uInt index; /* index into blens (or border) */
uIntf *blens; /* bit lengths of codes */ uInt *blens; /* bit lengths of codes */
uInt bb; /* bit length tree depth */ uInt bb; /* bit length tree depth */
inflate_huft *tb; /* bit length decoding tree */ inflate_huft *tb; /* bit length decoding tree */
} trees; /* if DTREE, decoding info for trees */ } trees; /* if DTREE, decoding info for trees */
...@@ -55,10 +55,10 @@ struct inflate_blocks_state { ...@@ -55,10 +55,10 @@ struct inflate_blocks_state {
uInt bitk; /* bits in bit buffer */ uInt bitk; /* bits in bit buffer */
uLong bitb; /* bit buffer */ uLong bitb; /* bit buffer */
inflate_huft *hufts; /* single malloc for tree space */ inflate_huft *hufts; /* single malloc for tree space */
Bytef *window; /* sliding window */ Byte *window; /* sliding window */
Bytef *end; /* one byte after sliding window */ Byte *end; /* one byte after sliding window */
Bytef *read; /* window read pointer */ Byte *read; /* window read pointer */
Bytef *write; /* window write pointer */ Byte *write; /* window write pointer */
check_func checkfn; /* check function */ check_func checkfn; /* check function */
uLong check; /* check on output */ uLong check; /* check on output */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment