Deleted Added
full compact
zlib.c (37065) zlib.c (43305)
1/*
2 * This file is derived from various .h and .c files from the zlib-1.0.4
3 * distribution by Jean-loup Gailly and Mark Adler, with some additions
4 * by Paul Mackerras to aid in implementing Deflate compression and
5 * decompression for PPP packets. See zlib.h for conditions of
6 * distribution and use.
7 *
8 * Changes that have been made include:
9 * - added Z_PACKET_FLUSH (see zlib.h for details)
10 * - added inflateIncomp and deflateOutputPending
11 * - allow strm->next_out to be NULL, meaning discard the output
12 *
1/*
2 * This file is derived from various .h and .c files from the zlib-1.0.4
3 * distribution by Jean-loup Gailly and Mark Adler, with some additions
4 * by Paul Mackerras to aid in implementing Deflate compression and
5 * decompression for PPP packets. See zlib.h for conditions of
6 * distribution and use.
7 *
8 * Changes that have been made include:
9 * - added Z_PACKET_FLUSH (see zlib.h for details)
10 * - added inflateIncomp and deflateOutputPending
11 * - allow strm->next_out to be NULL, meaning discard the output
12 *
13 * $Id: zlib.c,v 1.6 1998/03/21 20:56:15 peter Exp $
13 * $Id: zlib.c,v 1.7 1998/06/20 16:28:04 peter Exp $
14 */
15
16/*
17 * ==FILEVERSION 971210==
18 *
19 * This marker is used by the Linux installation script to determine
20 * whether an up-to-date version of this file is already installed.
21 */

--- 72 unchanged lines hidden (view full) ---

94typedef unsigned long ulg;
95
96extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
97/* (size given to avoid silly warnings with Visual C++) */
98
99#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
100
101#define ERR_RETURN(strm,err) \
14 */
15
16/*
17 * ==FILEVERSION 971210==
18 *
19 * This marker is used by the Linux installation script to determine
20 * whether an up-to-date version of this file is already installed.
21 */

--- 72 unchanged lines hidden (view full) ---

94typedef unsigned long ulg;
95
96extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
97/* (size given to avoid silly warnings with Visual C++) */
98
99#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
100
101#define ERR_RETURN(strm,err) \
102 return (strm->msg = (char*)ERR_MSG(err), (err))
102 return (strm->msg = (const char*)ERR_MSG(err), (err))
103/* To be used only when the state is known to be valid */
104
105 /* common constants */
106
107#ifndef DEF_WBITS
108# define DEF_WBITS MAX_WBITS
109#endif
110/* default windowBits for decompression. MAX_WBITS is for compression only */

--- 691 unchanged lines hidden (view full) ---

802 s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
803
804 overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
805 s->pending_buf = (uchf *) overlay;
806 s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
807
808 if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
809 s->pending_buf == Z_NULL) {
103/* To be used only when the state is known to be valid */
104
105 /* common constants */
106
107#ifndef DEF_WBITS
108# define DEF_WBITS MAX_WBITS
109#endif
110/* default windowBits for decompression. MAX_WBITS is for compression only */

--- 691 unchanged lines hidden (view full) ---

802 s->lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
803
804 overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
805 s->pending_buf = (uchf *) overlay;
806 s->pending_buf_size = (ulg)s->lit_bufsize * (sizeof(ush)+2L);
807
808 if (s->window == Z_NULL || s->prev == Z_NULL || s->head == Z_NULL ||
809 s->pending_buf == Z_NULL) {
810 strm->msg = (char*)ERR_MSG(Z_MEM_ERROR);
810 strm->msg = (const char*)ERR_MSG(Z_MEM_ERROR);
811 deflateEnd (strm);
812 return Z_MEM_ERROR;
813 }
814 s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
815 s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
816
817 s->level = level;
818 s->strategy = strategy;

--- 4561 unchanged lines hidden ---
811 deflateEnd (strm);
812 return Z_MEM_ERROR;
813 }
814 s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
815 s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
816
817 s->level = level;
818 s->strategy = strategy;

--- 4561 unchanged lines hidden ---