Skip to content

Commit 10daf0d

Browse files
committed
zlib 1.2.5.1
1 parent 9712272 commit 10daf0d

Some content is hidden

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

55 files changed

+1004
-522
lines changed

ChangeLog

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,57 @@
11

22
ChangeLog file for zlib
33

4+
Changes in 1.2.5.1 (10 Sep 2011)
5+
- Update FAQ entry on shared builds (#13)
6+
- Avoid symbolic argument to chmod in Makefile.in
7+
- Fix bug and add consts in contrib/puff [Oberhumer]
8+
- Update contrib/puff/zeros.raw test file to have all block types
9+
- Add full coverage test for puff in contrib/puff/Makefile
10+
- Fix static-only-build install in Makefile.in
11+
- Fix bug in unzGetCurrentFileInfo() in contrib/minizip [Kuno]
12+
- Add libz.a dependency to shared in Makefile.in for parallel builds
13+
- Spell out "number" (instead of "nb") in zlib.h for total_in, total_out
14+
- Replace $(...) with `...` in configure for non-bash sh [Bowler]
15+
- Add darwin* to Darwin* and solaris* to SunOS\ 5* in configure [Groffen]
16+
- Add solaris* to Linux* in configure to allow gcc use [Groffen]
17+
- Add *bsd* to Linux* case in configure [Bar-Lev]
18+
- Add inffast.obj to dependencies in win32/Makefile.msc
19+
- Correct spelling error in deflate.h [Kohler]
20+
- Change libzdll.a again to libz.dll.a (!) in win32/Makefile.gcc
21+
- Add test to configure for GNU C looking for gcc in output of $cc -v
22+
- Add zlib.pc generation to win32/Makefile.gcc [Weigelt]
23+
- Fix bug in zlib.h for _FILE_OFFSET_BITS set and _LARGEFILE64_SOURCE not
24+
- Add comment in zlib.h that adler32_combine with len2 < 0 makes no sense
25+
- Make NO_DIVIDE option in adler32.c much faster (thanks to John Reiser)
26+
- Make stronger test in zconf.h to include unistd.h for LFS
27+
- Apply Darwin patches for 64-bit file offsets to contrib/minizip [Slack]
28+
- Fix zlib.h LFS support when Z_PREFIX used
29+
- Add updated as400 support (removed from old) [Monnerat]
30+
- Avoid deflate sensitivity to volatile input data
31+
- Avoid division in adler32_combine for NO_DIVIDE
32+
- Clarify the use of Z_FINISH with deflateBound() amount of space
33+
- Set binary for output file in puff.c
34+
- Use u4 type for crc_table to avoid conversion warnings
35+
- Apply casts in zlib.h to avoid conversion warnings
36+
- Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
37+
- Improve inflateSync() documentation to note indeterminancy
38+
- Add deflatePending() function to return the amount of pending output
39+
- Correct the spelling of "specification" in FAQ [Randers-Pehrson]
40+
- Add a check in configure for stdarg.h, use for gzprintf()
41+
- Check that pointers fit in ints when gzprint() compiled old style
42+
- Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
43+
- Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
44+
- Add debug records in assmebler code [Londer]
45+
- Update RFC references to use http://tools.ietf.org/html/... [Li]
46+
- Add --archs option, use of libtool to configure for Mac OS X [Borstel]
47+
448
Changes in 1.2.5 (19 Apr 2010)
549
- Disable visibility attribute in win32/Makefile.gcc [Bar-Lev]
650
- Default to libdir as sharedlibdir in configure [Nieder]
751
- Update copyright dates on modified source files
852
- Update trees.c to be able to generate modified trees.h
953
- Exit configure for MinGW, suggesting win32/Makefile.gcc
54+
- Check for NULL path in gz_open [Homurlu]
1055

1156
Changes in 1.2.4.5 (18 Apr 2010)
1257
- Set sharedlibdir in configure [Torok]
@@ -261,7 +306,7 @@ Changes in 1.2.3.4 (21 Dec 2009)
261306
- Clear bytes after deflate lookahead to avoid use of uninitialized data
262307
- Change a limit in inftrees.c to be more transparent to Coverity Prevent
263308
- Update win32/zlib.def with exported symbols from zlib.h
264-
- Correct spelling error in zlib.h [Willem]
309+
- Correct spelling errors in zlib.h [Willem, Sobrado]
265310
- Allow Z_BLOCK for deflate() to force a new block
266311
- Allow negative bits in inflatePrime() to delete existing bit buffer
267312
- Add Z_TREES flush option to inflate() to return at end of trees

FAQ

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
8484

8585
13. How can I make a Unix shared library?
8686

87-
make clean
88-
./configure -s
87+
By default a shared (and a static) library is built for Unix. So:
88+
89+
make distclean
90+
./configure
8991
make
9092

9193
14. How do I install a shared zlib library on Unix?
@@ -325,7 +327,7 @@ The lastest zlib FAQ is at http://zlib.net/zlib_faq.html
325327
correctly points to the zlib specification in RFC 1950 for the "deflate"
326328
transfer encoding, there have been reports of servers and browsers that
327329
incorrectly produce or expect raw deflate data per the deflate
328-
specficiation in RFC 1951, most notably Microsoft. So even though the
330+
specification in RFC 1951, most notably Microsoft. So even though the
329331
"deflate" transfer encoding using the zlib format would be the more
330332
efficient approach (and in fact exactly what the zlib format was designed
331333
for), using the "gzip" transfer encoding is probably more reliable due to

INDEX

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ zlib.pc.in Template for pkg-config descriptor
1717
zlib2ansi perl script to convert source files for C++ compilation
1818

1919
amiga/ makefiles for Amiga SAS C
20+
as400/ makefiles for AS/400
2021
doc/ documentation for formats and algorithms
2122
msdos/ makefiles for MSDOS
2223
nintendods/ makefile for Nintendo DS

Makefile.in

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Makefile for zlib
2-
# Copyright (C) 1995-2010 Jean-loup Gailly.
2+
# Copyright (C) 1995-2011 Jean-loup Gailly.
33
# For conditions of distribution and use, see copyright notice in zlib.h
44

55
# To compile and test, type:
@@ -32,7 +32,7 @@ CPP=$(CC) -E
3232

3333
STATICLIB=libz.a
3434
SHAREDLIB=libz.so
35-
SHAREDLIBV=libz.so.1.2.5
35+
SHAREDLIBV=libz.so.1.2.5.1
3636
SHAREDLIBM=libz.so.1
3737
LIBS=$(STATICLIB) $(SHAREDLIBV)
3838

@@ -136,7 +136,7 @@ minigzip64.o: minigzip.c zlib.h zconf.h
136136
$(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
137137
-@mv objs/$*.o $@
138138

139-
$(SHAREDLIBV): $(PIC_OBJS)
139+
placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
140140
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
141141
rm -f $(SHAREDLIB) $(SHAREDLIBM)
142142
ln -s $@ $(SHAREDLIB)
@@ -168,14 +168,16 @@ install-libs: $(LIBS)
168168
-@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
169169
-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
170170
cp $(STATICLIB) $(DESTDIR)$(libdir)
171-
cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)
172-
cd $(DESTDIR)$(libdir); chmod u=rw,go=r $(STATICLIB)
173-
-@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
174-
-@cd $(DESTDIR)$(sharedlibdir); if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
175-
chmod 755 $(SHAREDLIBV); \
176-
rm -f $(SHAREDLIB) $(SHAREDLIBM); \
177-
ln -s $(SHAREDLIBV) $(SHAREDLIB); \
178-
ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
171+
chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
172+
-@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
173+
-@if test -n "$(SHAREDLIBV)"; then \
174+
cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
175+
echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
176+
chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
177+
echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
178+
rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
179+
ln -s $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
180+
ln -s $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
179181
($(LDCONFIG) || true) >/dev/null 2>&1; \
180182
fi
181183
cp zlib.3 $(DESTDIR)$(man3dir)
@@ -193,7 +195,7 @@ install: install-libs
193195
uninstall:
194196
cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
195197
cd $(DESTDIR)$(libdir); rm -f libz.a; \
196-
if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
198+
if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
197199
rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
198200
fi
199201
cd $(DESTDIR)$(man3dir); rm -f zlib.3

README

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

3-
zlib 1.2.5 is a general purpose data compression library. All the code is
3+
zlib 1.2.5.1 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
6-
http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
7-
and rfc1952.txt (gzip format).
6+
http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
7+
rfc1952 (gzip format).
88

99
All functions of the compression library are documented in the file zlib.h
1010
(volunteer to write man pages welcome, contact zlib@gzip.org). A usage example
@@ -31,7 +31,7 @@ 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
3232
http://marknelson.us/1997/01/01/zlib-engine/ .
3333

34-
The changes made in version 1.2.5 are documented in the file ChangeLog.
34+
The changes made in version 1.2.5.1 are documented in the file ChangeLog.
3535

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

@@ -84,7 +84,7 @@ Acknowledgments:
8484

8585
Copyright notice:
8686

87-
(C) 1995-2010 Jean-loup Gailly and Mark Adler
87+
(C) 1995-2011 Jean-loup Gailly and Mark Adler
8888

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

adler32.c

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* adler32.c -- compute the Adler-32 checksum of a data stream
2-
* Copyright (C) 1995-2007 Mark Adler
2+
* Copyright (C) 1995-2011 Mark Adler
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*/
55

@@ -9,9 +9,9 @@
99

1010
#define local static
1111

12-
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
12+
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
1313

14-
#define BASE 65521UL /* largest prime smaller than 65536 */
14+
#define BASE 65521 /* largest prime smaller than 65536 */
1515
#define NMAX 5552
1616
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
1717

@@ -21,39 +21,44 @@ local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2);
2121
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
2222
#define DO16(buf) DO8(buf,0); DO8(buf,8);
2323

