upgraded bundled zlib to 1.2.11

This commit is contained in:
Guenter Obiltschnig
2017-01-25 10:18:21 +01:00
parent f409b87343
commit 4149062e7e
11 changed files with 50 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library /* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler * Copyright (C) 1995-2013 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
@@ -252,11 +252,6 @@
# undef z_longlong # undef z_longlong
#endif #endif
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
# define NO_DUMMY_DECL
#endif
/* Maximum value for memLevel in deflateInit2 */ /* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL #ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K # ifdef MAXSEG_64K
@@ -444,11 +439,13 @@ typedef uLong FAR uLongf;
# define Z_HAVE_STDARG_H # define Z_HAVE_STDARG_H
#endif #endif
#ifndef _WIN32_WCE
#ifdef STDC #ifdef STDC
# ifndef Z_SOLO # ifndef Z_SOLO
# include <sys/types.h> /* for off_t */ # include <sys/types.h> /* for off_t */
# endif # endif
#endif #endif
#endif
#if defined(STDC) || defined(Z_HAVE_STDARG_H) #if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifndef Z_SOLO # ifndef Z_SOLO

View File

@@ -1,5 +1,5 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library /* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.10, January 2nd, 2017 version 1.2.11, January 15th, 2017
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
@@ -37,11 +37,11 @@
extern "C" { extern "C" {
#endif #endif
#define ZLIB_VERSION "1.2.10" #define ZLIB_VERSION "1.2.11"
#define ZLIB_VERNUM 0x12a0 #define ZLIB_VERNUM 0x12b0
#define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2 #define ZLIB_VER_MINOR 2
#define ZLIB_VER_REVISION 10 #define ZLIB_VER_REVISION 11
#define ZLIB_VER_SUBREVISION 0 #define ZLIB_VER_SUBREVISION 0
/* /*
@@ -712,10 +712,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
used to switch between compression and straight copy of the input data, or used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different strategy. to switch to a different kind of input data requiring a different strategy.
If the compression approach (which is a function of the level) or the If the compression approach (which is a function of the level) or the
strategy is changed, then the input available so far is compressed with the strategy is changed, and if any input has been consumed in a previous
old level and strategy using deflate(strm, Z_BLOCK). There are three deflate() call, then the input available so far is compressed with the old
approaches for the compression levels 0, 1..3, and 4..9 respectively. The level and strategy using deflate(strm, Z_BLOCK). There are three approaches
new level and strategy will take effect at the next call of deflate(). for the compression levels 0, 1..3, and 4..9 respectively. The new level
and strategy will take effect at the next call of deflate().
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
not have enough output space to complete, then the parameter change will not not have enough output space to complete, then the parameter change will not
@@ -1883,11 +1884,6 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
#endif /* !Z_SOLO */ #endif /* !Z_SOLO */
/* hack for buggy compilers */
#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
struct internal_state {int dummy;};
#endif
/* undocumented functions */ /* undocumented functions */
ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN const char * ZEXPORT zError OF((int));
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));

View File

@@ -7,6 +7,8 @@
#include "zutil.h" #include "zutil.h"
#define local static
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2)); local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#define BASE 65521U /* largest prime smaller than 65536 */ #define BASE 65521U /* largest prime smaller than 65536 */

View File

@@ -1,5 +1,5 @@
/* crc32.c -- compute the CRC-32 of a data stream /* crc32.c -- compute the CRC-32 of a data stream
* Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler * Copyright (C) 1995-2006, 2010, 2011, 2012 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
* *
* Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster * Thanks to Rodney Brown <rbrown64@csc.com.au> for his contribution of faster
@@ -30,6 +30,8 @@
#include "zutil.h" /* for STDC and FAR definitions */ #include "zutil.h" /* for STDC and FAR definitions */
#define local static
/* Definitions for doing the crc four data bytes at a time. */ /* Definitions for doing the crc four data bytes at a time. */
#if !defined(NOBYFOUR) && defined(Z_U4) #if !defined(NOBYFOUR) && defined(Z_U4)
# define BYFOUR # define BYFOUR

View File

