Skip to content

Commit

Permalink
update zlib for minor fixen
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaller committed Jul 19, 2024
1 parent ed91685 commit c6331cc
Show file tree
Hide file tree
Showing 16 changed files with 979 additions and 1,112 deletions.
1 change: 1 addition & 0 deletions VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ development head (in the master branch):
add a label next to the Jump button that shows the declaration of the script block containing the selection; clicking it runs the Jump menu
sort recipes by correct numerical order, in both the Recipes menu and the Find Recipe panel, on all platforms
update Robin Hood Hashing to 3.11.5 to get some minor fixes
update zlib from 1.2.13 to 1.3.1 to get some minor fixes


version 4.2.2 (Eidos version 3.2.2):
Expand Down
34 changes: 31 additions & 3 deletions eidos_zlib/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@

ChangeLog file for zlib

Changes in 1.2.13.f-slim (12 Apr 2023)
Changes in 1.3.1.f-slim (18 Jul 2024)
- Revised for inclusion in SLiM, by removing unused code
- Configured with ./configure --zprefix on macOS 10.15.3
- Configured with ./configure --zprefix on macOS 10.15.3 (carried over from previous SLiM config run)

Changes in 1.3.1 (22 Jan 2024)
- Reject overflows of zip header fields in minizip
- Fix bug in inflateSync() for data held in bit buffer
- Add LIT_MEM define to use more memory for a small deflate speedup
- Fix decision on the emission of Zip64 end records in minizip
- Add bounds checking to ERR_MSG() macro, used by zError()
- Neutralize zip file traversal attacks in miniunz
- Fix a bug in ZLIB_DEBUG compiles in check_match()
- Various portability and appearance improvements

Changes in 1.3 (18 Aug 2023)
- Remove K&R function definitions and zlib2ansi
- Fix bug in deflateBound() for level 0 and memLevel 9
- Fix bug when gzungetc() is used immediately after gzopen()
- Fix bug when using gzflush() with a very small buffer
- Fix crash when gzsetparams() attempted for transparent write
- Fix test/example.c to work with FORCE_STORED
- Rewrite of zran in examples (see zran.c version history)
- Fix minizip to allow it to open an empty zip file
- Fix reading disk number start on zip64 files in minizip
- Fix logic error in minizip argument processing
- Add minizip testing to Makefile
- Read multiple bytes instead of byte-by-byte in minizip unzip.c
- Add memory sanitizer to configure (--memory)
- Various portability improvements
- Various documentation improvements
- Various spelling and typo corrections

Changes in 1.2.13 (13 Oct 2022)
- Fix configure issue that discarded provided CC definition
Expand Down Expand Up @@ -1449,7 +1477,7 @@ Changes in 0.99 (27 Jan 96)
- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
- in fcalloc, normalize pointer if size > 65520 bytes
- don't use special fcalloc for 32 bit Borland C++
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc.
- use Z_BINARY instead of BINARY
- document that gzclose after gzdopen will close the file
- allow "a" as mode in gzopen
Expand Down
19 changes: 9 additions & 10 deletions eidos_zlib/README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ZLIB DATA COMPRESSION LIBRARY

zlib 1.2.13 is a general purpose data compression library. All the code is
zlib 1.3.1 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://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
Expand Down Expand Up @@ -29,18 +29,17 @@ PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.

Mark Nelson <[email protected]> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available at
http://marknelson.us/1997/01/01/zlib-engine/ .
https://marknelson.us/posts/1997/01/01/zlib-engine.html .

The changes made in version 1.2.13 are documented in the file ChangeLog.
The changes made in version 1.3.1 are documented in the file ChangeLog.

Unsupported third party contributions are provided in directory contrib/ .

zlib is available in Java using the java.util.zip package, documented at
http://java.sun.com/developer/technicalArticles/Programming/compression/ .
zlib is available in Java using the java.util.zip package. Follow the API
Documentation link at: https://docs.oracle.com/search/?q=java.util.zip .

A Perl interface to zlib written by Paul Marquess <[email protected]> is available
at CPAN (Comprehensive Perl Archive Network) sites, including
http://search.cpan.org/~pmqs/IO-Compress-Zlib/ .
A Perl interface to zlib and bzip2 written by Paul Marquess <[email protected]>
can be found at https://github.com/pmqs/IO-Compress .

A Python interface to zlib written by A.M. Kuchling <[email protected]> is
available in Python 1.5 and later versions, see
Expand All @@ -64,7 +63,7 @@ Notes for some targets:
- zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works
when compiled with cc.

- On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is
- On Digital Unix 4.0D (formerly OSF/1) on AlphaServer, the cc option -std1 is
necessary to get gzprintf working correctly. This is done by configure.

- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with
Expand All @@ -84,7 +83,7 @@ Acknowledgments:

Copyright notice:

(C) 1995-2022 Jean-loup Gailly and Mark Adler
(C) 1995-2024 Jean-loup Gailly and Mark Adler

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
20 changes: 5 additions & 15 deletions eidos_zlib/adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

#include "zutil.h"

local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));

#define BASE 65521U /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
Expand Down Expand Up @@ -60,8 +58,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#endif

/* ========================================================================= */
uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) // BCH: rearranged to get rid of prototype warning
{
uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
unsigned long sum2;
unsigned n;

Expand Down Expand Up @@ -128,14 +125,12 @@ uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) // BCH: rea
}

/* ========================================================================= */
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) // BCH: rearranged to get rid of prototype warning
{
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
return adler32_z(adler, buf, len);
}

/* ========================================================================= */
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) // BCH: rearranged to get rid of prototype warning
{
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) {
unsigned long sum1;
unsigned long sum2;
unsigned rem;
Expand All @@ -160,19 +155,14 @@ local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) // BCH:
}

/* ========================================================================= */
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) // BCH: rearranged to get rid of prototype warning
{
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) {
return adler32_combine_(adler1, adler2, len2);
}

// BCH 9/29/2021: This function appears to be unused in this branch of the code,
// and produces a warning on Windows, so I'm going to just #if it out.
#if 0
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) {
return adler32_combine_(adler1, adler2, len2);
}
#endif
Expand Down
11 changes: 5 additions & 6 deletions eidos_zlib/compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level) // BCH: rearranged to get rid of prototype warning
{
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
uLong sourceLen, int level) {
z_stream stream;
int err;
const uInt max = (uInt)-1;
Expand Down Expand Up @@ -60,17 +60,16 @@ int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source, uLong s

/* ===========================================================================
*/
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen) // BCH: rearranged to get rid of prototype warning
{
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
uLong sourceLen) {
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
}

/* ===========================================================================
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
uLong ZEXPORT compressBound(uLong sourceLen) // BCH: rearranged to get rid of prototype warning
{
uLong ZEXPORT compressBound(uLong sourceLen) {
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
}
Loading

0 comments on commit c6331cc

Please sign in to comment.