24-
/* use NO_DIVIDE if your processor does not do division in hardware */
24+
/* use NO_DIVIDE if your processor does not do division in hardware --
25+
try it both ways to see which is faster */
2526
#ifdef NO_DIVIDE
26-
# define MOD(a) \
27+
/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
28+
(thank you to John Reiser for pointing this out) */
29+
# define CHOP(a) \
30+
do { \
31+
unsigned long tmp = a >> 16; \
32+
a &= 0xffffUL; \
33+
a += (tmp << 4) - tmp; \
34+
} while (0)
35+
# define MOD28(a) \
2736
do { \
28-
if (a >= (BASE << 16)) a -= (BASE << 16); \
29-
if (a >= (BASE << 15)) a -= (BASE << 15); \
30-
if (a >= (BASE << 14)) a -= (BASE << 14); \
31-
if (a >= (BASE << 13)) a -= (BASE << 13); \
32-
if (a >= (BASE << 12)) a -= (BASE << 12); \
33-
if (a >= (BASE << 11)) a -= (BASE << 11); \
34-
if (a >= (BASE << 10)) a -= (BASE << 10); \
35-
if (a >= (BASE << 9)) a -= (BASE << 9); \
36-
if (a >= (BASE << 8)) a -= (BASE << 8); \
37-
if (a >= (BASE << 7)) a -= (BASE << 7); \
38-
if (a >= (BASE << 6)) a -= (BASE << 6); \
39-
if (a >= (BASE << 5)) a -= (BASE << 5); \
40-
if (a >= (BASE << 4)) a -= (BASE << 4); \
41-
if (a >= (BASE << 3)) a -= (BASE << 3); \
42-
if (a >= (BASE << 2)) a -= (BASE << 2); \
43-
if (a >= (BASE << 1)) a -= (BASE << 1); \
37+
CHOP(a); \
4438
if (a >= BASE) a -= BASE; \
4539
} while (0)
46-
# define MOD4(a) \
40+
# define MOD(a) \
4741
do { \
48-
if (a >= (BASE << 4)) a -= (BASE << 4); \
49-
if (a >= (BASE << 3)) a -= (BASE << 3); \
50-
if (a >= (BASE << 2)) a -= (BASE << 2); \
51-
if (a >= (BASE << 1)) a -= (BASE << 1); \
42+
CHOP(a); \
43+
MOD28(a); \
44+
} while (0)
45+
# define MOD63(a) \
46+
do { /* this assumes a is not negative */ \
47+
z_off64_t tmp = a >> 32; \
48+
a &= 0xffffffffL; \
49+
a += (tmp << 8) - (tmp << 5) + tmp; \
50+
tmp = a >> 16; \
51+
a &= 0xffffL; \
52+
a += (tmp << 4) - tmp; \
53+
tmp = a >> 16; \
54+
a &= 0xffffL; \
55+
a += (tmp << 4) - tmp; \
5256
if (a >= BASE) a -= BASE; \
5357
} while (0)
5458
#else
5559
# define MOD(a) a %= BASE
56-
# define MOD4(a) a %= BASE
60+
# define MOD28(a) a %= BASE
61+
# define MOD63(a) a %= BASE
5762
#endif
5863