@@ -52,7 +52,7 @@
#include "deflate.h" #include "deflate.h"
const char deflate_copyright[] = const char deflate_copyright[] =
" deflate 1.2.10 Copyright 1995-2017 Jean-loup Gailly and Mark Adler "; " deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler ";
/* /*
If you use the zlib library in a product, an acknowledgment is welcome 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 in the documentation of your product. If for some reason you cannot
@@ -586,7 +586,8 @@ int ZEXPORT deflateParams(strm, level, strategy)
} }
func = configuration_table[s->level].func; func = configuration_table[s->level].func;
if ((strategy != s->strategy || func != configuration_table[level].func)) { if ((strategy != s->strategy || func != configuration_table[level].func) &&
s->high_water) {
/* Flush the last buffer: */ /* Flush the last buffer: */
int err = deflate(strm, Z_BLOCK); int err = deflate(strm, Z_BLOCK);
if (err == Z_STREAM_ERROR) if (err == Z_STREAM_ERROR)
@@ -1671,8 +1672,6 @@ local block_state deflate_stored(s, flush)
len = left + s->strm->avail_in; /* limit len to the input */ len = left + s->strm->avail_in; /* limit len to the input */
if (len > have) if (len > have)
len = have; /* limit len to the output */ len = have; /* limit len to the output */
if (left > len)
left = len; /* limit window pull to len */
/* If the stored block would be less than min_block in length, or if /* If the stored block would be less than min_block in length, or if
* unable to copy all of the available input when flushing, then try * unable to copy all of the available input when flushing, then try
@@ -1681,13 +1680,13 @@ local block_state deflate_stored(s, flush)
*/ */
if (len < min_block && ((len == 0 && flush != Z_FINISH) || if (len < min_block && ((len == 0 && flush != Z_FINISH) ||
flush == Z_NO_FLUSH || flush == Z_NO_FLUSH ||
len - left != s->strm->avail_in)) len != left + s->strm->avail_in))
break; break;
/* Make a dummy stored block in pending to get the header bytes, /* Make a dummy stored block in pending to get the header bytes,
* including any pending bits. This also updates the debugging counts. * including any pending bits. This also updates the debugging counts.
*/ */
last = flush == Z_FINISH && len - left == s->strm->avail_in ? 1 : 0; last = flush == Z_FINISH && len == left + s->strm->avail_in ? 1 : 0;
_tr_stored_block(s, (char *)0, 0L, last); _tr_stored_block(s, (char *)0, 0L, last);
/* Replace the lengths in the dummy stored block with len. */ /* Replace the lengths in the dummy stored block with len. */
@@ -1699,14 +1698,16 @@ local block_state deflate_stored(s, flush)
/* Write the stored block header bytes. */ /* Write the stored block header bytes. */
flush_pending(s->strm); flush_pending(s->strm);
/* Update debugging counts for the data about to be copied. */
#ifdef ZLIB_DEBUG #ifdef ZLIB_DEBUG
/* Update debugging counts for the data about to be copied. */
s->compressed_len += len << 3; s->compressed_len += len << 3;
s->bits_sent += len << 3; s->bits_sent += len << 3;
#endif #endif
/* Copy uncompressed bytes from the window to next_out. */ /* Copy uncompressed bytes from the window to next_out. */
if (left) { if (left) {
if (left > len)
left = len;
zmemcpy(s->strm->next_out, s->window + s->block_start, left); zmemcpy(s->strm->next_out, s->window + s->block_start, left);
s->strm->next_out += left; s->strm->next_out += left;
s->strm->avail_out -= left; s->strm->avail_out -= left;
@@ -1756,6 +1757,8 @@ local block_state deflate_stored(s, flush)
s->block_start = s->strstart; s->block_start = s->strstart;
s->insert += MIN(used, s->w_size - s->insert); s->insert += MIN(used, s->w_size - s->insert);
} }
if (s->high_water < s->strstart)
s->high_water = s->strstart;
/* If the last block was written to next_out, then done. */ /* If the last block was written to next_out, then done. */
if (last) if (last)
@@ -1783,6 +1786,8 @@ local block_state deflate_stored(s, flush)
read_buf(s->strm, s->window + s->strstart, have); read_buf(s->strm, s->window + s->strstart, have);
s->strstart += have; s->strstart += have;
} }
if (s->high_water < s->strstart)
s->high_water = s->strstart;
/* There was not enough avail_out to write a complete worthy or flushed /* There was not enough avail_out to write a complete worthy or flushed
* stored block to next_out. Write a stored block to pending instead, if we * stored block to next_out. Write a stored block to pending instead, if we

View File

@@ -1,5 +1,5 @@
/* gzguts.h -- zlib internal header definitions for gz* operations /* gzguts.h -- zlib internal header definitions for gz* operations
* Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013, 2016 Mark Adler * Copyright (C) 2004, 2005, 2010, 2011, 2012, 2013 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
@@ -35,10 +35,11 @@
# include <stddef.h> # include <stddef.h>
#endif #endif
#ifndef _WIN32_WCE
#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32) #if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
# include <io.h> # include <io.h>
#endif #endif
#endif
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32) || defined(__CYGWIN__)
# define WIDECHAR # define WIDECHAR
#endif #endif

View File

@@ -1,5 +1,5 @@
/* inffast.c -- fast decoding /* inffast.c -- fast decoding
* Copyright (C) 1995-2008, 2010, 2013, 2016 Mark Adler * Copyright (C) 1995-2017 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */

