Skip to content

Commit 5372a0f

Browse files
committed
1.3
1 parent 3bab137 commit 5372a0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+2258
-3328
lines changed

zlib/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
cmake_minimum_required(VERSION 2.4.4)
1+
cmake_minimum_required(VERSION 2.4.4...3.15.0)
22
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
33

44
project(zlib C)
55

6-
set(VERSION "1.2.13")
6+
set(VERSION "1.3")
77

88
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
99
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")

zlib/ChangeLog

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11

22
ChangeLog file for zlib
33

4+
Changes in 1.3 (18 Aug 2023)
5+
- Remove K&R function definitions and zlib2ansi
6+
- Fix bug in deflateBound() for level 0 and memLevel 9
7+
- Fix bug when gzungetc() is used immediately after gzopen()
8+
- Fix bug when using gzflush() with a very small buffer
9+
- Fix crash when gzsetparams() attempted for transparent write
10+
- Fix test/example.c to work with FORCE_STORED
11+
- Rewrite of zran in examples (see zran.c version history)
12+
- Fix minizip to allow it to open an empty zip file
13+
- Fix reading disk number start on zip64 files in minizip
14+
- Fix logic error in minizip argument processing
15+
- Add minizip testing to Makefile
16+
- Read multiple bytes instead of byte-by-byte in minizip unzip.c
17+
- Add memory sanitizer to configure (--memory)
18+
- Various portability improvements
19+
- Various documentation improvements
20+
- Various spelling and typo corrections
21+
422
Changes in 1.2.13 (13 Oct 2022)
523
- Fix configure issue that discarded provided CC definition
624
- Correct incorrect inputs provided to the CRC functions
@@ -1445,7 +1463,7 @@ Changes in 0.99 (27 Jan 96)
14451463
- fix typo in Make_vms.com (f$trnlnm -> f$getsyi)
14461464
- in fcalloc, normalize pointer if size > 65520 bytes
14471465
- don't use special fcalloc for 32 bit Borland C++
1448-
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
1466+
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc.
14491467
- use Z_BINARY instead of BINARY
14501468
- document that gzclose after gzdopen will close the file
14511469
- allow "a" as mode in gzopen

zlib/FAQ

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
If your question is not there, please check the zlib home page
66
http://zlib.net/ which may have more recent information.
7-
The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
7+
The latest zlib FAQ is at http://zlib.net/zlib_faq.html
88

99

1010
1. Is zlib Y2K-compliant?

zlib/Makefile.in

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CPP=$(CC) -E
2828

2929
STATICLIB=libz.a
3030
SHAREDLIB=libz.so
31-
SHAREDLIBV=libz.so.1.2.13
31+
SHAREDLIBV=libz.so.1.3
3232
SHAREDLIBM=libz.so.1
3333
LIBS=$(STATICLIB) $(SHAREDLIBV)
3434

@@ -359,8 +359,14 @@ zconf.h.cmakein: $(SRCDIR)zconf.h.in
359359
zconf: $(SRCDIR)zconf.h.in
360360
cp -p $(SRCDIR)zconf.h.in zconf.h
361361

362+
minizip-test: static
363+
cd contrib/minizip && { CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; }
364+
365+
minizip-clean:
366+
cd contrib/minizip && { $(MAKE) clean ; cd ../.. ; }
367+
362368
mostlyclean: clean
363-
clean:
369+
clean: minizip-clean
364370
rm -f *.o *.lo *~ \
365371
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
366372
example64$(EXE) minigzip64$(EXE) \

zlib/README

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ZLIB DATA COMPRESSION LIBRARY
22

3-
zlib 1.2.13 is a general purpose data compression library. All the code is
3+
zlib 1.3 is a general purpose data compression library. All the code is
44
thread safe. The data format used by the zlib library is described by RFCs
55
(Request for Comments) 1950 to 1952 in the files
66
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@@ -29,18 +29,17 @@ PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help.
2929

3030
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
3131
issue of Dr. Dobb's Journal; a copy of the article is available at
32-
http://marknelson.us/1997/01/01/zlib-engine/ .
32+
https://marknelson.us/posts/1997/01/01/zlib-engine.html .
3333