5964
/* ========================================================================= */
@@ -92,7 +97,7 @@ uLong ZEXPORT adler32(adler, buf, len)
9297
}
9398
if (adler >= BASE)
9499
adler -= BASE;
95-
MOD4(sum2); /* only added so many BASE's */
100+
MOD28(sum2); /* only added so many BASE's */
96101
return adler | (sum2 << 16);
97102
}
98103

@@ -137,8 +142,13 @@ local uLong adler32_combine_(adler1, adler2, len2)
137142
unsigned long sum2;
138143
unsigned rem;
139144

145+
/* for negative len, return invalid adler32 as a clue for debugging */
146+
if (len2 < 0)
147+
return 0xffffffffUL;
148+
140149
/* the derivation of this formula is left as an exercise for the reader */
141-
rem = (unsigned)(len2 % BASE);
150+
MOD63(len2); /* assumes len2 >= 0 */
151+
rem = (unsigned)len2;
142152
sum1 = adler1 & 0xffff;
143153
sum2 = rem * sum1;
144154
MOD(sum2);

old/as400/bndsrc renamed to as400/bndsrc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
3434
EXPORT SYMBOL("deflateCopy")
3535
EXPORT SYMBOL("deflateReset")
3636
EXPORT SYMBOL("deflateParams")
37+
EXPORT SYMBOL("deflatePending")
3738
EXPORT SYMBOL("deflatePrime")
3839
EXPORT SYMBOL("deflateInit_")
3940
EXPORT SYMBOL("deflateInit2_")
@@ -129,4 +130,54 @@ STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('ZLIB')
129130