View File

@@ -9,7 +9,7 @@
#define MAXBITS 15 #define MAXBITS 15
const char inflate_copyright[] = const char inflate_copyright[] =
" inflate 1.2.10 Copyright 1995-2017 Mark Adler "; " inflate 1.2.11 Copyright 1995-2017 Mark Adler ";
/* /*
If you use the zlib library in a product, an acknowledgment is welcome 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 in the documentation of your product. If for some reason you cannot
@@ -62,7 +62,7 @@ unsigned short FAR *work;
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */ static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 192, 202}; 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 77, 202};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 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, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,

View File

@@ -1,5 +1,5 @@
/* trees.c -- output deflated data using Huffman coding /* trees.c -- output deflated data using Huffman coding
* Copyright (C) 1995-2016 Jean-loup Gailly * Copyright (C) 1995-2017 Jean-loup Gailly
* detect_data_type() function provided freely by Cosmin Truta, 2006 * detect_data_type() function provided freely by Cosmin Truta, 2006
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
@@ -906,7 +906,7 @@ void ZLIB_INTERNAL _tr_align(s)
/* =========================================================================== /* ===========================================================================
* Determine the best encoding for the current block: dynamic trees, static * Determine the best encoding for the current block: dynamic trees, static
* trees or store, and output the encoded block to the zip file. * trees or store, and write out the encoded block.
*/ */
void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last) void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
deflate_state *s; deflate_state *s;

View File

@@ -1,9 +1,9 @@
/* zconf.h -- configuration of the zlib compression library /* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler * Copyright (C) 1995-2013 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h * For conditions of distribution and use, see copyright notice in zlib.h
*/ */
/* @(#) $Id$ */ /* @(#) $Id: //poco/1.4/Foundation/include/Poco/zconf.h#5 $ */
#ifndef ZCONF_H #ifndef ZCONF_H
#define ZCONF_H #define ZCONF_H
@@ -439,11 +439,13 @@ typedef uLong FAR uLongf;
# define Z_HAVE_STDARG_H # define Z_HAVE_STDARG_H
#endif #endif
#ifndef _WIN32_WCE
#ifdef STDC #ifdef STDC
# ifndef Z_SOLO # ifndef Z_SOLO
# include <sys/types.h> /* for off_t */ # include <sys/types.h> /* for off_t */
# endif # endif
#endif #endif
#endif
#if defined(STDC) || defined(Z_HAVE_STDARG_H) #if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifndef Z_SOLO # ifndef Z_SOLO

View File

@@ -1,5 +1,5 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library /* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.10, January 2nd, 2017 version 1.2.11, January 15th, 2017
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
@@ -37,11 +37,11 @@
extern "C" { extern "C" {
#endif #endif
#define ZLIB_VERSION "1.2.10" #define ZLIB_VERSION "1.2.11"
#define ZLIB_VERNUM 0x12a0 #define ZLIB_VERNUM 0x12b0
#define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2 #define ZLIB_VER_MINOR 2
#define ZLIB_VER_REVISION 10 #define ZLIB_VER_REVISION 11
#define ZLIB_VER_SUBREVISION 0 #define ZLIB_VER_SUBREVISION 0
/* /*
@@ -712,10 +712,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
used to switch between compression and straight copy of the input data, or used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different strategy. to switch to a different kind of input data requiring a different strategy.
If the compression approach (which is a function of the level) or the If the compression approach (which is a function of the level) or the
strategy is changed, then the input available so far is compressed with the strategy is changed, and if any input has been consumed in a previous
old level and strategy using deflate(strm, Z_BLOCK). There are three deflate() call, then the input available so far is compressed with the old
approaches for the compression levels 0, 1..3, and 4..9 respectively. The level and strategy using deflate(strm, Z_BLOCK). There are three approaches
new level and strategy will take effect at the next call of deflate(). for the compression levels 0, 1..3, and 4..9 respectively. The new level
and strategy will take effect at the next call of deflate().
If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
not have enough output space to complete, then the parameter change will not not have enough output space to complete, then the parameter change will not