34-
The changes made in version 1.2.13 are documented in the file ChangeLog.
34+
The changes made in version 1.3 are documented in the file ChangeLog.
3535

3636
Unsupported third party contributions are provided in directory contrib/ .
3737

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

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

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

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

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

8584
Copyright notice:
8685

87-
(C) 1995-2022 Jean-loup Gailly and Mark Adler
86+
(C) 1995-2023 Jean-loup Gailly and Mark Adler
8887

8988
This software is provided 'as-is', without any express or implied
9089
warranty. In no event will the authors be held liable for any damages

zlib/adler32.c

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
#include "zutil.h"
99

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

6260
/* ========================================================================= */
63-
uLong ZEXPORT adler32_z(adler, buf, len)
64-
uLong adler;
65-
const Bytef *buf;
66-
z_size_t len;
67-
{
61+
uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
6862
unsigned long sum2;
6963
unsigned n;
7064

@@ -131,20 +125,12 @@ uLong ZEXPORT adler32_z(adler, buf, len)
131125
}
132126

133127
/* ========================================================================= */
134-
uLong ZEXPORT adler32(adler, buf, len)
135-
uLong adler;
136-
const Bytef *buf;
137-
uInt len;
138-
{
128+
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
139129
return adler32_z(adler, buf, len);
140130
}
141131

142132
/* ========================================================================= */
143-
local uLong adler32_combine_(adler1, adler2, len2)
144-
uLong adler1;
145-
uLong adler2;
146-
z_off64_t len2;
147-
{
133+
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) {
148134
unsigned long sum1;
149135
unsigned long sum2;
150136
unsigned rem;
@@ -169,18 +155,10 @@ local uLong adler32_combine_(adler1, adler2, len2)
169155
}
170156

171157
/* ========================================================================= */
172-
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
173-
uLong adler1;
174-
uLong adler2;
175-
z_off_t len2;
176-
{
158+
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) {
177159
return adler32_combine_(adler1, adler2, len2);
178160
}
179161

180-
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
181-
uLong adler1;
182-
uLong adler2;
183-
z_off64_t len2;
184-
{
162+
uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) {
185163
return adler32_combine_(adler1, adler2, len2);
186164
}