130131
EXPORT SYMBOL("zlibCompileFlags")
131132

133+
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
134+
/* Version 1.2.5 additional entry points. */
135+
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
136+
137+
/********************************************************************/
138+
/* *MODULE ADLER32 ZLIB 01/02/01 00:15:09 */
139+
/********************************************************************/
140+
141+
EXPORT SYMBOL("adler32_combine")
142+
EXPORT SYMBOL("adler32_combine64")
143+
144+
/********************************************************************/
145+
/* *MODULE CRC32 ZLIB 01/02/01 00:15:09 */
146+
/********************************************************************/
147+
148+
EXPORT SYMBOL("crc32_combine")
149+
EXPORT SYMBOL("crc32_combine64")
150+
151+
/********************************************************************/
152+
/* *MODULE GZLIB ZLIB 01/02/01 00:15:09 */
153+
/********************************************************************/
154+
155+
EXPORT SYMBOL("gzbuffer")
156+
EXPORT SYMBOL("gzoffset")
157+
EXPORT SYMBOL("gzoffset64")
158+
EXPORT SYMBOL("gzopen64")
159+
EXPORT SYMBOL("gzseek64")
160+
EXPORT SYMBOL("gztell64")
161+
162+
/********************************************************************/
163+
/* *MODULE GZREAD ZLIB 01/02/01 00:15:09 */
164+
/********************************************************************/
165+
166+
EXPORT SYMBOL("gzclose_r")
167+
168+
/********************************************************************/
169+
/* *MODULE GZWRITE ZLIB 01/02/01 00:15:09 */
170+
/********************************************************************/
171+
172+
EXPORT SYMBOL("gzclose_w")
173+
174+
/********************************************************************/
175+
/* *MODULE INFLATE ZLIB 01/02/01 00:15:09 */
176+
/********************************************************************/
177+
178+
EXPORT SYMBOL("inflateMark")
179+
EXPORT SYMBOL("inflatePrime")
180+
EXPORT SYMBOL("inflateReset2")
181+
EXPORT SYMBOL("inflateUndermine")
182+
132183
ENDPGMEXP

0 commit comments

Comments
 (0)