From 41d1ebf4bdec32219afce270140979f4f92104f3 Mon Sep 17 00:00:00 2001 From: jbj Date: Sat, 9 Oct 2004 16:25:56 +0000 Subject: [PATCH] Upgrade to zlib-1.2.2. CVS patchset: 7433 CVS date: 2004/10/09 16:25:56 --- zlib/ChangeLog | 9 ++++ zlib/FAQ | 2 +- zlib/INDEX | 2 +- zlib/README | 4 +- zlib/as400/compile.clp | 2 +- zlib/as400/readme.txt | 2 +- zlib/as400/zlib.inc | 6 +-- zlib/contrib/README.contrib | 10 ++--- zlib/contrib/ada/readme.txt | 12 ++--- zlib/contrib/ada/zlib-streams.adb | 2 +- zlib/contrib/ada/zlib-streams.ads | 2 +- zlib/contrib/ada/zlib.gpr | 41 +++++++++-------- zlib/contrib/gzappend/gzappend.c | 4 +- zlib/contrib/infback9/infback9.c | 4 +- zlib/contrib/infback9/inftree9.c | 4 +- zlib/contrib/minizip/ioapi.c | 4 +- zlib/contrib/minizip/miniunz.c | 4 +- zlib/contrib/minizip/unzip.c | 10 +++-- zlib/contrib/minizip/zip.c | 6 +-- zlib/contrib/untgz/untgz.c | 2 +- zlib/contrib/vstudio/vc7/zlib.rc | 6 +-- zlib/crc32.c | 92 +++++++++++++++++++-------------------- zlib/deflate.c | 4 +- zlib/gzio.c | 8 ++-- zlib/infback.c | 4 +- zlib/inflate.c | 5 ++- zlib/inftrees.c | 4 +- zlib/old/README | 2 +- zlib/qnx/package.qpg | 10 ++--- zlib/win32/DLL_FAQ.txt | 12 +++-- zlib/win32/zlib1.rc | 8 ++-- zlib/zlib.3 | 4 +- zlib/zlib.h | 24 +++++----- 33 files changed, 162 insertions(+), 153 deletions(-) diff --git a/zlib/ChangeLog b/zlib/ChangeLog index 26e551e..d60b6d3 100644 --- a/zlib/ChangeLog +++ b/zlib/ChangeLog @@ -1,6 +1,15 @@ ChangeLog file for zlib +Changes in 1.2.2 (3 October 2004) +- Update zlib.h comments on gzip in-memory processing +- Set adler to 1 in inflateReset() to support Java test suite [Walles] +- Add contrib/dotzlib [Ravn] +- Update win32/DLL_FAQ.txt [Truta] +- Update contrib/minizip [Vollant] +- Move contrib/visual-basic.txt to old/ [Truta] +- Fix assembler builds in projects/visualc6/ [Truta] + Changes in 1.2.1.2 (9 September 2004) - Update INDEX file - Fix trees.c to update strm->data_type (no one ever noticed!) diff --git a/zlib/FAQ b/zlib/FAQ index 578dbc2..4f61f10 100644 --- a/zlib/FAQ +++ b/zlib/FAQ @@ -117,7 +117,7 @@ The lastest zlib FAQ is at http://www.gzip.org/zlib/zlib_faq.html After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib generates an error such as: - ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so: + ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so: symbol __register_frame_info: referenced symbol not found The symbol __register_frame_info is not part of zlib, it is generated by diff --git a/zlib/INDEX b/zlib/INDEX index 331b56b..0587e59 100644 --- a/zlib/INDEX +++ b/zlib/INDEX @@ -8,7 +8,7 @@ algorithm.txt description of the (de)compression algorithm configure configure script for Unix zconf.in.h template for zconf.h (used by configure) -amiga/ makefiles for Amiga SAS C +amiga/ makefiles for Amiga SAS C as400/ makefiles for IBM AS/400 msdos/ makefiles for MSDOS old/ makefiles for various architectures and zlib documentation diff --git a/zlib/README b/zlib/README index 48f44e2..df95ae1 100644 --- a/zlib/README +++ b/zlib/README @@ -1,6 +1,6 @@ ZLIB DATA COMPRESSION LIBRARY -zlib 1.2.1.2 is a general purpose data compression library. All the code is +zlib 1.2.2 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) @@ -34,7 +34,7 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of Dr. Dobb's Journal; a copy of the article is available in http://dogma.net/markn/articles/zlibtool/zlibtool.htm -The changes made in version 1.2.1.2 are documented in the file ChangeLog. +The changes made in version 1.2.2 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory "contrib". diff --git a/zlib/as400/compile.clp b/zlib/as400/compile.clp index dcd2421..3c47bb4 100644 --- a/zlib/as400/compile.clp +++ b/zlib/as400/compile.clp @@ -118,6 +118,6 @@ &MODLIB/INFTREES &MODLIB/TREES + &MODLIB/UNCOMPR &MODLIB/ZUTIL) + SRCFILE(&SRCLIB/&CTLFILE) SRCMBR(BNDSRC) + - TEXT('ZLIB 1.2.1') TGTRLS(V4R4M0) + TEXT('ZLIB 1.2.2') TGTRLS(V4R4M0) ENDPGM diff --git a/zlib/as400/readme.txt b/zlib/as400/readme.txt index eef7cb2..27ca676 100644 --- a/zlib/as400/readme.txt +++ b/zlib/as400/readme.txt @@ -1,4 +1,4 @@ - ZLIB version 1.2.1 for AS400 installation instructions + ZLIB version 1.2.2 for AS400 installation instructions I) From an AS400 *SAVF file: diff --git a/zlib/as400/zlib.inc b/zlib/as400/zlib.inc index bb24691..e31e1a7 100644 --- a/zlib/as400/zlib.inc +++ b/zlib/as400/zlib.inc @@ -1,7 +1,7 @@ * ZLIB.INC - Interface to the general purpose compression library * * ILE RPG400 version by Patrick Monnerat, DATASPHERE. - * Version 1.2.1.2 + * Version 1.2.2 * * * WARNING: @@ -20,8 +20,8 @@ * Constants ************************************************************************** * - D ZLIB_VERSION C '1.2.1.2' Header's version - D ZLIB_VERNUM C X'1212' + D ZLIB_VERSION C '1.2.2' Header's version + D ZLIB_VERNUM C X'1220' * D Z_NO_FLUSH C 0 D Z_SYNC_FLUSH C 2 diff --git a/zlib/contrib/README.contrib b/zlib/contrib/README.contrib index eae15aa..7778980 100644 --- a/zlib/contrib/README.contrib +++ b/zlib/contrib/README.contrib @@ -19,6 +19,9 @@ blast/ by Mark Adler delphi/ by Cosmin Truta Support for Delphi and C++ Builder +dotzlib/ by Henrik Ravn + Support for Microsoft .Net and Visual C++ .Net + gzappend/ by Mark Adler append to a gzip file -- illustrates the use of Z_BLOCK @@ -60,11 +63,8 @@ puff/ by Mark Adler testzlib/ by Gilles Vollant Example of the use of zlib -untgz/ by "Pedro A. Aranda Guti\irrez" +untgz/ by Pedro A. Aranda Gutierrez A very simple tar.gz file extractor using zlib -visual-basic.txt by Carlos Rios - How to use compress(), uncompress() and the gz* functions from VB - vstudio/ by Gilles Vollant - Building a minizip-enhanced zlib with Visual Studio .NET + Building a minizip-enhanced zlib with Microsoft Visual Studio diff --git a/zlib/contrib/ada/readme.txt b/zlib/contrib/ada/readme.txt index dec7ef3..ce4d2ca 100644 --- a/zlib/contrib/ada/readme.txt +++ b/zlib/contrib/ada/readme.txt @@ -1,12 +1,12 @@ - ZLib for Ada thick binding (ZLib.Ada) - Release 1.3 + ZLib for Ada thick binding (ZLib.Ada) + Release 1.3 ZLib.Ada is a thick binding interface to the popular ZLib data compression library, available at http://www.gzip.org/zlib/. It provides Ada-style access to the ZLib C library. - Here are the main changes since ZLib.Ada 1.2: + Here are the main changes since ZLib.Ada 1.2: - Attension: ZLib.Read generic routine have a initialization requirement for Read_Last parameter now. It is a bit incompartible with previous version, @@ -28,7 +28,7 @@ It provides Ada-style access to the ZLib C library. - Add pragma Assertion that Ada.Streams.Stream_Element size is 8 bit. - How to build ZLib.Ada under GNAT + How to build ZLib.Ada under GNAT You should have the ZLib library already build on your computer, before building ZLib.Ada. Make the directory of ZLib.Ada sources current and @@ -41,7 +41,7 @@ Or use the GNAT project file build for GNAT 3.15 or later: gnatmake -Pzlib.gpr -L - How to build ZLib.Ada under Aonix ObjectAda for Win32 7.2.2 + How to build ZLib.Ada under Aonix ObjectAda for Win32 7.2.2 1. Make a project with all *.ads and *.adb files from the distribution. 2. Build the libz.a library from the ZLib C sources. @@ -51,7 +51,7 @@ Or use the GNAT project file build for GNAT 3.15 or later: 6. Build the executable using test.adb as a main procedure. - How to use ZLib.Ada + How to use ZLib.Ada The source files test.adb and read.adb are small demo programs that show the main functionality of ZLib.Ada. diff --git a/zlib/contrib/ada/zlib-streams.adb b/zlib/contrib/ada/zlib-streams.adb index 398664a..b6497ba 100644 --- a/zlib/contrib/ada/zlib-streams.adb +++ b/zlib/contrib/ada/zlib-streams.adb @@ -222,4 +222,4 @@ package body ZLib.Streams is return Total_Out (Stream.Writer); end Write_Total_Out; -end ZLib.Streams; \ No newline at end of file +end ZLib.Streams; diff --git a/zlib/contrib/ada/zlib-streams.ads b/zlib/contrib/ada/zlib-streams.ads index 5c68667..f0193c6 100644 --- a/zlib/contrib/ada/zlib-streams.ads +++ b/zlib/contrib/ada/zlib-streams.ads @@ -111,4 +111,4 @@ private Writer : Filter_Type; end record; -end ZLib.Streams; \ No newline at end of file +end ZLib.Streams; diff --git a/zlib/contrib/ada/zlib.gpr b/zlib/contrib/ada/zlib.gpr index 88f51cc..296b22a 100644 --- a/zlib/contrib/ada/zlib.gpr +++ b/zlib/contrib/ada/zlib.gpr @@ -1,21 +1,20 @@ -project Zlib is - - for Languages use ("Ada"); - for Source_Dirs use ("."); - for Object_Dir use "."; - for Main use ("test.adb", "mtest.adb", "read.adb", "buffer_demo"); - - package Compiler is - for Default_Switches ("ada") use ("-gnatwcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst"); - end Compiler; - - package Linker is - for Default_Switches ("ada") use ("-lz"); - end Linker; - - package Builder is - for Default_Switches ("ada") use ("-s", "-gnatQ"); - end Builder; - -end Zlib; - +project Zlib is + + for Languages use ("Ada"); + for Source_Dirs use ("."); + for Object_Dir use "."; + for Main use ("test.adb", "mtest.adb", "read.adb", "buffer_demo"); + + package Compiler is + for Default_Switches ("ada") use ("-gnatwcfilopru", "-gnatVcdfimorst", "-gnatyabcefhiklmnoprst"); + end Compiler; + + package Linker is + for Default_Switches ("ada") use ("-lz"); + end Linker; + + package Builder is + for Default_Switches ("ada") use ("-s", "-gnatQ"); + end Builder; + +end Zlib; diff --git a/zlib/contrib/gzappend/gzappend.c b/zlib/contrib/gzappend/gzappend.c index f2e9e4f..e9e878e 100644 --- a/zlib/contrib/gzappend/gzappend.c +++ b/zlib/contrib/gzappend/gzappend.c @@ -48,10 +48,10 @@ unfriendly behavior that if gzappend fails, the gzip file is corrupted. This program was written to illustrate the use of the new Z_BLOCK option of - zlib 1.2.1's inflate() function. This option returns from inflate() at each + zlib 1.2.x's inflate() function. This option returns from inflate() at each block boundary to facilitate locating and modifying the last block bit at the start of the final deflate block. Also whether using Z_BLOCK or not, - another required feature of zlib 1.2.1 is that inflate() now provides the + another required feature of zlib 1.2.x is that inflate() now provides the number of unusued bits in the last input byte used. gzappend will not work with versions of zlib earlier than 1.2.1. diff --git a/zlib/contrib/infback9/infback9.c b/zlib/contrib/infback9/infback9.c index 103d901..f5ddde6 100644 --- a/zlib/contrib/infback9/infback9.c +++ b/zlib/contrib/infback9/infback9.c @@ -430,8 +430,8 @@ void FAR *out_desc; } } - /* handle error breaks in while */ - if (mode == BAD) break; + /* handle error breaks in while */ + if (mode == BAD) break; /* build code tables */ state->next = state->codes; diff --git a/zlib/contrib/infback9/inftree9.c b/zlib/contrib/infback9/inftree9.c index 5fd5b4a..9b48bc5 100644 --- a/zlib/contrib/infback9/inftree9.c +++ b/zlib/contrib/infback9/inftree9.c @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate9_copyright[] = - " inflate9 1.2.1.2 Copyright 1995-2004 Mark Adler "; + " inflate9 1.2.2 Copyright 1995-2004 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 @@ -64,7 +64,7 @@ unsigned short FAR *work; static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132, - 133, 133, 133, 133, 144, 77, 194}; + 133, 133, 133, 133, 144, 199, 198}; static const unsigned short dbase[32] = { /* Distance codes 0..31 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, diff --git a/zlib/contrib/minizip/ioapi.c b/zlib/contrib/minizip/ioapi.c index 6ddfd36..c9e69f2 100644 --- a/zlib/contrib/minizip/ioapi.c +++ b/zlib/contrib/minizip/ioapi.c @@ -94,7 +94,7 @@ uLong ZCALLBACK fread_file_func (opaque, stream, buf, size) uLong size; { uLong ret; - ret = fread(buf, 1, (size_t)size, (FILE *)stream); + ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); return ret; } @@ -106,7 +106,7 @@ uLong ZCALLBACK fwrite_file_func (opaque, stream, buf, size) uLong size; { uLong ret; - ret = fwrite(buf, 1, (size_t)size, (FILE *)stream); + ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); return ret; } diff --git a/zlib/contrib/minizip/miniunz.c b/zlib/contrib/minizip/miniunz.c index 11b7260..a6b06a2 100644 --- a/zlib/contrib/minizip/miniunz.c +++ b/zlib/contrib/minizip/miniunz.c @@ -317,7 +317,7 @@ int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password) printf("The file %s exists. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename); ret = scanf("%1s",answer); - if (ret != 1) + if (ret != 1) { exit(EXIT_FAILURE); } @@ -567,7 +567,7 @@ int main(argc,argv) return do_list(uf); else if (opt_do_extract==1) { - if (opt_extractdir && chdir(dirname)) + if (opt_extractdir && chdir(dirname)) { printf("Error changing into %s, aborting\n", dirname); exit(-1); diff --git a/zlib/contrib/minizip/unzip.c b/zlib/contrib/minizip/unzip.c index e804a2a..e14de9e 100644 --- a/zlib/contrib/minizip/unzip.c +++ b/zlib/contrib/minizip/unzip.c @@ -1,5 +1,5 @@ /* unzip.c -- IO for uncompress .zip files using zlib - Version 1.01c, August 23th, 2004 + Version 1.01d, September 22th, 2004 Copyright (C) 1998-2004 Gilles Vollant @@ -1250,10 +1250,12 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len) pfile_in_zip_read_info->stream.avail_out = (uInt)pfile_in_zip_read_info->rest_read_uncompressed; - if ((len>pfile_in_zip_read_info->rest_read_compressed) && - (pfile_in_zip_read_info->raw)) + if ((len>pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in) && + (pfile_in_zip_read_info->raw)) pfile_in_zip_read_info->stream.avail_out = - (uInt)pfile_in_zip_read_info->rest_read_compressed; + (uInt)pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in; while (pfile_in_zip_read_info->stream.avail_out>0) { diff --git a/zlib/contrib/minizip/zip.c b/zlib/contrib/minizip/zip.c index ce1444c..2ccd7fd 100644 --- a/zlib/contrib/minizip/zip.c +++ b/zlib/contrib/minizip/zip.c @@ -717,9 +717,9 @@ extern int ZEXPORT zipOpenNewFileInZip3 (file, filename, zipfi, if (comment==NULL) size_comment = 0; else - size_comment = strlen(comment); + size_comment = (uInt)strlen(comment); - size_filename = strlen(filename); + size_filename = (uInt)strlen(filename); if (zipfi == NULL) zi->ci.dosDate = 0; @@ -1126,7 +1126,7 @@ extern int ZEXPORT zipClose (file, global_comment) if (global_comment==NULL) size_global_comment = 0; else - size_global_comment = strlen(global_comment); + size_global_comment = (uInt)strlen(global_comment); centraldir_pos_inzip = ZTELL(zi->z_filefunc,zi->filestream); diff --git a/zlib/contrib/untgz/untgz.c b/zlib/contrib/untgz/untgz.c index 3a30768..2c391e5 100644 --- a/zlib/contrib/untgz/untgz.c +++ b/zlib/contrib/untgz/untgz.c @@ -97,7 +97,7 @@ struct attr_item struct attr_item *next; char *fname; int mode; - time_t time; + time_t time; }; enum { TGZ_EXTRACT, TGZ_LIST, TGZ_INVALID }; diff --git a/zlib/contrib/vstudio/vc7/zlib.rc b/zlib/contrib/vstudio/vc7/zlib.rc index 2eb7c6b..3ebe25b 100644 --- a/zlib/contrib/vstudio/vc7/zlib.rc +++ b/zlib/contrib/vstudio/vc7/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1,2,1,2 - PRODUCTVERSION 1,2,1,2 + FILEVERSION 1,2,2 + PRODUCTVERSION 1,2,2 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression library\0" - VALUE "FileVersion", "1.2.1.2\0" + VALUE "FileVersion", "1.2.2\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlib.dll\0" VALUE "ProductName", "ZLib.DLL\0" diff --git a/zlib/crc32.c b/zlib/crc32.c index e354fad..d8be051 100644 --- a/zlib/crc32.c +++ b/zlib/crc32.c @@ -12,11 +12,11 @@ /* @(#) $Id$ */ /* - Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore protection - on the static variables used to control the first-use generation of the crc - tables. Therefore if you #define DYNAMIC_CRC_TABLE, you should first call - get_crc_table() to initialize the tables before allowing more than on thread - to use crc32(). + Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore + protection on the static variables used to control the first-use generation + of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should + first call get_crc_table() to initialize the tables before allowing more than + one thread to use crc32(). */ #ifdef MAKECRCH @@ -103,51 +103,51 @@ local void make_crc_table() { unsigned long c; int n, k; - unsigned long poly; /* polynomial exclusive-or pattern */ + unsigned long poly; /* polynomial exclusive-or pattern */ /* terms of polynomial defining this crc (except x^32): */ - static volatile int first = 1; /* flag to limit concurrent making */ + static volatile int first = 1; /* flag to limit concurrent making */ static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; - /* See if another task is already doing this (not thread-safe, but better - than nothing -- significantly reduces duration of vulnerability in - case the advice about DYNAMIC_CRC_TABLE is ignored) */ - if (first) { - first = 0; - - /* make exclusive-or pattern from polynomial (0xedb88320UL) */ - poly = 0UL; - for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) - poly |= 1UL << (31 - p[n]); - - /* generate a crc for every 8-bit value */ - for (n = 0; n < 256; n++) { - c = (unsigned long)n; - for (k = 0; k < 8; k++) - c = c & 1 ? poly ^ (c >> 1) : c >> 1; - crc_table[0][n] = c; - } + /* See if another task is already doing this (not thread-safe, but better + than nothing -- significantly reduces duration of vulnerability in + case the advice about DYNAMIC_CRC_TABLE is ignored) */ + if (first) { + first = 0; + + /* make exclusive-or pattern from polynomial (0xedb88320UL) */ + poly = 0UL; + for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) + poly |= 1UL << (31 - p[n]); + + /* generate a crc for every 8-bit value */ + for (n = 0; n < 256; n++) { + c = (unsigned long)n; + for (k = 0; k < 8; k++) + c = c & 1 ? poly ^ (c >> 1) : c >> 1; + crc_table[0][n] = c; + } #ifdef BYFOUR - /* generate crc for each value followed by one, two, and three zeros, and - then the byte reversal of those as well as the first table */ - for (n = 0; n < 256; n++) { - c = crc_table[0][n]; - crc_table[4][n] = REV(c); - for (k = 1; k < 4; k++) { - c = crc_table[0][c & 0xff] ^ (c >> 8); - crc_table[k][n] = c; - crc_table[k + 4][n] = REV(c); - } - } + /* generate crc for each value followed by one, two, and three zeros, + and then the byte reversal of those as well as the first table */ + for (n = 0; n < 256; n++) { + c = crc_table[0][n]; + crc_table[4][n] = REV(c); + for (k = 1; k < 4; k++) { + c = crc_table[0][c & 0xff] ^ (c >> 8); + crc_table[k][n] = c; + crc_table[k + 4][n] = REV(c); + } + } #endif /* BYFOUR */ - crc_table_empty = 0; - } - else { /* not first */ - /* wait for the other guy to finish (not exactly efficient, but rare) */ - while (crc_table_empty) - ; - } + crc_table_empty = 0; + } + else { /* not first */ + /* wait for the other guy to finish (not efficient, but rare) */ + while (crc_table_empty) + ; + } #ifdef MAKECRCH /* write out CRC tables to crc32.h */ @@ -201,10 +201,10 @@ local void write_table(out, table) const unsigned long FAR * ZEXPORT get_crc_table(void) { #ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); + if (crc_table_empty) + make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ - return (const unsigned long FAR *)crc_table; + return (const unsigned long FAR *)crc_table; } /* ========================================================================= */ diff --git a/zlib/deflate.c b/zlib/deflate.c index a31d671..a4aa9e6 100644 --- a/zlib/deflate.c +++ b/zlib/deflate.c @@ -1,5 +1,5 @@ /* deflate.c -- compress data using the deflation algorithm - * Copyright (C) 1995-2003 Jean-loup Gailly. + * Copyright (C) 1995-2004 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ @@ -52,7 +52,7 @@ #include "deflate.h" const char deflate_copyright[] = - " deflate 1.2.1.2 Copyright 1995-2004 Jean-loup Gailly "; + " deflate 1.2.2 Copyright 1995-2004 Jean-loup Gailly "; /* 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 diff --git a/zlib/gzio.c b/zlib/gzio.c index 93e9f4d..556953e 100644 --- a/zlib/gzio.c +++ b/zlib/gzio.c @@ -460,10 +460,10 @@ int ZEXPORT gzread (gzFile file, voidp buf, unsigned len) s->z_err = Z_ERRNO; break; } - if (feof(s->file)) { /* avoid error for empty file */ - s->z_err = Z_STREAM_END; - break; - } + if (feof(s->file)) { /* avoid error for empty file */ + s->z_err = Z_STREAM_END; + break; + } } s->stream.next_in = s->inbuf; } diff --git a/zlib/infback.c b/zlib/infback.c index 8fefb92..180f0e7 100644 --- a/zlib/infback.c +++ b/zlib/infback.c @@ -424,8 +424,8 @@ int ZEXPORT inflateBack(z_stream FAR *strm, in_func in, void FAR *in_desc, out_f } } - /* handle error breaks in while */ - if (state->mode == BAD) break; + /* handle error breaks in while */ + if (state->mode == BAD) break; /* build code tables */ state->next = state->codes; diff --git a/zlib/inflate.c b/zlib/inflate.c index 6f9f8d1..6fa72db 100644 --- a/zlib/inflate.c +++ b/zlib/inflate.c @@ -112,6 +112,7 @@ int ZEXPORT inflateReset(z_streamp strm) state = (struct inflate_state FAR *)strm->state; strm->total_in = strm->total_out = state->total = 0; strm->msg = Z_NULL; + strm->adler = 1; /* to support ill-conceived Java test suite */ state->mode = HEAD; state->last = 0; state->havedict = 0; @@ -852,8 +853,8 @@ int ZEXPORT inflate(z_streamp strm, int flush) } } - /* handle error breaks in while */ - if (state->mode == BAD) break; + /* handle error breaks in while */ + if (state->mode == BAD) break; /* build code tables */ state->next = state->codes; diff --git a/zlib/inftrees.c b/zlib/inftrees.c index 2596667..3eb3733 100644 --- a/zlib/inftrees.c +++ b/zlib/inftrees.c @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate_copyright[] = - " inflate 1.2.1.2 Copyright 1995-2004 Mark Adler "; + " inflate 1.2.2 Copyright 1995-2004 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 @@ -56,7 +56,7 @@ int inflate_table(codetype type, unsigned short FAR *lens, unsigned codes, code 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 */ 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, 77, 194}; + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 198}; 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, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, diff --git a/zlib/old/README b/zlib/old/README index 06ebe3d..800bf07 100644 --- a/zlib/old/README +++ b/zlib/old/README @@ -1,3 +1,3 @@ -This directory contains files that have not been updated for zlib 1.2.1 +This directory contains files that have not been updated for zlib 1.2.x (Volunteers are encouraged to help clean this up. Thanks.) diff --git a/zlib/qnx/package.qpg b/zlib/qnx/package.qpg index 9986c6d..bf14280 100644 --- a/zlib/qnx/package.qpg +++ b/zlib/qnx/package.qpg @@ -25,10 +25,10 @@ - - - - + + + + @@ -63,7 +63,7 @@ - 1.2.1.2 + 1.2.2 Medium Stable diff --git a/zlib/win32/DLL_FAQ.txt b/zlib/win32/DLL_FAQ.txt index a3ed5dd..1746a95 100644 --- a/zlib/win32/DLL_FAQ.txt +++ b/zlib/win32/DLL_FAQ.txt @@ -175,7 +175,7 @@ in the zlib distribution, or at the following location: zlib in other programming languages. Some of them, like Ada (GNAT) and Fortran (GNU G77), have C bindings implemented initially on Unix, and relying on the C calling convention. - On the other hand, the pre- .NET versions of Microsoft Visual + On the other hand, the pre- .Net versions of Microsoft Visual Basic require STDCALL, while Borland Delphi prefers, although it does not require, FASTCALL. @@ -203,13 +203,11 @@ in the zlib distribution, or at the following location: zlib distribution. - 8. I need a DLL for my Microsoft .NET project. What can I do? + 8. I need to use zlib in my Microsoft .Net project. What can I + do? - - We did not implement a COM wrapper around zlib, so you will - have to develop it yourself, or to get it from somewhere else. - - If you would be so generous as to contribute such a wrapper, - we would like to include it in a future zlib version. + - Henrik Ravn has contributed a .Net wrapper around zlib. Look + into contrib/dotzlib/, inside the zlib distribution. 9. If my application uses ZLIB1.DLL, should I link it to diff --git a/zlib/win32/zlib1.rc b/zlib/win32/zlib1.rc index 130493a..162ab8f 100644 --- a/zlib/win32/zlib1.rc +++ b/zlib/win32/zlib1.rc @@ -5,8 +5,8 @@ VS_VERSION_INFO VERSIONINFO #else VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE #endif - FILEVERSION 1,2,1,2 - PRODUCTVERSION 1,2,1,2 + FILEVERSION 1,2,2 + PRODUCTVERSION 1,2,2 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS 1 @@ -23,12 +23,12 @@ BEGIN //language ID = U.S. English, char set = Windows, Multilingual BEGIN VALUE "FileDescription", "zlib data compression library\0" - VALUE "FileVersion", "1.2.1.2\0" + VALUE "FileVersion", "1.2.2\0" VALUE "InternalName", "zlib1.dll\0" VALUE "LegalCopyright", "(C) 1995-2004 Jean-loup Gailly & Mark Adler\0" VALUE "OriginalFilename", "zlib1.dll\0" VALUE "ProductName", "zlib\0" - VALUE "ProductVersion", "1.2.1.2\0" + VALUE "ProductVersion", "1.2.2\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" END END diff --git a/zlib/zlib.3 b/zlib/zlib.3 index 54655cd..3139e24 100644 --- a/zlib/zlib.3 +++ b/zlib/zlib.3 @@ -1,4 +1,4 @@ -.TH ZLIB 3 "9 September 2004" +.TH ZLIB 3 "3 October 2004" .SH NAME zlib \- compression/decompression library .SH SYNOPSIS @@ -133,7 +133,7 @@ before asking for help. Send questions and/or comments to zlib@gzip.org, or (for the Windows DLL version) to Gilles Vollant (info@winimage.com). .SH AUTHORS -Version 1.2.1.2 +Version 1.2.2 Copyright (C) 1995-2004 Jean-loup Gailly (jloup@gzip.org) and Mark Adler (madler@alumni.caltech.edu). .LP diff --git a/zlib/zlib.h b/zlib/zlib.h index 44540a8..d56e60f 100644 --- a/zlib/zlib.h +++ b/zlib/zlib.h @@ -1,5 +1,5 @@ /* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.1.2, September 9th, 2004 + version 1.2.2, October 3rd, 2004 Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler @@ -37,8 +37,8 @@ extern "C" { #endif -#define ZLIB_VERSION "1.2.1.2" -#define ZLIB_VERNUM 0x1212 +#define ZLIB_VERSION "1.2.2" +#define ZLIB_VERNUM 0x1220 /* The 'zlib' compression library provides in-memory compression and @@ -53,24 +53,22 @@ extern "C" { application must provide more input and/or consume the output (providing more output space) before each call. - The compressed data format used by the in-memory functions is the zlib - format, which is a zlib wrapper documented in RFC 1950, wrapped around a - deflate stream, which is itself documented in RFC 1951. + The compressed data format used by default by the in-memory functions is + the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped + around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + This library can optionally read and write gzip streams in memory as well. + The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- file compression on file systems, has a larger header than zlib to maintain directory information, and uses a different, slower check method than zlib. - This library does not provide any functions to write gzip files in memory. - However such functions could be easily written using zlib's deflate function, - the documentation in the gzip RFC, and the examples in gzio.c. - The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in case of corrupted input. @@ -493,7 +491,8 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), - no header crc, and the operating system will be set to 255 (unknown). + no header crc, and the operating system will be set to 255 (unknown). If a + gzip stream is being written, strm->adler is a crc32 instead of an adler32. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but @@ -670,7 +669,8 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will - return a Z_DATA_ERROR). + return a Z_DATA_ERROR. If a gzip stream is being decoded, strm->adler is + a crc32 instead of an adler32. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative -- 2.7.4