zlib/compress.c

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,8 @@
1919
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
2020
Z_STREAM_ERROR if the level parameter is invalid.
2121
*/
22-
int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
23-
Bytef *dest;
24-
uLongf *destLen;
25-
const Bytef *source;
26-
uLong sourceLen;
27-
int level;
28-
{
22+
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
23+
uLong sourceLen, int level) {
2924
z_stream stream;
3025
int err;
3126
const uInt max = (uInt)-1;
@@ -65,22 +60,16 @@ int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
6560

6661
/* ===========================================================================
6762
*/
68-
int ZEXPORT compress(dest, destLen, source, sourceLen)
69-
Bytef *dest;
70-
uLongf *destLen;
71-
const Bytef *source;
72-
uLong sourceLen;
73-
{
63+
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
64+
uLong sourceLen) {
7465
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
7566
}
7667

7768
/* ===========================================================================
7869
If the default memLevel or windowBits for deflateInit() is changed, then
7970
this function needs to be updated.
8071
*/
81-
uLong ZEXPORT compressBound(sourceLen)
82-
uLong sourceLen;
83-
{
72+
uLong ZEXPORT compressBound(uLong sourceLen) {
8473
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
8574
(sourceLen >> 25) + 13;
8675
}

zlib/configure

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ STATICLIB=libz.a
4444

4545
# extract zlib version numbers from zlib.h
4646
VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h`
47-
VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < ${SRCDIR}zlib.h`
48-
VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
4947
VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
5048

5149
# establish commands for library building
@@ -90,7 +88,8 @@ build64=0
9088
gcc=0
9189
warn=0
9290
debug=0
93-
sanitize=0
91+
address=0
92+
memory=0
9493
old_cc="$CC"
9594
old_cflags="$CFLAGS"
9695
OBJC='$(OBJZ) $(OBJG)'
@@ -102,7 +101,7 @@ leave()
102101
if test "$*" != "0"; then
103102
echo "** $0 aborting." | tee -a configure.log
104103
fi
105-
rm -f $test.[co] $test $test$shared_ext $test.gcno ./--version
104+
rm -rf $test.[co] $test $test$shared_ext $test.gcno $test.dSYM ./--version
106105
echo -------------------- >> configure.log
107106
echo >> configure.log
108107
echo >> configure.log
@@ -141,7 +140,9 @@ case "$1" in
141140
-c* | --const) zconst=1; shift ;;
142141
-w* | --warn) warn=1; shift ;;
143142
-d* | --debug) debug=1; shift ;;
144-
--sanitize) sanitize=1; shift ;;
143+
--sanitize) address=1; shift ;;
144+
--address) address=1; shift ;;
145+
--memory) memory=1; shift ;;
145146
*)
146147
echo "unknown option: $1" | tee -a configure.log
147148
echo "$0 --help for help" | tee -a configure.log
@@ -211,8 +212,11 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
211212
CFLAGS="${CFLAGS} -Wall -Wextra"
212213
fi
213214
fi
214-
if test $sanitize -eq 1; then
215-
CFLAGS="${CFLAGS} -g -fsanitize=address"
215+
if test $address -eq 1; then
216+
CFLAGS="${CFLAGS} -g -fsanitize=address -fno-omit-frame-pointer"
217+
fi
218+
if test $memory -eq 1; then
219+
CFLAGS="${CFLAGS} -g -fsanitize=memory -fno-omit-frame-pointer"
216220
fi
217221
if test $debug -eq 1; then
218222
CFLAGS="${CFLAGS} -DZLIB_DEBUG"
@@ -259,8 +263,10 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
259263
SHAREDLIB=libz$shared_ext
260264
SHAREDLIBV=libz.$VER$shared_ext
261265
SHAREDLIBM=libz.$VER1$shared_ext
262-
LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
263-
if libtool -V 2>&1 | grep Apple > /dev/null; then
266+
LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER"}
267+
if "${CROSS_PREFIX}libtool" -V 2>&1 | grep Apple > /dev/null; then
268+
AR="${CROSS_PREFIX}libtool"
269+
elif libtool -V 2>&1 | grep Apple > /dev/null; then
264270
AR="libtool"
265271
else
266272
AR="/usr/bin/libtool"
@@ -860,7 +866,7 @@ echo prefix = $prefix >> configure.log
860866
echo sharedlibdir = $sharedlibdir >> configure.log
861867
echo uname = $uname >> configure.log
862868

863-
# udpate Makefile with the configure results
869+
# update Makefile with the configure results
864870
sed < ${SRCDIR}Makefile.in "
865871
/^CC *=/s#=.*#=$CC#
866872
/^CFLAGS *=/s#=.*#=$CFLAGS#

zlib/contrib/ada/readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ It provides Ada-style access to the ZLib C library.
88

99
Here are the main changes since ZLib.Ada 1.2:
1010

11-
- Attension: ZLib.Read generic routine have a initialization requirement
12-
for Read_Last parameter now. It is a bit incompartible with previous version,
11+
- Attention: ZLib.Read generic routine have a initialization requirement
12+
for Read_Last parameter now. It is a bit incompatible with previous version,
1313
but extends functionality, we could use new parameters Allow_Read_Some and
1414
Flush now.
1515

zlib/contrib/ada/test.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ procedure Test is
6565
Time_Stamp : Ada.Calendar.Time;
6666

6767
procedure Generate_File;
68-
-- Generate file of spetsified size with some random data.
68+
-- Generate file of specified size with some random data.
6969
-- The random data is repeatable, for the good compression.
7070

7171
procedure Compare_Streams
7272
(Left, Right : in out Root_Stream_Type'Class);
73-
-- The procedure compearing data in 2 streams.
73+
-- The procedure comparing data in 2 streams.
7474
-- It is for compare data before and after compression/decompression.
7575

7676
procedure Compare_Files (Left, Right : String);

0 commit comments

Comments
 (0)