From 7147f24cd7b27dd95f6e841851a111cb311a9c07 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Fri, 9 Sep 2011 23:34:30 -0700 Subject: zlib 1.2.4.2 --- contrib/delphi/ZLib.pas | 2 +- contrib/dotzlib/DotZLib/UnitTests.cs | 2 +- contrib/infback9/inftree9.c | 4 +-- contrib/masmx64/readme.txt | 8 +++--- contrib/masmx86/readme.txt | 52 ++++++++++++++++++------------------ contrib/pascal/zlibpas.pas | 2 +- contrib/puff/puff.c | 29 ++++++++++++++------ contrib/puff/puff.h | 4 +-- contrib/vstudio/vc10/zlib.rc | 6 ++--- contrib/vstudio/vc9/zlib.rc | 6 ++--- 10 files changed, 64 insertions(+), 51 deletions(-) (limited to 'contrib') diff --git a/contrib/delphi/ZLib.pas b/contrib/delphi/ZLib.pas index 03450e7..72ef99f 100644 --- a/contrib/delphi/ZLib.pas +++ b/contrib/delphi/ZLib.pas @@ -152,7 +152,7 @@ procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer; const OutBuf: Pointer; BufSize: Integer); const - zlib_version = '1.2.4.1'; + zlib_version = '1.2.4.2'; type EZlibError = class(Exception); diff --git a/contrib/dotzlib/DotZLib/UnitTests.cs b/contrib/dotzlib/DotZLib/UnitTests.cs index 82c749e..6cfdaa7 100644 --- a/contrib/dotzlib/DotZLib/UnitTests.cs +++ b/contrib/dotzlib/DotZLib/UnitTests.cs @@ -156,7 +156,7 @@ namespace DotZLibTests public void Info_Version() { Info info = new Info(); - Assert.AreEqual("1.2.4.1", Info.Version); + Assert.AreEqual("1.2.4.2", Info.Version); Assert.AreEqual(32, info.SizeOfUInt); Assert.AreEqual(32, info.SizeOfULong); Assert.AreEqual(32, info.SizeOfPointer); diff --git a/contrib/infback9/inftree9.c b/contrib/infback9/inftree9.c index e898893..362008c 100644 --- a/contrib/infback9/inftree9.c +++ b/contrib/infback9/inftree9.c @@ -9,7 +9,7 @@ #define MAXBITS 15 const char inflate9_copyright[] = - " inflate9 1.2.4.1 Copyright 1995-2010 Mark Adler "; + " inflate9 1.2.4.2 Copyright 1995-2010 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, 67, 206}; + 133, 133, 133, 133, 144, 202, 75}; 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/contrib/masmx64/readme.txt b/contrib/masmx64/readme.txt index 1115d9b..2da6733 100644 --- a/contrib/masmx64/readme.txt +++ b/contrib/masmx64/readme.txt @@ -12,10 +12,10 @@ inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing Use instructions ---------------- -Assemble the .asm files using MASM and put the object files into the zlib source -directory. You can also get object files here: - - http://www.winimage.com/zLibDll/zlib124_masm_obj.zip +Assemble the .asm files using MASM and put the object files into the zlib source +directory. You can also get object files here: + + http://www.winimage.com/zLibDll/zlib124_masm_obj.zip define ASMV and ASMINF in your project. Include inffas8664.c in your source tree, and inffasx64.obj and gvmat64.obj as object to link. diff --git a/contrib/masmx86/readme.txt b/contrib/masmx86/readme.txt index 90230f2..3271f72 100644 --- a/contrib/masmx86/readme.txt +++ b/contrib/masmx86/readme.txt @@ -1,27 +1,27 @@ - -Summary -------- -This directory contains ASM implementations of the functions -longest_match() and inflate_fast(). - - -Use instructions ----------------- -Assemble using MASM, and copy the object files into the zlib source -directory, then run the appropriate makefile, as suggested below. You can -donwload MASM from here: - + +Summary +------- +This directory contains ASM implementations of the functions +longest_match() and inflate_fast(). + + +Use instructions +---------------- +Assemble using MASM, and copy the object files into the zlib source +directory, then run the appropriate makefile, as suggested below. You can +donwload MASM from here: + http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64 - -You can also get objects files here: - - http://www.winimage.com/zLibDll/zlib124_masm_obj.zip - -Build instructions ------------------- -* With Microsoft C and MASM: -nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" - -* With Borland C and TASM: -make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" - + +You can also get objects files here: + + http://www.winimage.com/zLibDll/zlib124_masm_obj.zip + +Build instructions +------------------ +* With Microsoft C and MASM: +nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" + +* With Borland C and TASM: +make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj" + diff --git a/contrib/pascal/zlibpas.pas b/contrib/pascal/zlibpas.pas index 9772f11..e0bc74b 100644 --- a/contrib/pascal/zlibpas.pas +++ b/contrib/pascal/zlibpas.pas @@ -10,7 +10,7 @@ unit zlibpas; interface const - ZLIB_VERSION = '1.2.4.1'; + ZLIB_VERSION = '1.2.4.2'; type alloc_func = function(opaque: Pointer; items, size: Integer): Pointer; diff --git a/contrib/puff/puff.c b/contrib/puff/puff.c index df5b79f..650694e 100644 --- a/contrib/puff/puff.c +++ b/contrib/puff/puff.c @@ -1,8 +1,8 @@ /* * puff.c - * Copyright (C) 2002-2008 Mark Adler + * Copyright (C) 2002-2010 Mark Adler * For conditions of distribution and use, see copyright notice in puff.h - * version 2.0, 25 Jul 2008 + * version 2.1, 4 Apr 2010 * * puff.c is a simple inflate written to be an unambiguous way to specify the * deflate format. It is not written for speed but rather simplicity. As a @@ -67,6 +67,8 @@ * - Add option in TEST code for puff to write the data * - Add option in TEST code to skip input bytes * - Allow TEST code to read from piped stdin + * 2.1 4 Apr 2010 - Avoid variable initialization for happier compilers + * - Avoid unsigned comparisons for even happier compilers */ #include /* for setjmp(), longjmp(), and jmp_buf */ @@ -516,8 +518,7 @@ local int fixed(struct state *s) static int virgin = 1; static short lencnt[MAXBITS+1], lensym[FIXLCODES]; static short distcnt[MAXBITS+1], distsym[MAXDCODES]; - static struct huffman lencode = {lencnt, lensym}; - static struct huffman distcode = {distcnt, distsym}; + static struct huffman lencode, distcode; /* build fixed huffman tables if first call (may not be thread safe) */ if (virgin) { @@ -540,6 +541,12 @@ local int fixed(struct state *s) lengths[symbol] = 5; construct(&distcode, lengths, MAXDCODES); + /* construct lencode and distcode */ + lencode.count = lencnt; + lencode.symbol = lensym; + distcode.count = distcnt; + distcode.symbol = distsym; + /* do this just once */ virgin = 0; } @@ -643,11 +650,16 @@ local int dynamic(struct state *s) short lengths[MAXCODES]; /* descriptor code lengths */ short lencnt[MAXBITS+1], lensym[MAXLCODES]; /* lencode memory */ short distcnt[MAXBITS+1], distsym[MAXDCODES]; /* distcode memory */ - struct huffman lencode = {lencnt, lensym}; /* length code */ - struct huffman distcode = {distcnt, distsym}; /* distance code */ + struct huffman lencode, distcode; /* length and distance codes */ static const short order[19] = /* permutation of code length codes */ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; + /* construct lencode and distcode */ + lencode.count = lencnt; + lencode.symbol = lensym; + distcode.count = distcnt; + distcode.symbol = distsym; + /* get number of lengths in each table, check lengths */ nlen = bits(s, 5) + 257; ndist = bits(s, 5) + 1; @@ -869,7 +881,8 @@ local void *load(char *name, size_t *len) int main(int argc, char **argv) { - int ret, skip = 0, put = 0; + int ret, put = 0; + unsigned skip = 0; char *arg, *name = NULL; unsigned char *source = NULL, *dest; size_t len = 0; @@ -881,7 +894,7 @@ int main(int argc, char **argv) if (arg[1] == 'w' && arg[2] == 0) put = 1; else if (arg[1] >= '0' && arg[1] <= '9') - skip = atoi(arg + 1); + skip = (unsigned)atoi(arg + 1); else { fprintf(stderr, "invalid option %s\n", arg); return 3; diff --git a/contrib/puff/puff.h b/contrib/puff/puff.h index 8d7f5f8..88d1b38 100644 --- a/contrib/puff/puff.h +++ b/contrib/puff/puff.h @@ -1,6 +1,6 @@ /* puff.h - Copyright (C) 2002-2008 Mark Adler, all rights reserved - version 1.9, 10 Jan 2008 + Copyright (C) 2002-2010 Mark Adler, all rights reserved + version 2.1, 4 Apr 2010 This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages diff --git a/contrib/vstudio/vc10/zlib.rc b/contrib/vstudio/vc10/zlib.rc index d6b9991..38615f0 100644 --- a/contrib/vstudio/vc10/zlib.rc +++ b/contrib/vstudio/vc10/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1,2,4,1 - PRODUCTVERSION 1,2,4,1 + FILEVERSION 1,2,4,2 + PRODUCTVERSION 1,2,4,2 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.4.1\0" + VALUE "FileVersion", "1.2.4.2\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlib.dll\0" VALUE "ProductName", "ZLib.DLL\0" diff --git a/contrib/vstudio/vc9/zlib.rc b/contrib/vstudio/vc9/zlib.rc index d6b9991..38615f0 100644 --- a/contrib/vstudio/vc9/zlib.rc +++ b/contrib/vstudio/vc9/zlib.rc @@ -2,8 +2,8 @@ #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION 1,2,4,1 - PRODUCTVERSION 1,2,4,1 + FILEVERSION 1,2,4,2 + PRODUCTVERSION 1,2,4,2 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 @@ -17,7 +17,7 @@ BEGIN BEGIN VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0" - VALUE "FileVersion", "1.2.4.1\0" + VALUE "FileVersion", "1.2.4.2\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlib.dll\0" VALUE "ProductName", "ZLib.DLL\0" -- cgit v1.2.3-55-g6feb