Fossil SCM

Merge updates from trunk.

mistachkin 2022-10-17 01:03 UTC nonHashFix merge
Commit 7489c8b9320e5c3f72211d65370e4132c0f2fd5c11b4e173092588818d63246c
172 files changed -23 +111 -26 +26 +1 -1 +11 +1 -1 +112 -49 +407 -4 +23 -25 +7 -4 +28 -22 -21 +1 -1 +1 -1 +1 -1 +3 -3 +8 -4 +1 -1 +11 -10 +14 -4 +5 -3 +17 -18 +21 -20 +17 -14 +6 -6 +18 -18 +11 -6 +1 -1 +1 -1 +4 -4 +5 +4 -4 +5 +4 -4 +5 +4 -4 +5 +4 -4 +5 +994 -320 +9441 -436 +78 -30 +12 -15 +5 +433 -408 +1 -1 +4 -2 +466 +172 -102 +7 +3 -2 +5 -3 +5 -7 +25 -13 +2 -1 +14 -14 +39 -8 +3 -2 +3 -3 +1 -1 +3 -3 +5 -5 +2 -3 +2 -2 +27 -48 -1 -5 -4 +2 -2 +3 +2 -2 +3 -3 +123 -100 +6 +2 -2 +12 -9 +11 +1200 +2 -2 +4 -6 +234 -90 +1276 -870 +17 -9 +34 -8 +96 -23 +1 -1 +12 -2 +1 -1 +55 -10 +9 -5 +2 -2 +116 -7 +16 -6 +1 -1 +2 +18 -10 +4 +124 -31 +5 +3 -3 +17 -10 +2 -1 +3 -3 +4 -5 +1 -1 +13 -8 +1 -1 +1 -1 +26 -26 +94 -47 +3 -2 +1 -1 +8 -1 +18 -6 +5 -5 +1 -1 +1 -1 +1 -1 +1 -1 +4 -3 +9 -1 +4 -1 +1 -1 +1 -1 +21 -10 +28 -15 +1 -1 +1 -1 +104 -8 +8 -8 +1 -1 +8 -4 +5 -5 +8 -1 +2 -2 +1 -1 +1 -1 +1 -1 +2 -2 +18 -12 +6 -4 +1 -1 +20 -5 +1 -1 +3 -2 +4 -3 +1 -1 +13 -77 +17 -2 +12 +799 +3 -2 +3 -3 +1 -2 +1 -1 +74 -53 +80 -69 +4 -4 +2 -2 +4 +4 +9 -3 +52 +3 -3 +2 -3 +89 -389 +7 -4 +15 -16 +1 -1 +2
- .dockerignore ~ Dockerfile ~ Makefile.in ~ VERSION ~ auto.def ~ compat/zlib/CMakeLists.txt ~ compat/zlib/ChangeLog ~ compat/zlib/Makefile ~ compat/zlib/Makefile.in ~ compat/zlib/README ~ compat/zlib/configure ~ compat/zlib/contrib/README.contrib ~ compat/zlib/contrib/blast/blast.h ~ compat/zlib/contrib/delphi/ZLib.pas ~ compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs ~ compat/zlib/contrib/infback9/inftree9.c ~ compat/zlib/contrib/minizip/Makefile ~ compat/zlib/contrib/minizip/configure.ac ~ compat/zlib/contrib/minizip/crypt.h ~ compat/zlib/contrib/minizip/ioapi.c ~ compat/zlib/contrib/minizip/ioapi.h ~ compat/zlib/contrib/minizip/miniunz.c ~ compat/zlib/contrib/minizip/minizip.c ~ compat/zlib/contrib/minizip/unzip.c ~ compat/zlib/contrib/minizip/unzip.h ~ compat/zlib/contrib/minizip/zip.c ~ compat/zlib/contrib/minizip/zip.h ~ compat/zlib/contrib/pascal/zlibpas.pas ~ compat/zlib/contrib/vstudio/readme.txt ~ compat/zlib/contrib/vstudio/vc10/zlib.rc ~ compat/zlib/contrib/vstudio/vc10/zlibvc.def ~ compat/zlib/contrib/vstudio/vc11/zlib.rc ~ compat/zlib/contrib/vstudio/vc11/zlibvc.def ~ compat/zlib/contrib/vstudio/vc12/zlib.rc ~ compat/zlib/contrib/vstudio/vc12/zlibvc.def ~ compat/zlib/contrib/vstudio/vc14/zlib.rc ~ compat/zlib/contrib/vstudio/vc14/zlibvc.def ~ compat/zlib/contrib/vstudio/vc9/zlib.rc ~ compat/zlib/contrib/vstudio/vc9/zlibvc.def ~ compat/zlib/crc32.c ~ compat/zlib/crc32.h ~ compat/zlib/deflate.c ~ compat/zlib/deflate.h ~ compat/zlib/examples/README.examples ~ compat/zlib/examples/enough.c ~ compat/zlib/examples/gzappend.c ~ compat/zlib/examples/gzlog.c ~ compat/zlib/examples/gznorm.c ~ compat/zlib/examples/zran.c ~ compat/zlib/examples/zran.h ~ compat/zlib/gzguts.h ~ compat/zlib/gzlib.c ~ compat/zlib/gzread.c ~ compat/zlib/gzwrite.c ~ compat/zlib/infback.c ~ compat/zlib/inffast.c ~ compat/zlib/inflate.c ~ compat/zlib/inflate.h ~ compat/zlib/inftrees.c ~ compat/zlib/os400/README400 ~ compat/zlib/os400/zlib.inc ~ compat/zlib/qnx/package.qpg ~ compat/zlib/test/example.c ~ compat/zlib/treebuild.xml ~ compat/zlib/trees.c ~ compat/zlib/win32/Makefile.bor ~ compat/zlib/win32/Makefile.gcc ~ compat/zlib/win32/Makefile.msc ~ compat/zlib/win32/README-WIN32.txt ~ compat/zlib/win32/zlib.def ~ compat/zlib/zconf.h ~ compat/zlib/zlib.3 ~ compat/zlib/zlib.3.pdf ~ compat/zlib/zlib.h ~ compat/zlib/zlib.map ~ compat/zlib/zutil.c ~ compat/zlib/zutil.h ~ containers/Dockerfile-nojail.patch ~ containers/busybox-config ~ extsrc/pikchr-worker.js ~ extsrc/pikchr.c ~ extsrc/pikchr.wasm ~ extsrc/shell.c ~ extsrc/sqlite3.c ~ extsrc/sqlite3.h ~ src/accordion.js ~ src/alerts.c ~ src/allrepo.c ~ src/backlink.c ~ src/backoffice.c ~ src/branch.c ~ src/browse.c ~ src/builtin.c ~ src/chat.c ~ src/checkin.c ~ src/checkout.c ~ src/configure.c ~ src/db.c ~ src/default.css ~ src/dispatch.c ~ src/encode.c ~ src/file.c ~ src/finfo.c ~ src/forum.c ~ src/fossil.page.pikchrshowasm.js ~ src/href.js ~ src/http_ssl.c ~ src/info.c ~ src/interwiki.c ~ src/json_branch.c ~ src/login.c ~ src/main.c ~ src/main.mk ~ src/md5.c ~ src/merge.c ~ src/name.c ~ src/patch.c ~ src/printf.c ~ src/printf.c ~ src/schema.c ~ src/search.c ~ src/security_audit.c ~ src/setup.c ~ src/setupuser.c ~ src/sha1.c ~ src/sha3.c ~ src/skins.c ~ src/stash.c ~ src/stat.c ~ src/style.c ~ src/sync.c ~ src/tag.c ~ src/tar.c ~ src/timeline.c ~ src/unversioned.c ~ src/update.c ~ src/wiki.c ~ src/wikiformat.c ~ src/winhttp.c ~ src/xfer.c ~ src/zip.c ~ tools/fslsrv ~ tools/makemake.tcl ~ tools/mkbuiltin.c ~ tools/mkindex.c ~ tools/skintxt2config.c ~ win/Makefile.mingw ~ win/Makefile.mingw.mistachkin ~ www/alerts.md ~ www/build.wiki ~ www/changes.wiki ~ www/chat.md ~ www/containers.md ~ www/defcsp.md ~ www/encryptedrepos.wiki ~ www/foss-cklist.wiki ~ www/fossil-is-not-relational.md ~ www/fossil-v-git.wiki ~ www/gitusers.md ~ www/index.wiki ~ www/interwiki.md ~ www/mkindex.tcl ~ www/permutedindex.html ~ www/quotes.wiki ~ www/relatedwork.md ~ www/reviews.wiki ~ www/server/any/scgi.md ~ www/server/debian/nginx.md ~ www/server/debian/service.md ~ www/ssl.wiki ~ www/sync.wiki ~ www/userlinks.wiki
D .dockerignore
-23
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,23 +0,0 @@
1
-_FOSSIL_
2
-.fslckout
3
-ajax
4
-art
5
-autosetup
6
-bld
7
-compat
8
-debian
9
-fossil
10
-fossil.exe
11
-msvcbld
12
-setup
13
-src
14
-test
15
-tools
16
-win
17
-wbld
18
-win
19
-www
20
-*.a
21
-*.lib
22
-*.log
23
-*.mani
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,23 +0,0 @@
1 _FOSSIL_
2 .fslckout
3 ajax
4 art
5 autosetup
6 bld
7 compat
8 debian
9 fossil
10 fossil.exe
11 msvcbld
12 setup
13 src
14 test
15 tools
16 win
17 wbld
18 win
19 www
20 *.a
21 *.lib
22 *.log
23 *.mani
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,23 +0,0 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
+111 -26
--- Dockerfile
+++ Dockerfile
@@ -1,26 +1,111 @@
1
-###
2
-# Dockerfile for Fossil
3
-###
4
-FROM fedora:29
5
-
6
-### Now install some additional parts we will need for the build
7
-RUN dnf update -y && dnf install -y gcc make tcl tcl-devel zlib-devel openssl-devel tar && dnf clean all && groupadd -r fossil -g 433 && useradd -u 431 -r -g fossil -d /opt/fossil -s /sbin/nologin -c "Fossil user" fossil
8
-
9
-### If you want to build "trunk", change the next line accordingly.
10
-ENV FOSSIL_INSTALL_VERSION release
11
-
12
-RUN curl "https://fossil-scm.org/home/tarball/fossil-src.tar.gz?name=fossil-src&uuid=${FOSSIL_INSTALL_VERSION}" | tar zx
13
-RUN cd fossil-src && ./configure --disable-fusefs --json --with-th1-docs --with-th1-hooks --with-tcl=1 --with-tcl-stubs --with-tcl-private-stubs
14
-RUN cd fossil-src/src && mv main.c main.c.orig && sed s/\"now\"/0/ <main.c.orig >main.c
15
-RUN cd fossil-src && make && strip fossil && cp fossil /usr/bin && cd .. && rm -rf fossil-src && chmod a+rx /usr/bin/fossil && mkdir -p /opt/fossil && chown fossil:fossil /opt/fossil
16
-
17
-### Build is done, remove modules no longer needed
18
-RUN dnf remove -y gcc make zlib-devel tcl-devel openssl-devel tar && dnf clean all
19
-
20
-USER fossil
21
-
22
-ENV HOME /opt/fossil
23
-
24
-EXPOSE 8080
25
-
26
-CMD ["/usr/bin/fossil", "server", "--create", "--user", "admin", "/opt/fossil/repository.fossil"]
1
+# See www/containers.md for documentation on how to use this file.
2
+
3
+## ---------------------------------------------------------------------
4
+## STAGE 1: Build static Fossil & BusyBox binaries atop Alpine Linux
5
+## ---------------------------------------------------------------------
6
+
7
+FROM alpine:latest AS builder
8
+WORKDIR /tmp
9
+
10
+### Bake the basic Alpine Linux into a base layer so we never have to
11
+### repeat that step unless we change the package set. Although we're
12
+### going to throw this layer away below, we still pass --no-cache
13
+### because that cache is of no use in an immutable layer. Note that
14
+### we allow the UPX step to fail: it isn't in the ARM distros. We'll
15
+### check whether this optional piece exists before using it below.
16
+RUN set -x \
17
+ && apk update \
18
+ && apk upgrade --no-cache \
19
+ && apk add --no-cache \
20
+ gcc make moreutils \
21
+ linux-headers musl-dev \
22
+ openssl-dev openssl-libs-static \
23
+ zlib-dev zlib-static \
24
+ ; apk add --no-cache upx
25
+
26
+### Bake the custom BusyBox into another layer. The intent is that this
27
+### changes only when we change BBXVER. That will force an update of
28
+### the layers below, but this is a rare occurrence.
29
+ARG BBXVER="1_35_0"
30
+ENV BBXURL "https://github.com/mirror/busybox/tarball/${BBXVER}"
31
+COPY containers/busybox-config /tmp/bbx/.config
32
+ADD $BBXURL /tmp/bbx/src.tar.gz
33
+RUN set -x \
34
+ && tar --strip-components=1 -C bbx -xzf bbx/src.tar.gz \
35
+ && ( cd bbx && yes "" | make oldconfig && make -j11 ) \
36
+ && if [ -x /usr/bin/upx ] ; then upx -9q bbx/busybox ; fi
37
+
38
+### The changeable Fossil layer is the only one in the first stage that
39
+### changes often, so add it last, to make it independent of the others.
40
+###
41
+### $FSLSTB can be either a file or a directory due to a ADD's bizarre
42
+### behavior: it unpacks tarballs when added from a local file but not
43
+### from a URL! It matters because we default to a URL in case you're
44
+### building outside a Fossil checkout, but when building via the
45
+### container-image target, we can avoid a costly hit on the Fossil
46
+### project's home site by pulling the data from the local repo via the
47
+### "tarball" command. This is a DVCS, after all!
48
+ARG FSLVER="trunk"
49
+ARG FSLURL="https://fossil-scm.org/home/tarball/src?r=${FSLVER}"
50
+ENV FSLSTB=/tmp/fsl/src.tar.gz
51
+ADD $FSLURL $FSLSTB
52
+RUN set -x \
53
+ && if [ -d $FSLSTB ] ; then mv $FSLSTB/src fsl ; \
54
+ else tar -C fsl -xzf fsl/src.tar.gz ; fi \
55
+ && m=fsl/src/src/main.mk \
56
+ && grep -v '/skins/[a-ce-z]' $m | sponge $m \
57
+ && fsl/src/configure --static CFLAGS='-Os -s' && make -j11 \
58
+ && if [ -x /usr/bin/upx ] ; then upx -9q fossil ; fi
59
+
60
+
61
+## ---------------------------------------------------------------------
62
+## STAGE 2: Pare that back to the bare essentials.
63
+## ---------------------------------------------------------------------
64
+
65
+FROM scratch
66
+WORKDIR /jail
67
+ARG UID=499
68
+ENV PATH "/bin:/jail/bin"
69
+
70
+### Lay BusyBox down as the first base layer. Coupled with the host's
71
+### kernel, this is the "OS."
72
+COPY --from=builder /tmp/bbx/busybox /bin/
73
+RUN [ "/bin/busybox", "--install", "/bin" ]
74
+
75
+### Set up that base OS for our specific use without tying it to
76
+### anything likely to change often. So long as the user leaves
77
+### UID alone, this layer will be durable.
78
+RUN set -x \
79
+ && echo 'root:x:0:0:SysAdmin:/:/bin/nologin' > /etc/passwd \
80
+ && echo 'root:x:0:root' > /etc/group \
81
+ && addgroup -S -g ${UID} fossil \
82
+ && adduser -S -h `pwd` -g 'Fossil User' -G fossil -u ${UID} fossil \
83
+ && install -d -m 700 -o fossil -g fossil log museum \
84
+ && install -d -m 755 -o fossil -g fossil dev \
85
+ && mknod -m 666 dev/null c 1 3 \
86
+ && mknod -m 444 dev/urandom c 1 9
87
+
88
+### Do Fossil-specific things atop those base layers; this will change
89
+### as often as the Fossil build-from-source layer above.
90
+COPY --from=builder /tmp/fossil bin/
91
+RUN set -x \
92
+ && ln -s /jail/bin/fossil /bin/f \
93
+ && echo -e '#!/bin/sh\nfossil sha1sum "$@"' > /bin/sha1sum \
94
+ && echo -e '#!/bin/sh\nfossil sha3sum "$@"' > /bin/sha3sum \
95
+ && echo -e '#!/bin/sh\nfossil sqlite3 --no-repository "$@"' > \
96
+ /bin/sqlite3 \
97
+ && chmod +x /bin/sha?sum /bin/sqlite3
98
+
99
+
100
+## ---------------------------------------------------------------------
101
+## STAGE 3: Run!
102
+## ---------------------------------------------------------------------
103
+
104
+EXPOSE 8080/tcp
105
+CMD [ \
106
+ "bin/fossil", "server", \
107
+ "--chroot", "/jail", \
108
+ "--create", \
109
+ "--jsmode", "bundled", \
110
+ "--user", "admin", \
111
+ "museum/repo.fossil"]
27112
--- Dockerfile
+++ Dockerfile
@@ -1,26 +1,111 @@
1 ###
2 # Dockerfile for Fossil
3 ###
4 FROM fedora:29
5
6 ### Now install some additional parts we will need for the build
7 RUN dnf update -y && dnf install -y gcc make tcl tcl-devel zlib-devel openssl-devel tar && dnf clean all && groupadd -r fossil -g 433 && useradd -u 431 -r -g fossil -d /opt/fossil -s /sbin/nologin -c "Fossil user" fossil
8
9 ### If you want to build "trunk", change the next line accordingly.
10 ENV FOSSIL_INSTALL_VERSION release
11
12 RUN curl "https://fossil-scm.org/home/tarball/fossil-src.tar.gz?name=fossil-src&uuid=${FOSSIL_INSTALL_VERSION}" | tar zx
13 RUN cd fossil-src && ./configure --disable-fusefs --json --with-th1-docs --with-th1-hooks --with-tcl=1 --with-tcl-stubs --with-tcl-private-stubs
14 RUN cd fossil-src/src && mv main.c main.c.orig && sed s/\"now\"/0/ <main.c.orig >main.c
15 RUN cd fossil-src && make && strip fossil && cp fossil /usr/bin && cd .. && rm -rf fossil-src && chmod a+rx /usr/bin/fossil && mkdir -p /opt/fossil && chown fossil:fossil /opt/fossil
16
17 ### Build is done, remove modules no longer needed
18 RUN dnf remove -y gcc make zlib-devel tcl-devel openssl-devel tar && dnf clean all
19
20 USER fossil
21
22 ENV HOME /opt/fossil
23
24 EXPOSE 8080
25
26 CMD ["/usr/bin/fossil", "server", "--create", "--user", "admin", "/opt/fossil/repository.fossil"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
--- Dockerfile
+++ Dockerfile
@@ -1,26 +1,111 @@
1 # See www/containers.md for documentation on how to use this file.
2
3 ## ---------------------------------------------------------------------
4 ## STAGE 1: Build static Fossil & BusyBox binaries atop Alpine Linux
5 ## ---------------------------------------------------------------------
6
7 FROM alpine:latest AS builder
8 WORKDIR /tmp
9
10 ### Bake the basic Alpine Linux into a base layer so we never have to
11 ### repeat that step unless we change the package set. Although we're
12 ### going to throw this layer away below, we still pass --no-cache
13 ### because that cache is of no use in an immutable layer. Note that
14 ### we allow the UPX step to fail: it isn't in the ARM distros. We'll
15 ### check whether this optional piece exists before using it below.
16 RUN set -x \
17 && apk update \
18 && apk upgrade --no-cache \
19 && apk add --no-cache \
20 gcc make moreutils \
21 linux-headers musl-dev \
22 openssl-dev openssl-libs-static \
23 zlib-dev zlib-static \
24 ; apk add --no-cache upx
25
26 ### Bake the custom BusyBox into another layer. The intent is that this
27 ### changes only when we change BBXVER. That will force an update of
28 ### the layers below, but this is a rare occurrence.
29 ARG BBXVER="1_35_0"
30 ENV BBXURL "https://github.com/mirror/busybox/tarball/${BBXVER}"
31 COPY containers/busybox-config /tmp/bbx/.config
32 ADD $BBXURL /tmp/bbx/src.tar.gz
33 RUN set -x \
34 && tar --strip-components=1 -C bbx -xzf bbx/src.tar.gz \
35 && ( cd bbx && yes "" | make oldconfig && make -j11 ) \
36 && if [ -x /usr/bin/upx ] ; then upx -9q bbx/busybox ; fi
37
38 ### The changeable Fossil layer is the only one in the first stage that
39 ### changes often, so add it last, to make it independent of the others.
40 ###
41 ### $FSLSTB can be either a file or a directory due to a ADD's bizarre
42 ### behavior: it unpacks tarballs when added from a local file but not
43 ### from a URL! It matters because we default to a URL in case you're
44 ### building outside a Fossil checkout, but when building via the
45 ### container-image target, we can avoid a costly hit on the Fossil
46 ### project's home site by pulling the data from the local repo via the
47 ### "tarball" command. This is a DVCS, after all!
48 ARG FSLVER="trunk"
49 ARG FSLURL="https://fossil-scm.org/home/tarball/src?r=${FSLVER}"
50 ENV FSLSTB=/tmp/fsl/src.tar.gz
51 ADD $FSLURL $FSLSTB
52 RUN set -x \
53 && if [ -d $FSLSTB ] ; then mv $FSLSTB/src fsl ; \
54 else tar -C fsl -xzf fsl/src.tar.gz ; fi \
55 && m=fsl/src/src/main.mk \
56 && grep -v '/skins/[a-ce-z]' $m | sponge $m \
57 && fsl/src/configure --static CFLAGS='-Os -s' && make -j11 \
58 && if [ -x /usr/bin/upx ] ; then upx -9q fossil ; fi
59
60
61 ## ---------------------------------------------------------------------
62 ## STAGE 2: Pare that back to the bare essentials.
63 ## ---------------------------------------------------------------------
64
65 FROM scratch
66 WORKDIR /jail
67 ARG UID=499
68 ENV PATH "/bin:/jail/bin"
69
70 ### Lay BusyBox down as the first base layer. Coupled with the host's
71 ### kernel, this is the "OS."
72 COPY --from=builder /tmp/bbx/busybox /bin/
73 RUN [ "/bin/busybox", "--install", "/bin" ]
74
75 ### Set up that base OS for our specific use without tying it to
76 ### anything likely to change often. So long as the user leaves
77 ### UID alone, this layer will be durable.
78 RUN set -x \
79 && echo 'root:x:0:0:SysAdmin:/:/bin/nologin' > /etc/passwd \
80 && echo 'root:x:0:root' > /etc/group \
81 && addgroup -S -g ${UID} fossil \
82 && adduser -S -h `pwd` -g 'Fossil User' -G fossil -u ${UID} fossil \
83 && install -d -m 700 -o fossil -g fossil log museum \
84 && install -d -m 755 -o fossil -g fossil dev \
85 && mknod -m 666 dev/null c 1 3 \
86 && mknod -m 444 dev/urandom c 1 9
87
88 ### Do Fossil-specific things atop those base layers; this will change
89 ### as often as the Fossil build-from-source layer above.
90 COPY --from=builder /tmp/fossil bin/
91 RUN set -x \
92 && ln -s /jail/bin/fossil /bin/f \
93 && echo -e '#!/bin/sh\nfossil sha1sum "$@"' > /bin/sha1sum \
94 && echo -e '#!/bin/sh\nfossil sha3sum "$@"' > /bin/sha3sum \
95 && echo -e '#!/bin/sh\nfossil sqlite3 --no-repository "$@"' > \
96 /bin/sqlite3 \
97 && chmod +x /bin/sha?sum /bin/sqlite3
98
99
100 ## ---------------------------------------------------------------------
101 ## STAGE 3: Run!
102 ## ---------------------------------------------------------------------
103
104 EXPOSE 8080/tcp
105 CMD [ \
106 "bin/fossil", "server", \
107 "--chroot", "/jail", \
108 "--create", \
109 "--jsmode", "bundled", \
110 "--user", "admin", \
111 "museum/repo.fossil"]
112
+26
--- Makefile.in
+++ Makefile.in
@@ -116,5 +116,31 @@
116116
# of delegating to it with "$(MAKE) reconfig": having children running
117117
# around interfering makes this failure mode even worse.
118118
Makefile: @srcdir@/Makefile.in $(SRCDIR)/main.mk @AUTODEPS@
119119
@AUTOREMAKE@
120120
touch @builddir@/Makefile
121
+
122
+# Container stuff
123
+SRCTB := src-@[email protected]
124
+container-image:
125
+ $(APPNAME) tarball --name src @FOSSIL_CI_PFX@ $(SRCTB)
126
+ docker build \
127
+ --tag fossil:@FOSSIL_CI_PFX@ \
128
+ --build-arg FSLURL=$(SRCTB) \
129
+ $(DBFLAGS) @srcdir@
130
+ rm -f $(SRCTB)
131
+
132
+container-run: container-image
133
+ docker run \
134
+ --name fossil-@FOSSIL_CI_PFX@ \
135
+ --cap-drop AUDIT_WRITE \
136
+ --cap-drop CHOWN \
137
+ --cap-drop FSETID \
138
+ --cap-drop KILL \
139
+ --cap-drop MKNOD \
140
+ --cap-drop NET_BIND_SERVICE \
141
+ --cap-drop NET_RAW \
142
+ --cap-drop SETFCAP \
143
+ --cap-drop SETPCAP \
144
+ --detach --publish 8080:8080 \
145
+ $(DRFLAGS) fossil:@FOSSIL_CI_PFX@
146
+ docker container logs fossil-@FOSSIL_CI_PFX@
121147
--- Makefile.in
+++ Makefile.in
@@ -116,5 +116,31 @@
116 # of delegating to it with "$(MAKE) reconfig": having children running
117 # around interfering makes this failure mode even worse.
118 Makefile: @srcdir@/Makefile.in $(SRCDIR)/main.mk @AUTODEPS@
119 @AUTOREMAKE@
120 touch @builddir@/Makefile
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
--- Makefile.in
+++ Makefile.in
@@ -116,5 +116,31 @@
116 # of delegating to it with "$(MAKE) reconfig": having children running
117 # around interfering makes this failure mode even worse.
118 Makefile: @srcdir@/Makefile.in $(SRCDIR)/main.mk @AUTODEPS@
119 @AUTOREMAKE@
120 touch @builddir@/Makefile
121
122 # Container stuff
123 SRCTB := src-@[email protected]
124 container-image:
125 $(APPNAME) tarball --name src @FOSSIL_CI_PFX@ $(SRCTB)
126 docker build \
127 --tag fossil:@FOSSIL_CI_PFX@ \
128 --build-arg FSLURL=$(SRCTB) \
129 $(DBFLAGS) @srcdir@
130 rm -f $(SRCTB)
131
132 container-run: container-image
133 docker run \
134 --name fossil-@FOSSIL_CI_PFX@ \
135 --cap-drop AUDIT_WRITE \
136 --cap-drop CHOWN \
137 --cap-drop FSETID \
138 --cap-drop KILL \
139 --cap-drop MKNOD \
140 --cap-drop NET_BIND_SERVICE \
141 --cap-drop NET_RAW \
142 --cap-drop SETFCAP \
143 --cap-drop SETPCAP \
144 --detach --publish 8080:8080 \
145 $(DRFLAGS) fossil:@FOSSIL_CI_PFX@
146 docker container logs fossil-@FOSSIL_CI_PFX@
147
+1 -1
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1
-2.19
1
+2.20
22
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.19
2
--- VERSION
+++ VERSION
@@ -1,1 +1,1 @@
1 2.20
2
+11
--- auto.def
+++ auto.def
@@ -349,10 +349,12 @@
349349
set zlibpath [opt-val with-zlib]
350350
if {$zlibpath eq "tree"} {
351351
set zlibdir [file dirname $autosetup(dir)]/compat/zlib
352352
if {![file isdirectory $zlibdir]} {
353353
user-error "The zlib in source tree directory does not exist"
354
+ } elseif { ([llength [glob -nocomplain -directory $zlibdir libz*]] == 0) } {
355
+ user-error "With --with-zlib=tree, $zlibdir must be configured and built first."
354356
}
355357
cc-with [list -cflags "-I$zlibdir -L$zlibdir"]
356358
define-append EXTRA_CFLAGS -I$zlibdir
357359
define-append LIBS $zlibdir/libz.a
358360
set ::zlib_lib $zlibdir/libz.a
@@ -762,8 +764,17 @@
762764
catch {exec chmod u+x tools/emcc.sh}
763765
} else {
764766
define EMCC_WRAPPER ""
765767
catch {exec rm -f tools/emcc.sh}
766768
}
769
+
770
+# Tag container builds with a prefix of the checkin ID of the version
771
+# of Fossil each one contains. This not only allows multiple images
772
+# to coexist and multiple containers to be created unamgiguosly from
773
+# them, it also changes the URL we fetch the source tarball from, so
774
+# repeated builds of a given version generate and fetch the source
775
+# tarball once only, keeping it in the local Docker/Podman cache.
776
+set ci [readfile "$::autosetup(srcdir)/manifest.uuid"]
777
+define FOSSIL_CI_PFX [string range $ci 0 11]
767778
768779
make-template Makefile.in
769780
make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
770781
--- auto.def
+++ auto.def
@@ -349,10 +349,12 @@
349 set zlibpath [opt-val with-zlib]
350 if {$zlibpath eq "tree"} {
351 set zlibdir [file dirname $autosetup(dir)]/compat/zlib
352 if {![file isdirectory $zlibdir]} {
353 user-error "The zlib in source tree directory does not exist"
 
 
354 }
355 cc-with [list -cflags "-I$zlibdir -L$zlibdir"]
356 define-append EXTRA_CFLAGS -I$zlibdir
357 define-append LIBS $zlibdir/libz.a
358 set ::zlib_lib $zlibdir/libz.a
@@ -762,8 +764,17 @@
762 catch {exec chmod u+x tools/emcc.sh}
763 } else {
764 define EMCC_WRAPPER ""
765 catch {exec rm -f tools/emcc.sh}
766 }
 
 
 
 
 
 
 
 
 
767
768 make-template Makefile.in
769 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
770
--- auto.def
+++ auto.def
@@ -349,10 +349,12 @@
349 set zlibpath [opt-val with-zlib]
350 if {$zlibpath eq "tree"} {
351 set zlibdir [file dirname $autosetup(dir)]/compat/zlib
352 if {![file isdirectory $zlibdir]} {
353 user-error "The zlib in source tree directory does not exist"
354 } elseif { ([llength [glob -nocomplain -directory $zlibdir libz*]] == 0) } {
355 user-error "With --with-zlib=tree, $zlibdir must be configured and built first."
356 }
357 cc-with [list -cflags "-I$zlibdir -L$zlibdir"]
358 define-append EXTRA_CFLAGS -I$zlibdir
359 define-append LIBS $zlibdir/libz.a
360 set ::zlib_lib $zlibdir/libz.a
@@ -762,8 +764,17 @@
764 catch {exec chmod u+x tools/emcc.sh}
765 } else {
766 define EMCC_WRAPPER ""
767 catch {exec rm -f tools/emcc.sh}
768 }
769
770 # Tag container builds with a prefix of the checkin ID of the version
771 # of Fossil each one contains. This not only allows multiple images
772 # to coexist and multiple containers to be created unamgiguosly from
773 # them, it also changes the URL we fetch the source tarball from, so
774 # repeated builds of a given version generate and fetch the source
775 # tarball once only, keeping it in the local Docker/Podman cache.
776 set ci [readfile "$::autosetup(srcdir)/manifest.uuid"]
777 define FOSSIL_CI_PFX [string range $ci 0 11]
778
779 make-template Makefile.in
780 make-config-header autoconfig.h -auto {USE_* FOSSIL_*}
781
--- compat/zlib/CMakeLists.txt
+++ compat/zlib/CMakeLists.txt
@@ -1,11 +1,11 @@
11
cmake_minimum_required(VERSION 2.4.4)
22
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
33
44
project(zlib C)
55
6
-set(VERSION "1.2.11")
6
+set(VERSION "1.2.12")
77
88
option(ASM686 "Enable building i686 assembly implementation")
99
option(AMD64 "Enable building amd64 assembly implementation")
1010
1111
set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
1212
--- compat/zlib/CMakeLists.txt
+++ compat/zlib/CMakeLists.txt
@@ -1,11 +1,11 @@
1 cmake_minimum_required(VERSION 2.4.4)
2 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
3
4 project(zlib C)
5
6 set(VERSION "1.2.11")
7
8 option(ASM686 "Enable building i686 assembly implementation")
9 option(AMD64 "Enable building amd64 assembly implementation")
10
11 set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
12
--- compat/zlib/CMakeLists.txt
+++ compat/zlib/CMakeLists.txt
@@ -1,11 +1,11 @@
1 cmake_minimum_required(VERSION 2.4.4)
2 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)
3
4 project(zlib C)
5
6 set(VERSION "1.2.12")
7
8 option(ASM686 "Enable building i686 assembly implementation")
9 option(AMD64 "Enable building amd64 assembly implementation")
10
11 set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
12
--- compat/zlib/ChangeLog
+++ compat/zlib/ChangeLog
@@ -1,8 +1,71 @@
11
22
ChangeLog file for zlib
33
4
+Changes in 1.2.12 (27 Mar 2022)
5
+- Cygwin does not have _wopen(), so do not create gzopen_w() there
6
+- Permit a deflateParams() parameter change as soon as possible
7
+- Limit hash table inserts after switch from stored deflate
8
+- Fix bug when window full in deflate_stored()
9
+- Fix CLEAR_HASH macro to be usable as a single statement
10
+- Avoid a conversion error in gzseek when off_t type too small
11
+- Have Makefile return non-zero error code on test failure
12
+- Avoid some conversion warnings in gzread.c and gzwrite.c
13
+- Update use of errno for newer Windows CE versions
14
+- Small speedup to inflate [psumbera]
15
+- Return an error if the gzputs string length can't fit in an int
16
+- Add address checking in clang to -w option of configure
17
+- Don't compute check value for raw inflate if asked to validate
18
+- Handle case where inflateSync used when header never processed
19
+- Avoid the use of ptrdiff_t
20
+- Avoid an undefined behavior of memcpy() in gzappend()
21
+- Avoid undefined behaviors of memcpy() in gz*printf()
22
+- Avoid an undefined behavior of memcpy() in _tr_stored_block()
23
+- Make the names in functions declarations identical to definitions
24
+- Remove old assembler code in which bugs have manifested
25
+- Fix deflateEnd() to not report an error at start of raw deflate
26
+- Add legal disclaimer to README
27
+- Emphasize the need to continue decompressing gzip members
28
+- Correct the initialization requirements for deflateInit2()
29
+- Fix a bug that can crash deflate on some input when using Z_FIXED
30
+- Assure that the number of bits for deflatePrime() is valid
31
+- Use a structure to make globals in enough.c evident
32
+- Use a macro for the printf format of big_t in enough.c
33
+- Clean up code style in enough.c, update version
34
+- Use inline function instead of macro for index in enough.c
35
+- Clarify that prefix codes are counted in enough.c
36
+- Show all the codes for the maximum tables size in enough.c
37
+- Add gznorm.c example, which normalizes gzip files
38
+- Fix the zran.c example to work on a multiple-member gzip file
39
+- Add tables for crc32_combine(), to speed it up by a factor of 200
40
+- Add crc32_combine_gen() and crc32_combine_op() for fast combines
41
+- Speed up software CRC-32 computation by a factor of 1.5 to 3
42
+- Use atomic test and set, if available, for dynamic CRC tables
43
+- Don't bother computing check value after successful inflateSync()
44
+- Correct comment in crc32.c
45
+- Add use of the ARMv8 crc32 instructions when requested
46
+- Use ARM crc32 instructions if the ARM architecture has them
47
+- Explicitly note that the 32-bit check values are 32 bits
48
+- Avoid adding empty gzip member after gzflush with Z_FINISH
49
+- Fix memory leak on error in gzlog.c
50
+- Fix error in comment on the polynomial representation of a byte
51
+- Clarify gz* function interfaces, referring to parameter names
52
+- Change macro name in inflate.c to avoid collision in VxWorks
53
+- Correct typo in blast.c
54
+- Improve portability of contrib/minizip
55
+- Fix indentation in minizip's zip.c
56
+- Replace black/white with allow/block. (theresa-m)
57
+- minizip warning fix if MAXU32 already defined. (gvollant)
58
+- Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner)
59
+- Clean up minizip to reduce warnings for testing
60
+- Add fallthrough comments for gcc
61
+- Eliminate use of ULL constants
62
+- Separate out address sanitizing from warnings in configure
63
+- Remove destructive aspects of make distclean
64
+- Check for cc masquerading as gcc or clang in configure
65
+- Fix crc32.c to compile local functions only if used
66
+
467
Changes in 1.2.11 (15 Jan 2017)
568
- Fix deflate stored bug when pulling last block from window
669
- Permit immediate deflateParams changes before any deflate input
770
871
Changes in 1.2.10 (2 Jan 2017)
@@ -509,11 +572,11 @@
509572
- Replace use of errno in gz* with functions, support WinCE [Alves]
510573
- Provide alternative to perror() in minigzip.c for WinCE [Alves]
511574
- Don't use _vsnprintf on later versions of MSVC [Lowman]
512575
- Add CMake build script and input file [Lowman]
513576
- Update contrib/minizip to 1.1 [Svensson, Vollant]
514
-- Moved nintendods directory from contrib to .
577
+- Moved nintendods directory from contrib to root
515578
- Replace gzio.c with a new set of routines with the same functionality
516579
- Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
517580
- Update contrib/minizip to 1.1b
518581
- Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
519582
@@ -683,11 +746,11 @@
683746
- Update make_vms.com [Zinser]
684747
- Initialize state->write in inflateReset() since copied in inflate_fast()
685748
- Be more strict on incomplete code sets in inflate_table() and increase
686749
ENOUGH and MAXD -- this repairs a possible security vulnerability for
687750
invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for
688
- discovering the vulnerability and providing test cases.
751
+ discovering the vulnerability and providing test cases
689752
- Add ia64 support to configure for HP-UX [Smith]
690753
- Add error return to gzread() for format or i/o error [Levin]
691754
- Use malloc.h for OS/2 [Necasek]
692755
693756
Changes in 1.2.2.3 (27 May 2005)
@@ -719,11 +782,11 @@
719782
- Improve WinCE errno handling and comments [Chang]
720783
- Remove comment about no gzip header processing in FAQ
721784
- Add Z_FIXED strategy option to deflateInit2() to force fixed trees
722785
- Add updated make_vms.com [Coghlan], update README
723786
- Create a new "examples" directory, move gzappend.c there, add zpipe.c,
724
- fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html.
787
+ fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html
725788
- Add FAQ entry and comments in deflate.c on uninitialized memory access
726789
- Add Solaris 9 make options in configure [Gilbert]
727790
- Allow strerror() usage in gzio.c for STDC
728791
- Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer]
729792
- Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant]
@@ -790,11 +853,11 @@
790853
- Update email address in README
791854
- Several FAQ updates
792855
- Fix a big fat bug in inftrees.c that prevented decoding valid
793856
dynamic blocks with only literals and no distance codes --
794857
Thanks to "Hot Emu" for the bug report and sample file
795
-- Add a note to puff.c on no distance codes case.
858
+- Add a note to puff.c on no distance codes case
796859
797860
Changes in 1.2.1 (17 November 2003)
798861
- Remove a tab in contrib/gzappend/gzappend.c
799862
- Update some interfaces in contrib for new zlib functions
800863
- Update zlib version number in some contrib entries
@@ -1034,18 +1097,18 @@
10341097
- Add contrib/inflate86/ for x86 faster inflate
10351098
- Add contrib/blast/ for PKWare Data Compression Library decompression
10361099
- Add contrib/puff/ simple inflate for deflate format description
10371100
10381101
Changes in 1.1.4 (11 March 2002)
1039
-- ZFREE was repeated on same allocation on some error conditions.
1102
+- ZFREE was repeated on same allocation on some error conditions
10401103
This creates a security problem described in
10411104
http://www.zlib.org/advisory-2002-03-11.txt
10421105
- Returned incorrect error (Z_MEM_ERROR) on some invalid data
10431106
- Avoid accesses before window for invalid distances with inflate window
1044
- less than 32K.
1107
+ less than 32K
10451108
- force windowBits > 8 to avoid a bug in the encoder for a window size
1046
- of 256 bytes. (A complete fix will be available in 1.1.5).
1109
+ of 256 bytes. (A complete fix will be available in 1.1.5)
10471110
10481111
Changes in 1.1.3 (9 July 1998)
10491112
- fix "an inflate input buffer bug that shows up on rare but persistent
10501113
occasions" (Mark)
10511114
- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
@@ -1115,11 +1178,11 @@
11151178
Changes in 1.1.1 (27 Feb 98)
11161179
- fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson)
11171180
- remove block truncation heuristic which had very marginal effect for zlib
11181181
(smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
11191182
compression ratio on some files. This also allows inlining _tr_tally for
1120
- matches in deflate_slow.
1183
+ matches in deflate_slow
11211184
- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
11221185
11231186
Changes in 1.1.0 (24 Feb 98)
11241187
- do not return STREAM_END prematurely in inflate (John Bowler)
11251188
- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
@@ -1160,11 +1223,11 @@
11601223
- fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
11611224
- added compress2() to allow setting the compression level
11621225
- include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
11631226
- use constant arrays for the static trees in trees.c instead of computing
11641227
them at run time (thanks to Ken Raeburn for this suggestion). To create
1165
- trees.h, compile with GEN_TREES_H and run "make test".
1228
+ trees.h, compile with GEN_TREES_H and run "make test"
11661229
- check return code of example in "make test" and display result
11671230
- pass minigzip command line options to file_compress
11681231
- simplifying code of inflateSync to avoid gcc 2.8 bug
11691232
11701233
- support CC="gcc -Wall" in configure -s (QingLong)
@@ -1199,16 +1262,16 @@
11991262
12001263
Changes in 1.0.6 (19 Jan 1998)
12011264
- add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
12021265
gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
12031266
- Fix a deflate bug occurring only with compression level 0 (thanks to
1204
- Andy Buckler for finding this one).
1205
-- In minigzip, pass transparently also the first byte for .Z files.
1267
+ Andy Buckler for finding this one)
1268
+- In minigzip, pass transparently also the first byte for .Z files
12061269
- return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
12071270
- check Z_FINISH in inflate (thanks to Marc Schluper)
12081271
- Implement deflateCopy (thanks to Adam Costello)
1209
-- make static libraries by default in configure, add --shared option.
1272
+- make static libraries by default in configure, add --shared option
12101273
- move MSDOS or Windows specific files to directory msdos
12111274
- suppress the notion of partial flush to simplify the interface
12121275
(but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
12131276
- suppress history buffer provided by application to simplify the interface
12141277
(this feature was not implemented anyway in 1.0.4)
@@ -1216,29 +1279,29 @@
12161279
inflateInit2
12171280
- add EXPORT in all exported functions (for Windows DLL)
12181281
- added Makefile.nt (thanks to Stephen Williams)
12191282
- added the unsupported "contrib" directory:
12201283
contrib/asm386/ by Gilles Vollant <[email protected]>
1221
- 386 asm code replacing longest_match().
1284
+ 386 asm code replacing longest_match()
12221285
contrib/iostream/ by Kevin Ruland <[email protected]>
12231286
A C++ I/O streams interface to the zlib gz* functions
12241287
contrib/iostream2/ by Tyge Løvset <[email protected]>
12251288
Another C++ I/O streams interface
12261289
contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <[email protected]>
12271290
A very simple tar.gz file extractor using zlib
12281291
contrib/visual-basic.txt by Carlos Rios <[email protected]>
1229
- How to use compress(), uncompress() and the gz* functions from VB.
1292
+ How to use compress(), uncompress() and the gz* functions from VB
12301293
- pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
12311294
level) in minigzip (thanks to Tom Lane)
12321295
12331296
- use const for rommable constants in deflate
12341297
- added test for gzseek and gztell in example.c
12351298
- add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
12361299
- add undocumented function zError to convert error code to string
12371300
(for Tim Smithers)
1238
-- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
1239
-- Use default memcpy for Symantec MSDOS compiler.
1301
+- Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code
1302
+- Use default memcpy for Symantec MSDOS compiler
12401303
- Add EXPORT keyword for check_func (needed for Windows DLL)
12411304
- add current directory to LD_LIBRARY_PATH for "make test"
12421305
- create also a link for libz.so.1
12431306
- added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
12441307
- use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
@@ -1247,21 +1310,21 @@
12471310
- add advice in zlib.h for best usage of deflateSetDictionary
12481311
- work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
12491312
- allow compilation with ANSI keywords only enabled for TurboC in large model
12501313
- avoid "versionString"[0] (Borland bug)
12511314
- add NEED_DUMMY_RETURN for Borland
1252
-- use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
1315
+- use variable z_verbose for tracing in debug mode (L. Peter Deutsch)
12531316
- allow compilation with CC
12541317
- defined STDC for OS/2 (David Charlap)
12551318
- limit external names to 8 chars for MVS (Thomas Lund)
12561319
- in minigzip.c, use static buffers only for 16-bit systems
12571320
- fix suffix check for "minigzip -d foo.gz"
12581321
- do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
12591322
- use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
12601323
- added makelcc.bat for lcc-win32 (Tom St Denis)
12611324
- in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
1262
-- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
1325
+- Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion
12631326
- check for unistd.h in configure (for off_t)
12641327
- remove useless check parameter in inflate_blocks_free
12651328
- avoid useless assignment of s->check to itself in inflate_blocks_new
12661329
- do not flush twice in gzclose (thanks to Ken Raeburn)
12671330
- rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
@@ -1278,11 +1341,11 @@
12781341
- Update web address in README
12791342
12801343
Changes in 1.0.4 (24 Jul 96)
12811344
- In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
12821345
bit, so the decompressor could decompress all the correct data but went
1283
- on to attempt decompressing extra garbage data. This affected minigzip too.
1346
+ on to attempt decompressing extra garbage data. This affected minigzip too
12841347
- zlibVersion and gzerror return const char* (needed for DLL)
12851348
- port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
12861349
- use z_error only for DEBUG (avoid problem with DLLs)
12871350
12881351
Changes in 1.0.3 (2 Jul 96)
@@ -1308,11 +1371,11 @@
13081371
13091372
Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
13101373
- fix array overlay in deflate.c which sometimes caused bad compressed data
13111374
- fix inflate bug with empty stored block
13121375
- fix MSDOS medium model which was broken in 0.99
1313
-- fix deflateParams() which could generate bad compressed data.
1376
+- fix deflateParams() which could generate bad compressed data
13141377
- Bytef is define'd instead of typedef'ed (work around Borland bug)
13151378
- added an INDEX file
13161379
- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
13171380
Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
13181381
- speed up adler32 for modern machines without auto-increment
@@ -1329,11 +1392,11 @@
13291392
13301393
Changes in 0.99 (27 Jan 96)
13311394
- allow preset dictionary shared between compressor and decompressor
13321395
- allow compression level 0 (no compression)
13331396
- add deflateParams in zlib.h: allow dynamic change of compression level
1334
- and compression strategy.
1397
+ and compression strategy
13351398
- test large buffers and deflateParams in example.c
13361399
- add optional "configure" to build zlib as a shared library
13371400
- suppress Makefile.qnx, use configure instead
13381401
- fixed deflate for 64-bit systems (detected on Cray)
13391402
- fixed inflate_blocks for 64-bit systems (detected on Alpha)
@@ -1371,48 +1434,48 @@
13711434
- in fcalloc, normalize pointer if size > 65520 bytes
13721435
- don't use special fcalloc for 32 bit Borland C++
13731436
- use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
13741437
- use Z_BINARY instead of BINARY
13751438
- document that gzclose after gzdopen will close the file
1376
-- allow "a" as mode in gzopen.
1439
+- allow "a" as mode in gzopen
13771440
- fix error checking in gzread
13781441
- allow skipping .gz extra-field on pipes
13791442
- added reference to Perl interface in README
13801443
- put the crc table in FAR data (I dislike more and more the medium model :)
13811444
- added get_crc_table
1382
-- added a dimension to all arrays (Borland C can't count).
1445
+- added a dimension to all arrays (Borland C can't count)
13831446
- workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
13841447
- guard against multiple inclusion of *.h (for precompiled header on Mac)
1385
-- Watcom C pretends to be Microsoft C small model even in 32 bit mode.
1448
+- Watcom C pretends to be Microsoft C small model even in 32 bit mode
13861449
- don't use unsized arrays to avoid silly warnings by Visual C++:
13871450
warning C4746: 'inflate_mask' : unsized array treated as '__far'
1388
- (what's wrong with far data in far model?).
1451
+ (what's wrong with far data in far model?)
13891452
- define enum out of inflate_blocks_state to allow compilation with C++
13901453
13911454
Changes in 0.95 (16 Aug 95)
13921455
- fix MSDOS small and medium model (now easier to adapt to any compiler)
13931456
- inlined send_bits
13941457
- fix the final (:-) bug for deflate with flush (output was correct but
1395
- not completely flushed in rare occasions).
1458
+ not completely flushed in rare occasions)
13961459
- default window size is same for compression and decompression
1397
- (it's now sufficient to set MAX_WBITS in zconf.h).
1460
+ (it's now sufficient to set MAX_WBITS in zconf.h)
13981461
- voidp -> voidpf and voidnp -> voidp (for consistency with other
1399
- typedefs and because voidnp was not near in large model).
1462
+ typedefs and because voidnp was not near in large model)
14001463
14011464
Changes in 0.94 (13 Aug 95)
14021465
- support MSDOS medium model
14031466
- fix deflate with flush (could sometimes generate bad output)
14041467
- fix deflateReset (zlib header was incorrectly suppressed)
14051468
- added support for VMS
14061469
- allow a compression level in gzopen()
14071470
- gzflush now calls fflush
1408
-- For deflate with flush, flush even if no more input is provided.
1471
+- For deflate with flush, flush even if no more input is provided
14091472
- rename libgz.a as libz.a
14101473
- avoid complex expression in infcodes.c triggering Turbo C bug
14111474
- work around a problem with gcc on Alpha (in INSERT_STRING)
14121475
- don't use inline functions (problem with some gcc versions)
1413
-- allow renaming of Byte, uInt, etc... with #define.
1476
+- allow renaming of Byte, uInt, etc... with #define
14141477
- avoid warning about (unused) pointer before start of array in deflate.c
14151478
- avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
14161479
- avoid reserved word 'new' in trees.c
14171480
14181481
Changes in 0.93 (25 June 95)
@@ -1427,11 +1490,11 @@
14271490
- don't assume that char is signed (problem on SGI)
14281491
- Clear bit buffer when starting a stored block
14291492
- no memcpy on Pyramid
14301493
- suppressed inftest.c
14311494
- optimized fill_window, put longest_match inline for gcc
1432
-- optimized inflate on stored blocks.
1495
+- optimized inflate on stored blocks
14331496
- untabify all sources to simplify patches
14341497
14351498
Changes in 0.91 (2 May 95)
14361499
- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
14371500
- Document the memory requirements in zconf.h
@@ -1445,71 +1508,71 @@
14451508
- don't assume that zalloc clears the allocated memory (the TurboC bug
14461509
was Mark's bug after all :)
14471510
- let again gzread copy uncompressed data unchanged (was working in 0.71)
14481511
- deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
14491512
- added a test of inflateSync in example.c
1450
-- moved MAX_WBITS to zconf.h because users might want to change that.
1513
+- moved MAX_WBITS to zconf.h because users might want to change that
14511514
- document explicitly that zalloc(64K) on MSDOS must return a normalized
14521515
pointer (zero offset)
14531516
- added Makefiles for Microsoft C, Turbo C, Borland C++
14541517
- faster crc32()
14551518
14561519
Changes in 0.8 (29 April 95)
14571520
- added fast inflate (inffast.c)
14581521
- deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
1459
- is incompatible with previous versions of zlib which returned Z_OK.
1522
+ is incompatible with previous versions of zlib which returned Z_OK
14601523
- work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
14611524
(actually that was not a compiler bug, see 0.81 above)
14621525
- gzread no longer reads one extra byte in certain cases
14631526
- In gzio destroy(), don't reference a freed structure
14641527
- avoid many warnings for MSDOS
14651528
- avoid the ERROR symbol which is used by MS Windows
14661529
14671530
Changes in 0.71 (14 April 95)
14681531
- Fixed more MSDOS compilation problems :( There is still a bug with
1469
- TurboC large model.
1532
+ TurboC large model
14701533
14711534
Changes in 0.7 (14 April 95)
1472
-- Added full inflate support.
1535
+- Added full inflate support
14731536
- Simplified the crc32() interface. The pre- and post-conditioning
14741537
(one's complement) is now done inside crc32(). WARNING: this is
1475
- incompatible with previous versions; see zlib.h for the new usage.
1538
+ incompatible with previous versions; see zlib.h for the new usage
14761539
14771540
Changes in 0.61 (12 April 95)
1478
-- workaround for a bug in TurboC. example and minigzip now work on MSDOS.
1541
+- workaround for a bug in TurboC. example and minigzip now work on MSDOS
14791542
14801543
Changes in 0.6 (11 April 95)
14811544
- added minigzip.c
14821545
- added gzdopen to reopen a file descriptor as gzFile
1483
-- added transparent reading of non-gziped files in gzread.
1546
+- added transparent reading of non-gziped files in gzread
14841547
- fixed bug in gzread (don't read crc as data)
1485
-- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose).
1548
+- fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose)
14861549
- don't allocate big arrays in the stack (for MSDOS)
14871550
- fix some MSDOS compilation problems
14881551
14891552
Changes in 0.5:
14901553
- do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
1491
- not yet Z_FULL_FLUSH.
1554
+ not yet Z_FULL_FLUSH
14921555
- support decompression but only in a single step (forced Z_FINISH)
1493
-- added opaque object for zalloc and zfree.
1556
+- added opaque object for zalloc and zfree
14941557
- added deflateReset and inflateReset
1495
-- added a variable zlib_version for consistency checking.
1496
-- renamed the 'filter' parameter of deflateInit2 as 'strategy'.
1497
- Added Z_FILTERED and Z_HUFFMAN_ONLY constants.
1558
+- added a variable zlib_version for consistency checking
1559
+- renamed the 'filter' parameter of deflateInit2 as 'strategy'
1560
+ Added Z_FILTERED and Z_HUFFMAN_ONLY constants
14981561
14991562
Changes in 0.4:
1500
-- avoid "zip" everywhere, use zlib instead of ziplib.
1563
+- avoid "zip" everywhere, use zlib instead of ziplib
15011564
- suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
1502
- if compression method == 8.
1565
+ if compression method == 8
15031566
- added adler32 and crc32
15041567
- renamed deflateOptions as deflateInit2, call one or the other but not both
1505
-- added the method parameter for deflateInit2.
1568
+- added the method parameter for deflateInit2
15061569
- added inflateInit2
15071570
- simplied considerably deflateInit and inflateInit by not supporting
15081571
user-provided history buffer. This is supported only in deflateInit2
1509
- and inflateInit2.
1572
+ and inflateInit2
15101573
15111574
Changes in 0.3:
15121575
- prefix all macro names with Z_
1513
-- use Z_FINISH instead of deflateEnd to finish compression.
1576
+- use Z_FINISH instead of deflateEnd to finish compression
15141577
- added Z_HUFFMAN_ONLY
15151578
- added gzerror()
15161579
--- compat/zlib/ChangeLog
+++ compat/zlib/ChangeLog
@@ -1,8 +1,71 @@
1
2 ChangeLog file for zlib
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4 Changes in 1.2.11 (15 Jan 2017)
5 - Fix deflate stored bug when pulling last block from window
6 - Permit immediate deflateParams changes before any deflate input
7
8 Changes in 1.2.10 (2 Jan 2017)
@@ -509,11 +572,11 @@
509 - Replace use of errno in gz* with functions, support WinCE [Alves]
510 - Provide alternative to perror() in minigzip.c for WinCE [Alves]
511 - Don't use _vsnprintf on later versions of MSVC [Lowman]
512 - Add CMake build script and input file [Lowman]
513 - Update contrib/minizip to 1.1 [Svensson, Vollant]
514 - Moved nintendods directory from contrib to .
515 - Replace gzio.c with a new set of routines with the same functionality
516 - Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
517 - Update contrib/minizip to 1.1b
518 - Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
519
@@ -683,11 +746,11 @@
683 - Update make_vms.com [Zinser]
684 - Initialize state->write in inflateReset() since copied in inflate_fast()
685 - Be more strict on incomplete code sets in inflate_table() and increase
686 ENOUGH and MAXD -- this repairs a possible security vulnerability for
687 invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for
688 discovering the vulnerability and providing test cases.
689 - Add ia64 support to configure for HP-UX [Smith]
690 - Add error return to gzread() for format or i/o error [Levin]
691 - Use malloc.h for OS/2 [Necasek]
692
693 Changes in 1.2.2.3 (27 May 2005)
@@ -719,11 +782,11 @@
719 - Improve WinCE errno handling and comments [Chang]
720 - Remove comment about no gzip header processing in FAQ
721 - Add Z_FIXED strategy option to deflateInit2() to force fixed trees
722 - Add updated make_vms.com [Coghlan], update README
723 - Create a new "examples" directory, move gzappend.c there, add zpipe.c,
724 fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html.
725 - Add FAQ entry and comments in deflate.c on uninitialized memory access
726 - Add Solaris 9 make options in configure [Gilbert]
727 - Allow strerror() usage in gzio.c for STDC
728 - Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer]
729 - Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant]
@@ -790,11 +853,11 @@
790 - Update email address in README
791 - Several FAQ updates
792 - Fix a big fat bug in inftrees.c that prevented decoding valid
793 dynamic blocks with only literals and no distance codes --
794 Thanks to "Hot Emu" for the bug report and sample file
795 - Add a note to puff.c on no distance codes case.
796
797 Changes in 1.2.1 (17 November 2003)
798 - Remove a tab in contrib/gzappend/gzappend.c
799 - Update some interfaces in contrib for new zlib functions
800 - Update zlib version number in some contrib entries
@@ -1034,18 +1097,18 @@
1034 - Add contrib/inflate86/ for x86 faster inflate
1035 - Add contrib/blast/ for PKWare Data Compression Library decompression
1036 - Add contrib/puff/ simple inflate for deflate format description
1037
1038 Changes in 1.1.4 (11 March 2002)
1039 - ZFREE was repeated on same allocation on some error conditions.
1040 This creates a security problem described in
1041 http://www.zlib.org/advisory-2002-03-11.txt
1042 - Returned incorrect error (Z_MEM_ERROR) on some invalid data
1043 - Avoid accesses before window for invalid distances with inflate window
1044 less than 32K.
1045 - force windowBits > 8 to avoid a bug in the encoder for a window size
1046 of 256 bytes. (A complete fix will be available in 1.1.5).
1047
1048 Changes in 1.1.3 (9 July 1998)
1049 - fix "an inflate input buffer bug that shows up on rare but persistent
1050 occasions" (Mark)
1051 - fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
@@ -1115,11 +1178,11 @@
1115 Changes in 1.1.1 (27 Feb 98)
1116 - fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson)
1117 - remove block truncation heuristic which had very marginal effect for zlib
1118 (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
1119 compression ratio on some files. This also allows inlining _tr_tally for
1120 matches in deflate_slow.
1121 - added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
1122
1123 Changes in 1.1.0 (24 Feb 98)
1124 - do not return STREAM_END prematurely in inflate (John Bowler)
1125 - revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
@@ -1160,11 +1223,11 @@
1160 - fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
1161 - added compress2() to allow setting the compression level
1162 - include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
1163 - use constant arrays for the static trees in trees.c instead of computing
1164 them at run time (thanks to Ken Raeburn for this suggestion). To create
1165 trees.h, compile with GEN_TREES_H and run "make test".
1166 - check return code of example in "make test" and display result
1167 - pass minigzip command line options to file_compress
1168 - simplifying code of inflateSync to avoid gcc 2.8 bug
1169
1170 - support CC="gcc -Wall" in configure -s (QingLong)
@@ -1199,16 +1262,16 @@
1199
1200 Changes in 1.0.6 (19 Jan 1998)
1201 - add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
1202 gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
1203 - Fix a deflate bug occurring only with compression level 0 (thanks to
1204 Andy Buckler for finding this one).
1205 - In minigzip, pass transparently also the first byte for .Z files.
1206 - return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
1207 - check Z_FINISH in inflate (thanks to Marc Schluper)
1208 - Implement deflateCopy (thanks to Adam Costello)
1209 - make static libraries by default in configure, add --shared option.
1210 - move MSDOS or Windows specific files to directory msdos
1211 - suppress the notion of partial flush to simplify the interface
1212 (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
1213 - suppress history buffer provided by application to simplify the interface
1214 (this feature was not implemented anyway in 1.0.4)
@@ -1216,29 +1279,29 @@
1216 inflateInit2
1217 - add EXPORT in all exported functions (for Windows DLL)
1218 - added Makefile.nt (thanks to Stephen Williams)
1219 - added the unsupported "contrib" directory:
1220 contrib/asm386/ by Gilles Vollant <[email protected]>
1221 386 asm code replacing longest_match().
1222 contrib/iostream/ by Kevin Ruland <[email protected]>
1223 A C++ I/O streams interface to the zlib gz* functions
1224 contrib/iostream2/ by Tyge Løvset <[email protected]>
1225 Another C++ I/O streams interface
1226 contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <[email protected]>
1227 A very simple tar.gz file extractor using zlib
1228 contrib/visual-basic.txt by Carlos Rios <[email protected]>
1229 How to use compress(), uncompress() and the gz* functions from VB.
1230 - pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
1231 level) in minigzip (thanks to Tom Lane)
1232
1233 - use const for rommable constants in deflate
1234 - added test for gzseek and gztell in example.c
1235 - add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
1236 - add undocumented function zError to convert error code to string
1237 (for Tim Smithers)
1238 - Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code.
1239 - Use default memcpy for Symantec MSDOS compiler.
1240 - Add EXPORT keyword for check_func (needed for Windows DLL)
1241 - add current directory to LD_LIBRARY_PATH for "make test"
1242 - create also a link for libz.so.1
1243 - added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
1244 - use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
@@ -1247,21 +1310,21 @@
1247 - add advice in zlib.h for best usage of deflateSetDictionary
1248 - work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
1249 - allow compilation with ANSI keywords only enabled for TurboC in large model
1250 - avoid "versionString"[0] (Borland bug)
1251 - add NEED_DUMMY_RETURN for Borland
1252 - use variable z_verbose for tracing in debug mode (L. Peter Deutsch).
1253 - allow compilation with CC
1254 - defined STDC for OS/2 (David Charlap)
1255 - limit external names to 8 chars for MVS (Thomas Lund)
1256 - in minigzip.c, use static buffers only for 16-bit systems
1257 - fix suffix check for "minigzip -d foo.gz"
1258 - do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
1259 - use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
1260 - added makelcc.bat for lcc-win32 (Tom St Denis)
1261 - in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
1262 - Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion.
1263 - check for unistd.h in configure (for off_t)
1264 - remove useless check parameter in inflate_blocks_free
1265 - avoid useless assignment of s->check to itself in inflate_blocks_new
1266 - do not flush twice in gzclose (thanks to Ken Raeburn)
1267 - rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
@@ -1278,11 +1341,11 @@
1278 - Update web address in README
1279
1280 Changes in 1.0.4 (24 Jul 96)
1281 - In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
1282 bit, so the decompressor could decompress all the correct data but went
1283 on to attempt decompressing extra garbage data. This affected minigzip too.
1284 - zlibVersion and gzerror return const char* (needed for DLL)
1285 - port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
1286 - use z_error only for DEBUG (avoid problem with DLLs)
1287
1288 Changes in 1.0.3 (2 Jul 96)
@@ -1308,11 +1371,11 @@
1308
1309 Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
1310 - fix array overlay in deflate.c which sometimes caused bad compressed data
1311 - fix inflate bug with empty stored block
1312 - fix MSDOS medium model which was broken in 0.99
1313 - fix deflateParams() which could generate bad compressed data.
1314 - Bytef is define'd instead of typedef'ed (work around Borland bug)
1315 - added an INDEX file
1316 - new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
1317 Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
1318 - speed up adler32 for modern machines without auto-increment
@@ -1329,11 +1392,11 @@
1329
1330 Changes in 0.99 (27 Jan 96)
1331 - allow preset dictionary shared between compressor and decompressor
1332 - allow compression level 0 (no compression)
1333 - add deflateParams in zlib.h: allow dynamic change of compression level
1334 and compression strategy.
1335 - test large buffers and deflateParams in example.c
1336 - add optional "configure" to build zlib as a shared library
1337 - suppress Makefile.qnx, use configure instead
1338 - fixed deflate for 64-bit systems (detected on Cray)
1339 - fixed inflate_blocks for 64-bit systems (detected on Alpha)
@@ -1371,48 +1434,48 @@
1371 - in fcalloc, normalize pointer if size > 65520 bytes
1372 - don't use special fcalloc for 32 bit Borland C++
1373 - use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
1374 - use Z_BINARY instead of BINARY
1375 - document that gzclose after gzdopen will close the file
1376 - allow "a" as mode in gzopen.
1377 - fix error checking in gzread
1378 - allow skipping .gz extra-field on pipes
1379 - added reference to Perl interface in README
1380 - put the crc table in FAR data (I dislike more and more the medium model :)
1381 - added get_crc_table
1382 - added a dimension to all arrays (Borland C can't count).
1383 - workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
1384 - guard against multiple inclusion of *.h (for precompiled header on Mac)
1385 - Watcom C pretends to be Microsoft C small model even in 32 bit mode.
1386 - don't use unsized arrays to avoid silly warnings by Visual C++:
1387 warning C4746: 'inflate_mask' : unsized array treated as '__far'
1388 (what's wrong with far data in far model?).
1389 - define enum out of inflate_blocks_state to allow compilation with C++
1390
1391 Changes in 0.95 (16 Aug 95)
1392 - fix MSDOS small and medium model (now easier to adapt to any compiler)
1393 - inlined send_bits
1394 - fix the final (:-) bug for deflate with flush (output was correct but
1395 not completely flushed in rare occasions).
1396 - default window size is same for compression and decompression
1397 (it's now sufficient to set MAX_WBITS in zconf.h).
1398 - voidp -> voidpf and voidnp -> voidp (for consistency with other
1399 typedefs and because voidnp was not near in large model).
1400
1401 Changes in 0.94 (13 Aug 95)
1402 - support MSDOS medium model
1403 - fix deflate with flush (could sometimes generate bad output)
1404 - fix deflateReset (zlib header was incorrectly suppressed)
1405 - added support for VMS
1406 - allow a compression level in gzopen()
1407 - gzflush now calls fflush
1408 - For deflate with flush, flush even if no more input is provided.
1409 - rename libgz.a as libz.a
1410 - avoid complex expression in infcodes.c triggering Turbo C bug
1411 - work around a problem with gcc on Alpha (in INSERT_STRING)
1412 - don't use inline functions (problem with some gcc versions)
1413 - allow renaming of Byte, uInt, etc... with #define.
1414 - avoid warning about (unused) pointer before start of array in deflate.c
1415 - avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
1416 - avoid reserved word 'new' in trees.c
1417
1418 Changes in 0.93 (25 June 95)
@@ -1427,11 +1490,11 @@
1427 - don't assume that char is signed (problem on SGI)
1428 - Clear bit buffer when starting a stored block
1429 - no memcpy on Pyramid
1430 - suppressed inftest.c
1431 - optimized fill_window, put longest_match inline for gcc
1432 - optimized inflate on stored blocks.
1433 - untabify all sources to simplify patches
1434
1435 Changes in 0.91 (2 May 95)
1436 - Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
1437 - Document the memory requirements in zconf.h
@@ -1445,71 +1508,71 @@
1445 - don't assume that zalloc clears the allocated memory (the TurboC bug
1446 was Mark's bug after all :)
1447 - let again gzread copy uncompressed data unchanged (was working in 0.71)
1448 - deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
1449 - added a test of inflateSync in example.c
1450 - moved MAX_WBITS to zconf.h because users might want to change that.
1451 - document explicitly that zalloc(64K) on MSDOS must return a normalized
1452 pointer (zero offset)
1453 - added Makefiles for Microsoft C, Turbo C, Borland C++
1454 - faster crc32()
1455
1456 Changes in 0.8 (29 April 95)
1457 - added fast inflate (inffast.c)
1458 - deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
1459 is incompatible with previous versions of zlib which returned Z_OK.
1460 - work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
1461 (actually that was not a compiler bug, see 0.81 above)
1462 - gzread no longer reads one extra byte in certain cases
1463 - In gzio destroy(), don't reference a freed structure
1464 - avoid many warnings for MSDOS
1465 - avoid the ERROR symbol which is used by MS Windows
1466
1467 Changes in 0.71 (14 April 95)
1468 - Fixed more MSDOS compilation problems :( There is still a bug with
1469 TurboC large model.
1470
1471 Changes in 0.7 (14 April 95)
1472 - Added full inflate support.
1473 - Simplified the crc32() interface. The pre- and post-conditioning
1474 (one's complement) is now done inside crc32(). WARNING: this is
1475 incompatible with previous versions; see zlib.h for the new usage.
1476
1477 Changes in 0.61 (12 April 95)
1478 - workaround for a bug in TurboC. example and minigzip now work on MSDOS.
1479
1480 Changes in 0.6 (11 April 95)
1481 - added minigzip.c
1482 - added gzdopen to reopen a file descriptor as gzFile
1483 - added transparent reading of non-gziped files in gzread.
1484 - fixed bug in gzread (don't read crc as data)
1485 - fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose).
1486 - don't allocate big arrays in the stack (for MSDOS)
1487 - fix some MSDOS compilation problems
1488
1489 Changes in 0.5:
1490 - do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
1491 not yet Z_FULL_FLUSH.
1492 - support decompression but only in a single step (forced Z_FINISH)
1493 - added opaque object for zalloc and zfree.
1494 - added deflateReset and inflateReset
1495 - added a variable zlib_version for consistency checking.
1496 - renamed the 'filter' parameter of deflateInit2 as 'strategy'.
1497 Added Z_FILTERED and Z_HUFFMAN_ONLY constants.
1498
1499 Changes in 0.4:
1500 - avoid "zip" everywhere, use zlib instead of ziplib.
1501 - suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
1502 if compression method == 8.
1503 - added adler32 and crc32
1504 - renamed deflateOptions as deflateInit2, call one or the other but not both
1505 - added the method parameter for deflateInit2.
1506 - added inflateInit2
1507 - simplied considerably deflateInit and inflateInit by not supporting
1508 user-provided history buffer. This is supported only in deflateInit2
1509 and inflateInit2.
1510
1511 Changes in 0.3:
1512 - prefix all macro names with Z_
1513 - use Z_FINISH instead of deflateEnd to finish compression.
1514 - added Z_HUFFMAN_ONLY
1515 - added gzerror()
1516
--- compat/zlib/ChangeLog
+++ compat/zlib/ChangeLog
@@ -1,8 +1,71 @@
1
2 ChangeLog file for zlib
3
4 Changes in 1.2.12 (27 Mar 2022)
5 - Cygwin does not have _wopen(), so do not create gzopen_w() there
6 - Permit a deflateParams() parameter change as soon as possible
7 - Limit hash table inserts after switch from stored deflate
8 - Fix bug when window full in deflate_stored()
9 - Fix CLEAR_HASH macro to be usable as a single statement
10 - Avoid a conversion error in gzseek when off_t type too small
11 - Have Makefile return non-zero error code on test failure
12 - Avoid some conversion warnings in gzread.c and gzwrite.c
13 - Update use of errno for newer Windows CE versions
14 - Small speedup to inflate [psumbera]
15 - Return an error if the gzputs string length can't fit in an int
16 - Add address checking in clang to -w option of configure
17 - Don't compute check value for raw inflate if asked to validate
18 - Handle case where inflateSync used when header never processed
19 - Avoid the use of ptrdiff_t
20 - Avoid an undefined behavior of memcpy() in gzappend()
21 - Avoid undefined behaviors of memcpy() in gz*printf()
22 - Avoid an undefined behavior of memcpy() in _tr_stored_block()
23 - Make the names in functions declarations identical to definitions
24 - Remove old assembler code in which bugs have manifested
25 - Fix deflateEnd() to not report an error at start of raw deflate
26 - Add legal disclaimer to README
27 - Emphasize the need to continue decompressing gzip members
28 - Correct the initialization requirements for deflateInit2()
29 - Fix a bug that can crash deflate on some input when using Z_FIXED
30 - Assure that the number of bits for deflatePrime() is valid
31 - Use a structure to make globals in enough.c evident
32 - Use a macro for the printf format of big_t in enough.c
33 - Clean up code style in enough.c, update version
34 - Use inline function instead of macro for index in enough.c
35 - Clarify that prefix codes are counted in enough.c
36 - Show all the codes for the maximum tables size in enough.c
37 - Add gznorm.c example, which normalizes gzip files
38 - Fix the zran.c example to work on a multiple-member gzip file
39 - Add tables for crc32_combine(), to speed it up by a factor of 200
40 - Add crc32_combine_gen() and crc32_combine_op() for fast combines
41 - Speed up software CRC-32 computation by a factor of 1.5 to 3
42 - Use atomic test and set, if available, for dynamic CRC tables
43 - Don't bother computing check value after successful inflateSync()
44 - Correct comment in crc32.c
45 - Add use of the ARMv8 crc32 instructions when requested
46 - Use ARM crc32 instructions if the ARM architecture has them
47 - Explicitly note that the 32-bit check values are 32 bits
48 - Avoid adding empty gzip member after gzflush with Z_FINISH
49 - Fix memory leak on error in gzlog.c
50 - Fix error in comment on the polynomial representation of a byte
51 - Clarify gz* function interfaces, referring to parameter names
52 - Change macro name in inflate.c to avoid collision in VxWorks
53 - Correct typo in blast.c
54 - Improve portability of contrib/minizip
55 - Fix indentation in minizip's zip.c
56 - Replace black/white with allow/block. (theresa-m)
57 - minizip warning fix if MAXU32 already defined. (gvollant)
58 - Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner)
59 - Clean up minizip to reduce warnings for testing
60 - Add fallthrough comments for gcc
61 - Eliminate use of ULL constants
62 - Separate out address sanitizing from warnings in configure
63 - Remove destructive aspects of make distclean
64 - Check for cc masquerading as gcc or clang in configure
65 - Fix crc32.c to compile local functions only if used
66
67 Changes in 1.2.11 (15 Jan 2017)
68 - Fix deflate stored bug when pulling last block from window
69 - Permit immediate deflateParams changes before any deflate input
70
71 Changes in 1.2.10 (2 Jan 2017)
@@ -509,11 +572,11 @@
572 - Replace use of errno in gz* with functions, support WinCE [Alves]
573 - Provide alternative to perror() in minigzip.c for WinCE [Alves]
574 - Don't use _vsnprintf on later versions of MSVC [Lowman]
575 - Add CMake build script and input file [Lowman]
576 - Update contrib/minizip to 1.1 [Svensson, Vollant]
577 - Moved nintendods directory from contrib to root
578 - Replace gzio.c with a new set of routines with the same functionality
579 - Add gzbuffer(), gzoffset(), gzclose_r(), gzclose_w() as part of above
580 - Update contrib/minizip to 1.1b
581 - Change gzeof() to return 0 on error instead of -1 to agree with zlib.h
582
@@ -683,11 +746,11 @@
746 - Update make_vms.com [Zinser]
747 - Initialize state->write in inflateReset() since copied in inflate_fast()
748 - Be more strict on incomplete code sets in inflate_table() and increase
749 ENOUGH and MAXD -- this repairs a possible security vulnerability for
750 invalid inflate input. Thanks to Tavis Ormandy and Markus Oberhumer for
751 discovering the vulnerability and providing test cases
752 - Add ia64 support to configure for HP-UX [Smith]
753 - Add error return to gzread() for format or i/o error [Levin]
754 - Use malloc.h for OS/2 [Necasek]
755
756 Changes in 1.2.2.3 (27 May 2005)
@@ -719,11 +782,11 @@
782 - Improve WinCE errno handling and comments [Chang]
783 - Remove comment about no gzip header processing in FAQ
784 - Add Z_FIXED strategy option to deflateInit2() to force fixed trees
785 - Add updated make_vms.com [Coghlan], update README
786 - Create a new "examples" directory, move gzappend.c there, add zpipe.c,
787 fitblk.c, gzlog.[ch], gzjoin.c, and zlib_how.html
788 - Add FAQ entry and comments in deflate.c on uninitialized memory access
789 - Add Solaris 9 make options in configure [Gilbert]
790 - Allow strerror() usage in gzio.c for STDC
791 - Fix DecompressBuf in contrib/delphi/ZLib.pas [ManChesTer]
792 - Update contrib/masmx86/inffas32.asm and gvmat32.asm [Vollant]
@@ -790,11 +853,11 @@
853 - Update email address in README
854 - Several FAQ updates
855 - Fix a big fat bug in inftrees.c that prevented decoding valid
856 dynamic blocks with only literals and no distance codes --
857 Thanks to "Hot Emu" for the bug report and sample file
858 - Add a note to puff.c on no distance codes case
859
860 Changes in 1.2.1 (17 November 2003)
861 - Remove a tab in contrib/gzappend/gzappend.c
862 - Update some interfaces in contrib for new zlib functions
863 - Update zlib version number in some contrib entries
@@ -1034,18 +1097,18 @@
1097 - Add contrib/inflate86/ for x86 faster inflate
1098 - Add contrib/blast/ for PKWare Data Compression Library decompression
1099 - Add contrib/puff/ simple inflate for deflate format description
1100
1101 Changes in 1.1.4 (11 March 2002)
1102 - ZFREE was repeated on same allocation on some error conditions
1103 This creates a security problem described in
1104 http://www.zlib.org/advisory-2002-03-11.txt
1105 - Returned incorrect error (Z_MEM_ERROR) on some invalid data
1106 - Avoid accesses before window for invalid distances with inflate window
1107 less than 32K
1108 - force windowBits > 8 to avoid a bug in the encoder for a window size
1109 of 256 bytes. (A complete fix will be available in 1.1.5)
1110
1111 Changes in 1.1.3 (9 July 1998)
1112 - fix "an inflate input buffer bug that shows up on rare but persistent
1113 occasions" (Mark)
1114 - fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
@@ -1115,11 +1178,11 @@
1178 Changes in 1.1.1 (27 Feb 98)
1179 - fix macros _tr_tally_* in deflate.h for debug mode (Glenn Randers-Pehrson)
1180 - remove block truncation heuristic which had very marginal effect for zlib
1181 (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
1182 compression ratio on some files. This also allows inlining _tr_tally for
1183 matches in deflate_slow
1184 - added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
1185
1186 Changes in 1.1.0 (24 Feb 98)
1187 - do not return STREAM_END prematurely in inflate (John Bowler)
1188 - revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
@@ -1160,11 +1223,11 @@
1223 - fix gzgetc and gzputc for big endian systems (Markus Oberhumer)
1224 - added compress2() to allow setting the compression level
1225 - include sys/types.h to get off_t on some systems (Marc Lehmann & QingLong)
1226 - use constant arrays for the static trees in trees.c instead of computing
1227 them at run time (thanks to Ken Raeburn for this suggestion). To create
1228 trees.h, compile with GEN_TREES_H and run "make test"
1229 - check return code of example in "make test" and display result
1230 - pass minigzip command line options to file_compress
1231 - simplifying code of inflateSync to avoid gcc 2.8 bug
1232
1233 - support CC="gcc -Wall" in configure -s (QingLong)
@@ -1199,16 +1262,16 @@
1262
1263 Changes in 1.0.6 (19 Jan 1998)
1264 - add functions gzprintf, gzputc, gzgetc, gztell, gzeof, gzseek, gzrewind and
1265 gzsetparams (thanks to Roland Giersig and Kevin Ruland for some of this code)
1266 - Fix a deflate bug occurring only with compression level 0 (thanks to
1267 Andy Buckler for finding this one)
1268 - In minigzip, pass transparently also the first byte for .Z files
1269 - return Z_BUF_ERROR instead of Z_OK if output buffer full in uncompress()
1270 - check Z_FINISH in inflate (thanks to Marc Schluper)
1271 - Implement deflateCopy (thanks to Adam Costello)
1272 - make static libraries by default in configure, add --shared option
1273 - move MSDOS or Windows specific files to directory msdos
1274 - suppress the notion of partial flush to simplify the interface
1275 (but the symbol Z_PARTIAL_FLUSH is kept for compatibility with 1.0.4)
1276 - suppress history buffer provided by application to simplify the interface
1277 (this feature was not implemented anyway in 1.0.4)
@@ -1216,29 +1279,29 @@
1279 inflateInit2
1280 - add EXPORT in all exported functions (for Windows DLL)
1281 - added Makefile.nt (thanks to Stephen Williams)
1282 - added the unsupported "contrib" directory:
1283 contrib/asm386/ by Gilles Vollant <[email protected]>
1284 386 asm code replacing longest_match()
1285 contrib/iostream/ by Kevin Ruland <[email protected]>
1286 A C++ I/O streams interface to the zlib gz* functions
1287 contrib/iostream2/ by Tyge Løvset <[email protected]>
1288 Another C++ I/O streams interface
1289 contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <[email protected]>
1290 A very simple tar.gz file extractor using zlib
1291 contrib/visual-basic.txt by Carlos Rios <[email protected]>
1292 How to use compress(), uncompress() and the gz* functions from VB
1293 - pass params -f (filtered data), -h (huffman only), -1 to -9 (compression
1294 level) in minigzip (thanks to Tom Lane)
1295
1296 - use const for rommable constants in deflate
1297 - added test for gzseek and gztell in example.c
1298 - add undocumented function inflateSyncPoint() (hack for Paul Mackerras)
1299 - add undocumented function zError to convert error code to string
1300 (for Tim Smithers)
1301 - Allow compilation of gzio with -DNO_DEFLATE to avoid the compression code
1302 - Use default memcpy for Symantec MSDOS compiler
1303 - Add EXPORT keyword for check_func (needed for Windows DLL)
1304 - add current directory to LD_LIBRARY_PATH for "make test"
1305 - create also a link for libz.so.1
1306 - added support for FUJITSU UXP/DS (thanks to Toshiaki Nomura)
1307 - use $(SHAREDLIB) instead of libz.so in Makefile.in (for HPUX)
@@ -1247,21 +1310,21 @@
1310 - add advice in zlib.h for best usage of deflateSetDictionary
1311 - work around compiler bug on Atari (cast Z_NULL in call of s->checkfn)
1312 - allow compilation with ANSI keywords only enabled for TurboC in large model
1313 - avoid "versionString"[0] (Borland bug)
1314 - add NEED_DUMMY_RETURN for Borland
1315 - use variable z_verbose for tracing in debug mode (L. Peter Deutsch)
1316 - allow compilation with CC
1317 - defined STDC for OS/2 (David Charlap)
1318 - limit external names to 8 chars for MVS (Thomas Lund)
1319 - in minigzip.c, use static buffers only for 16-bit systems
1320 - fix suffix check for "minigzip -d foo.gz"
1321 - do not return an error for the 2nd of two consecutive gzflush() (Felix Lee)
1322 - use _fdopen instead of fdopen for MSC >= 6.0 (Thomas Fanslau)
1323 - added makelcc.bat for lcc-win32 (Tom St Denis)
1324 - in Makefile.dj2, use copy and del instead of install and rm (Frank Donahoe)
1325 - Avoid expanded $Id$. Use "rcs -kb" or "cvs admin -kb" to avoid Id expansion
1326 - check for unistd.h in configure (for off_t)
1327 - remove useless check parameter in inflate_blocks_free
1328 - avoid useless assignment of s->check to itself in inflate_blocks_new
1329 - do not flush twice in gzclose (thanks to Ken Raeburn)
1330 - rename FOPEN as F_OPEN to avoid clash with /usr/include/sys/file.h
@@ -1278,11 +1341,11 @@
1341 - Update web address in README
1342
1343 Changes in 1.0.4 (24 Jul 96)
1344 - In very rare conditions, deflate(s, Z_FINISH) could fail to produce an EOF
1345 bit, so the decompressor could decompress all the correct data but went
1346 on to attempt decompressing extra garbage data. This affected minigzip too
1347 - zlibVersion and gzerror return const char* (needed for DLL)
1348 - port to RISCOS (no fdopen, no multiple dots, no unlink, no fileno)
1349 - use z_error only for DEBUG (avoid problem with DLLs)
1350
1351 Changes in 1.0.3 (2 Jul 96)
@@ -1308,11 +1371,11 @@
1371
1372 Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
1373 - fix array overlay in deflate.c which sometimes caused bad compressed data
1374 - fix inflate bug with empty stored block
1375 - fix MSDOS medium model which was broken in 0.99
1376 - fix deflateParams() which could generate bad compressed data
1377 - Bytef is define'd instead of typedef'ed (work around Borland bug)
1378 - added an INDEX file
1379 - new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),
1380 Watcom (Makefile.wat), Amiga SAS/C (Makefile.sas)
1381 - speed up adler32 for modern machines without auto-increment
@@ -1329,11 +1392,11 @@
1392
1393 Changes in 0.99 (27 Jan 96)
1394 - allow preset dictionary shared between compressor and decompressor
1395 - allow compression level 0 (no compression)
1396 - add deflateParams in zlib.h: allow dynamic change of compression level
1397 and compression strategy
1398 - test large buffers and deflateParams in example.c
1399 - add optional "configure" to build zlib as a shared library
1400 - suppress Makefile.qnx, use configure instead
1401 - fixed deflate for 64-bit systems (detected on Cray)
1402 - fixed inflate_blocks for 64-bit systems (detected on Alpha)
@@ -1371,48 +1434,48 @@
1434 - in fcalloc, normalize pointer if size > 65520 bytes
1435 - don't use special fcalloc for 32 bit Borland C++
1436 - use STDC instead of __GO32__ to avoid redeclaring exit, calloc, etc...
1437 - use Z_BINARY instead of BINARY
1438 - document that gzclose after gzdopen will close the file
1439 - allow "a" as mode in gzopen
1440 - fix error checking in gzread
1441 - allow skipping .gz extra-field on pipes
1442 - added reference to Perl interface in README
1443 - put the crc table in FAR data (I dislike more and more the medium model :)
1444 - added get_crc_table
1445 - added a dimension to all arrays (Borland C can't count)
1446 - workaround Borland C bug in declaration of inflate_codes_new & inflate_fast
1447 - guard against multiple inclusion of *.h (for precompiled header on Mac)
1448 - Watcom C pretends to be Microsoft C small model even in 32 bit mode
1449 - don't use unsized arrays to avoid silly warnings by Visual C++:
1450 warning C4746: 'inflate_mask' : unsized array treated as '__far'
1451 (what's wrong with far data in far model?)
1452 - define enum out of inflate_blocks_state to allow compilation with C++
1453
1454 Changes in 0.95 (16 Aug 95)
1455 - fix MSDOS small and medium model (now easier to adapt to any compiler)
1456 - inlined send_bits
1457 - fix the final (:-) bug for deflate with flush (output was correct but
1458 not completely flushed in rare occasions)
1459 - default window size is same for compression and decompression
1460 (it's now sufficient to set MAX_WBITS in zconf.h)
1461 - voidp -> voidpf and voidnp -> voidp (for consistency with other
1462 typedefs and because voidnp was not near in large model)
1463
1464 Changes in 0.94 (13 Aug 95)
1465 - support MSDOS medium model
1466 - fix deflate with flush (could sometimes generate bad output)
1467 - fix deflateReset (zlib header was incorrectly suppressed)
1468 - added support for VMS
1469 - allow a compression level in gzopen()
1470 - gzflush now calls fflush
1471 - For deflate with flush, flush even if no more input is provided
1472 - rename libgz.a as libz.a
1473 - avoid complex expression in infcodes.c triggering Turbo C bug
1474 - work around a problem with gcc on Alpha (in INSERT_STRING)
1475 - don't use inline functions (problem with some gcc versions)
1476 - allow renaming of Byte, uInt, etc... with #define
1477 - avoid warning about (unused) pointer before start of array in deflate.c
1478 - avoid various warnings in gzio.c, example.c, infblock.c, adler32.c, zutil.c
1479 - avoid reserved word 'new' in trees.c
1480
1481 Changes in 0.93 (25 June 95)
@@ -1427,11 +1490,11 @@
1490 - don't assume that char is signed (problem on SGI)
1491 - Clear bit buffer when starting a stored block
1492 - no memcpy on Pyramid
1493 - suppressed inftest.c
1494 - optimized fill_window, put longest_match inline for gcc
1495 - optimized inflate on stored blocks
1496 - untabify all sources to simplify patches
1497
1498 Changes in 0.91 (2 May 95)
1499 - Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
1500 - Document the memory requirements in zconf.h
@@ -1445,71 +1508,71 @@
1508 - don't assume that zalloc clears the allocated memory (the TurboC bug
1509 was Mark's bug after all :)
1510 - let again gzread copy uncompressed data unchanged (was working in 0.71)
1511 - deflate(Z_FULL_FLUSH), inflateReset and inflateSync are now fully implemented
1512 - added a test of inflateSync in example.c
1513 - moved MAX_WBITS to zconf.h because users might want to change that
1514 - document explicitly that zalloc(64K) on MSDOS must return a normalized
1515 pointer (zero offset)
1516 - added Makefiles for Microsoft C, Turbo C, Borland C++
1517 - faster crc32()
1518
1519 Changes in 0.8 (29 April 95)
1520 - added fast inflate (inffast.c)
1521 - deflate(Z_FINISH) now returns Z_STREAM_END when done. Warning: this
1522 is incompatible with previous versions of zlib which returned Z_OK
1523 - work around a TurboC compiler bug (bad code for b << 0, see infutil.h)
1524 (actually that was not a compiler bug, see 0.81 above)
1525 - gzread no longer reads one extra byte in certain cases
1526 - In gzio destroy(), don't reference a freed structure
1527 - avoid many warnings for MSDOS
1528 - avoid the ERROR symbol which is used by MS Windows
1529
1530 Changes in 0.71 (14 April 95)
1531 - Fixed more MSDOS compilation problems :( There is still a bug with
1532 TurboC large model
1533
1534 Changes in 0.7 (14 April 95)
1535 - Added full inflate support
1536 - Simplified the crc32() interface. The pre- and post-conditioning
1537 (one's complement) is now done inside crc32(). WARNING: this is
1538 incompatible with previous versions; see zlib.h for the new usage
1539
1540 Changes in 0.61 (12 April 95)
1541 - workaround for a bug in TurboC. example and minigzip now work on MSDOS
1542
1543 Changes in 0.6 (11 April 95)
1544 - added minigzip.c
1545 - added gzdopen to reopen a file descriptor as gzFile
1546 - added transparent reading of non-gziped files in gzread
1547 - fixed bug in gzread (don't read crc as data)
1548 - fixed bug in destroy (gzio.c) (don't return Z_STREAM_END for gzclose)
1549 - don't allocate big arrays in the stack (for MSDOS)
1550 - fix some MSDOS compilation problems
1551
1552 Changes in 0.5:
1553 - do real compression in deflate.c. Z_PARTIAL_FLUSH is supported but
1554 not yet Z_FULL_FLUSH
1555 - support decompression but only in a single step (forced Z_FINISH)
1556 - added opaque object for zalloc and zfree
1557 - added deflateReset and inflateReset
1558 - added a variable zlib_version for consistency checking
1559 - renamed the 'filter' parameter of deflateInit2 as 'strategy'
1560 Added Z_FILTERED and Z_HUFFMAN_ONLY constants
1561
1562 Changes in 0.4:
1563 - avoid "zip" everywhere, use zlib instead of ziplib
1564 - suppress Z_BLOCK_FLUSH, interpret Z_PARTIAL_FLUSH as block flush
1565 if compression method == 8
1566 - added adler32 and crc32
1567 - renamed deflateOptions as deflateInit2, call one or the other but not both
1568 - added the method parameter for deflateInit2
1569 - added inflateInit2
1570 - simplied considerably deflateInit and inflateInit by not supporting
1571 user-provided history buffer. This is supported only in deflateInit2
1572 and inflateInit2
1573
1574 Changes in 0.3:
1575 - prefix all macro names with Z_
1576 - use Z_FINISH instead of deflateEnd to finish compression
1577 - added Z_HUFFMAN_ONLY
1578 - added gzerror()
1579
--- compat/zlib/Makefile
+++ compat/zlib/Makefile
@@ -1,5 +1,408 @@
1
-all:
2
- -@echo "Please use ./configure first. Thank you."
1
+# Makefile for zlib
2
+# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
3
+# For conditions of distribution and use, see copyright notice in zlib.h
4
+
5
+# To compile and test, type:
6
+# ./configure; make test
7
+# Normally configure builds both a static and a shared library.
8
+# If you want to build just a static library, use: ./configure --static
9
+
10
+# To use the asm code, type:
11
+# cp contrib/asm?86/match.S ./match.S
12
+# make LOC=-DASMV OBJA=match.o
13
+
14
+# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
15
+# make install
16
+# To install in $HOME instead of /usr/local, use:
17
+# make install prefix=$HOME
18
+
19
+CC=gcc
20
+
21
+CFLAGS=-O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN
22
+#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
23
+#CFLAGS=-g -DZLIB_DEBUG
24
+#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
25
+# -Wstrict-prototypes -Wmissing-prototypes
26
+
27
+SFLAGS=-O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN
28
+LDFLAGS=
29
+TEST_LDFLAGS=-L. libz.a
30
+LDSHARED=gcc
31
+CPP=gcc -E
32
+
33
+STATICLIB=libz.a
34
+SHAREDLIB=
35
+SHAREDLIBV=
36
+SHAREDLIBM=
37
+LIBS=$(STATICLIB) $(SHAREDLIBV)
38
+
39
+AR=ar
40
+ARFLAGS=rc
41
+RANLIB=ranlib
42
+LDCONFIG=ldconfig
43
+LDSHAREDLIBC=-lc
44
+TAR=tar
45
+SHELL=/bin/sh
46
+EXE=
47
+
48
+prefix =/usr/local
49
+exec_prefix =${prefix}
50
+libdir =${exec_prefix}/lib
51
+sharedlibdir =${libdir}
52
+includedir =${prefix}/include
53
+mandir =${prefix}/share/man
54
+man3dir = ${mandir}/man3
55
+pkgconfigdir = ${libdir}/pkgconfig
56
+SRCDIR=
57
+ZINC=
58
+ZINCOUT=-I.
59
+
60
+OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
61
+OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
62
+OBJC = $(OBJZ) $(OBJG)
63
+
64
+PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
65
+PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
66
+PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
67
+
68
+# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
69
+OBJA =
70
+PIC_OBJA =
71
+
72
+OBJS = $(OBJC) $(OBJA)
73
+
74
+PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
75
+
76
+all: static all64
77
+
78
+static: example$(EXE) minigzip$(EXE)
79
+
80
+shared: examplesh$(EXE) minigzipsh$(EXE)
81
+
82
+all64: example64$(EXE) minigzip64$(EXE)
83
+
84
+check: test
85
+
86
+test: all teststatic test64
87
+
88
+teststatic: static
89
+ @TMPST=tmpst_$$; \
90
+ if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
91
+ echo ' *** zlib test OK ***'; \
92
+ else \
93
+ echo ' *** zlib test FAILED ***'; false; \
94
+ fi
95
+ @rm -f tmpst_$$
96
+
97
+testshared: shared
98
+ @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
99
+ LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
100
+ DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
101
+ SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
102
+ TMPSH=tmpsh_$$; \
103
+ if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
104
+ echo ' *** zlib shared test OK ***'; \
105
+ else \
106
+ echo ' *** zlib shared test FAILED ***'; false; \
107
+ fi
108
+ @rm -f tmpsh_$$
109
+
110
+test64: all64
111
+ @TMP64=tmp64_$$; \
112
+ if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
113
+ echo ' *** zlib 64-bit test OK ***'; \
114
+ else \
115
+ echo ' *** zlib 64-bit test FAILED ***'; false; \
116
+ fi
117
+ @rm -f tmp64_$$
118
+
119
+infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
120
+ $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
121
+
122
+infcover: infcover.o libz.a
123
+ $(CC) $(CFLAGS) -o $@ infcover.o libz.a
124
+
125
+cover: infcover
126
+ rm -f *.gcda
127
+ ./infcover
128
+ gcov inf*.c
129
+
130
+libz.a: $(OBJS)
131
+ $(AR) $(ARFLAGS) $@ $(OBJS)
132
+ -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
133
+
134
+match.o: match.S
135
+ $(CPP) match.S > _match.s
136
+ $(CC) -c _match.s
137
+ mv _match.o match.o
138
+ rm -f _match.s
139
+
140
+match.lo: match.S
141
+ $(CPP) match.S > _match.s
142
+ $(CC) -c -fPIC _match.s
143
+ mv _match.o match.lo
144
+ rm -f _match.s
145
+
146
+example.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
147
+ $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/example.c
148
+
149
+minigzip.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
150
+ $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/minigzip.c
151
+
152
+example64.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
153
+ $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/example.c
154
+
155
+minigzip64.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
156
+ $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/minigzip.c
157
+
158
+
159
+adler32.o: $(SRCDIR)adler32.c
160
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)adler32.c
161
+
162
+crc32.o: $(SRCDIR)crc32.c
163
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
164
+
165
+deflate.o: $(SRCDIR)deflate.c
166
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
167
+
168
+infback.o: $(SRCDIR)infback.c
169
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
170
+
171
+inffast.o: $(SRCDIR)inffast.c
172
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inffast.c
173
+
174
+inflate.o: $(SRCDIR)inflate.c
175
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inflate.c
176
+
177
+inftrees.o: $(SRCDIR)inftrees.c
178
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inftrees.c
179
+
180
+trees.o: $(SRCDIR)trees.c
181
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)trees.c
182
+
183
+zutil.o: $(SRCDIR)zutil.c
184
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)zutil.c
185
+
186
+compress.o: $(SRCDIR)compress.c
187
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)compress.c
188
+
189
+uncompr.o: $(SRCDIR)uncompr.c
190
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)uncompr.c
191
+
192
+gzclose.o: $(SRCDIR)gzclose.c
193
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzclose.c
194
+
195
+gzlib.o: $(SRCDIR)gzlib.c
196
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzlib.c
197
+
198
+gzread.o: $(SRCDIR)gzread.c
199
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzread.c
200
+
201
+gzwrite.o: $(SRCDIR)gzwrite.c
202
+ $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
203
+
204
+
205
+adler32.lo: $(SRCDIR)adler32.c
206
+ -@mkdir objs 2>/dev/null || test -d objs
207
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
208
+ -@mv objs/adler32.o $@
209
+
210
+crc32.lo: $(SRCDIR)crc32.c
211
+ -@mkdir objs 2>/dev/null || test -d objs
212
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
213
+ -@mv objs/crc32.o $@
214
+
215
+deflate.lo: $(SRCDIR)deflate.c
216
+ -@mkdir objs 2>/dev/null || test -d objs
217
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
218
+ -@mv objs/deflate.o $@
219
+
220
+infback.lo: $(SRCDIR)infback.c
221
+ -@mkdir objs 2>/dev/null || test -d objs
222
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/infback.o $(SRCDIR)infback.c
223
+ -@mv objs/infback.o $@
224
+
225
+inffast.lo: $(SRCDIR)inffast.c
226
+ -@mkdir objs 2>/dev/null || test -d objs
227
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
228
+ -@mv objs/inffast.o $@
229
+
230
+inflate.lo: $(SRCDIR)inflate.c
231
+ -@mkdir objs 2>/dev/null || test -d objs
232
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
233
+ -@mv objs/inflate.o $@
234
+
235
+inftrees.lo: $(SRCDIR)inftrees.c
236
+ -@mkdir objs 2>/dev/null || test -d objs
237
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
238
+ -@mv objs/inftrees.o $@
239
+
240
+trees.lo: $(SRCDIR)trees.c
241
+ -@mkdir objs 2>/dev/null || test -d objs
242
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/trees.o $(SRCDIR)trees.c
243
+ -@mv objs/trees.o $@
244
+
245
+zutil.lo: $(SRCDIR)zutil.c
246
+ -@mkdir objs 2>/dev/null || test -d objs
247
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
248
+ -@mv objs/zutil.o $@
249
+
250
+compress.lo: $(SRCDIR)compress.c
251
+ -@mkdir objs 2>/dev/null || test -d objs
252
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/compress.o $(SRCDIR)compress.c
253
+ -@mv objs/compress.o $@
254
+
255
+uncompr.lo: $(SRCDIR)uncompr.c
256
+ -@mkdir objs 2>/dev/null || test -d objs
257
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
258
+ -@mv objs/uncompr.o $@
259
+
260
+gzclose.lo: $(SRCDIR)gzclose.c
261
+ -@mkdir objs 2>/dev/null || test -d objs
262
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
263
+ -@mv objs/gzclose.o $@
264
+
265
+gzlib.lo: $(SRCDIR)gzlib.c
266
+ -@mkdir objs 2>/dev/null || test -d objs
267
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
268
+ -@mv objs/gzlib.o $@
269
+
270
+gzread.lo: $(SRCDIR)gzread.c
271
+ -@mkdir objs 2>/dev/null || test -d objs
272
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
273
+ -@mv objs/gzread.o $@
274
+
275
+gzwrite.lo: $(SRCDIR)gzwrite.c
276
+ -@mkdir objs 2>/dev/null || test -d objs
277
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
278
+ -@mv objs/gzwrite.o $@
279
+
280
+
281
+placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
282
+ $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
283
+ rm -f $(SHAREDLIB) $(SHAREDLIBM)
284
+ ln -s $@ $(SHAREDLIB)
285
+ ln -s $@ $(SHAREDLIBM)
286
+ -@rmdir objs
287
+
288
+example$(EXE): example.o $(STATICLIB)
289
+ $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
290
+
291
+minigzip$(EXE): minigzip.o $(STATICLIB)
292
+ $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
293
+
294
+examplesh$(EXE): example.o $(SHAREDLIBV)
295
+ $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
296
+
297
+minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
298
+ $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
299
+
300
+example64$(EXE): example64.o $(STATICLIB)
301
+ $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
302
+
303
+minigzip64$(EXE): minigzip64.o $(STATICLIB)
304
+ $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
305
+
306
+install-libs: $(LIBS)
307
+ -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
308
+ -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
309
+ -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
310
+ -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
311
+ -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
312
+ rm -f $(DESTDIR)$(libdir)/$(STATICLIB)
313
+ cp $(STATICLIB) $(DESTDIR)$(libdir)
314
+ chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
315
+ -@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
316
+ -@if test -n "$(SHAREDLIBV)"; then \
317
+ rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
318
+ cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
319
+ echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
320
+ chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
321
+ echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
322
+ rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
323
+ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
324
+ ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
325
+ ($(LDCONFIG) || true) >/dev/null 2>&1; \
326
+ fi
327
+ rm -f $(DESTDIR)$(man3dir)/zlib.3
328
+ cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
329
+ chmod 644 $(DESTDIR)$(man3dir)/zlib.3
330
+ rm -f $(DESTDIR)$(pkgconfigdir)/zlib.pc
331
+ cp zlib.pc $(DESTDIR)$(pkgconfigdir)
332
+ chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
333
+# The ranlib in install is needed on NeXTSTEP which checks file times
334
+# ldconfig is for Linux
335
+
336
+install: install-libs
337
+ -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
338
+ rm -f $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
339
+ cp $(SRCDIR)zlib.h zconf.h $(DESTDIR)$(includedir)
340
+ chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
341
+
342
+uninstall:
343
+ cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
344
+ cd $(DESTDIR)$(libdir) && rm -f libz.a; \
345
+ if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
346
+ rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
347
+ fi
348
+ cd $(DESTDIR)$(man3dir) && rm -f zlib.3
349
+ cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
350
+
351
+docs: zlib.3.pdf
352
+
353
+zlib.3.pdf: $(SRCDIR)zlib.3
354
+ groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@
355
+
356
+zconf.h.cmakein: $(SRCDIR)zconf.h.in
357
+ -@ TEMPFILE=zconfh_$$; \
358
+ echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
359
+ sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
360
+ touch -r $(SRCDIR)zconf.h.in $@ &&\
361
+ rm $$TEMPFILE
362
+
363
+zconf: $(SRCDIR)zconf.h.in
364
+ cp -p $(SRCDIR)zconf.h.in zconf.h
365
+
366
+mostlyclean: clean
367
+clean:
368
+ rm -f *.o *.lo *~ \
369
+ example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
370
+ example64$(EXE) minigzip64$(EXE) \
371
+ infcover \
372
+ libz.* foo.gz so_locations \
373
+ _match.s maketree contrib/infback9/*.o
374
+ rm -rf objs
375
+ rm -f *.gcda *.gcno *.gcov
376
+ rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
377
+
378
+maintainer-clean: distclean
379
+distclean: clean zconf zconf.h.cmakein
380
+ rm -f Makefile zlib.pc configure.log
381
+ -@rm -f .DS_Store
382
+ @if [ -f Makefile.in ]; then \
383
+ printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
384
+ printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
385
+ touch -r $(SRCDIR)Makefile.in Makefile ; fi
386
+
387
+tags:
388
+ etags $(SRCDIR)*.[ch]
389
+
390
+adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
391
+gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
392
+compress.o example.o minigzip.o uncompr.o: $(SRCDIR)zlib.h zconf.h
393
+crc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
394
+deflate.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
395
+infback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
396
+inffast.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
397
+inftrees.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
398
+trees.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
3399
4
-distclean:
5
- make -f Makefile.in distclean
400
+adler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
401
+gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
402
+compress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)zlib.h zconf.h
403
+crc32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
404
+deflate.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
405
+infback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
406
+inffast.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
407
+inftrees.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
408
+trees.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
6409
--- compat/zlib/Makefile
+++ compat/zlib/Makefile
@@ -1,5 +1,408 @@
1 all:
2 -@echo "Please use ./configure first. Thank you."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
4 distclean:
5 make -f Makefile.in distclean
 
 
 
 
 
 
 
6
--- compat/zlib/Makefile
+++ compat/zlib/Makefile
@@ -1,5 +1,408 @@
1 # Makefile for zlib
2 # Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
3 # For conditions of distribution and use, see copyright notice in zlib.h
4
5 # To compile and test, type:
6 # ./configure; make test
7 # Normally configure builds both a static and a shared library.
8 # If you want to build just a static library, use: ./configure --static
9
10 # To use the asm code, type:
11 # cp contrib/asm?86/match.S ./match.S
12 # make LOC=-DASMV OBJA=match.o
13
14 # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
15 # make install
16 # To install in $HOME instead of /usr/local, use:
17 # make install prefix=$HOME
18
19 CC=gcc
20
21 CFLAGS=-O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN
22 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
23 #CFLAGS=-g -DZLIB_DEBUG
24 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
25 # -Wstrict-prototypes -Wmissing-prototypes
26
27 SFLAGS=-O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN
28 LDFLAGS=
29 TEST_LDFLAGS=-L. libz.a
30 LDSHARED=gcc
31 CPP=gcc -E
32
33 STATICLIB=libz.a
34 SHAREDLIB=
35 SHAREDLIBV=
36 SHAREDLIBM=
37 LIBS=$(STATICLIB) $(SHAREDLIBV)
38
39 AR=ar
40 ARFLAGS=rc
41 RANLIB=ranlib
42 LDCONFIG=ldconfig
43 LDSHAREDLIBC=-lc
44 TAR=tar
45 SHELL=/bin/sh
46 EXE=
47
48 prefix =/usr/local
49 exec_prefix =${prefix}
50 libdir =${exec_prefix}/lib
51 sharedlibdir =${libdir}
52 includedir =${prefix}/include
53 mandir =${prefix}/share/man
54 man3dir = ${mandir}/man3
55 pkgconfigdir = ${libdir}/pkgconfig
56 SRCDIR=
57 ZINC=
58 ZINCOUT=-I.
59
60 OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
61 OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
62 OBJC = $(OBJZ) $(OBJG)
63
64 PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
65 PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
66 PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
67
68 # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
69 OBJA =
70 PIC_OBJA =
71
72 OBJS = $(OBJC) $(OBJA)
73
74 PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
75
76 all: static all64
77
78 static: example$(EXE) minigzip$(EXE)
79
80 shared: examplesh$(EXE) minigzipsh$(EXE)
81
82 all64: example64$(EXE) minigzip64$(EXE)
83
84 check: test
85
86 test: all teststatic test64
87
88 teststatic: static
89 @TMPST=tmpst_$$; \
90 if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
91 echo ' *** zlib test OK ***'; \
92 else \
93 echo ' *** zlib test FAILED ***'; false; \
94 fi
95 @rm -f tmpst_$$
96
97 testshared: shared
98 @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
99 LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
100 DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
101 SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
102 TMPSH=tmpsh_$$; \
103 if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
104 echo ' *** zlib shared test OK ***'; \
105 else \
106 echo ' *** zlib shared test FAILED ***'; false; \
107 fi
108 @rm -f tmpsh_$$
109
110 test64: all64
111 @TMP64=tmp64_$$; \
112 if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
113 echo ' *** zlib 64-bit test OK ***'; \
114 else \
115 echo ' *** zlib 64-bit test FAILED ***'; false; \
116 fi
117 @rm -f tmp64_$$
118
119 infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
120 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
121
122 infcover: infcover.o libz.a
123 $(CC) $(CFLAGS) -o $@ infcover.o libz.a
124
125 cover: infcover
126 rm -f *.gcda
127 ./infcover
128 gcov inf*.c
129
130 libz.a: $(OBJS)
131 $(AR) $(ARFLAGS) $@ $(OBJS)
132 -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
133
134 match.o: match.S
135 $(CPP) match.S > _match.s
136 $(CC) -c _match.s
137 mv _match.o match.o
138 rm -f _match.s
139
140 match.lo: match.S
141 $(CPP) match.S > _match.s
142 $(CC) -c -fPIC _match.s
143 mv _match.o match.lo
144 rm -f _match.s
145
146 example.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
147 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/example.c
148
149 minigzip.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
150 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/minigzip.c
151
152 example64.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
153 $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/example.c
154
155 minigzip64.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
156 $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/minigzip.c
157
158
159 adler32.o: $(SRCDIR)adler32.c
160 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)adler32.c
161
162 crc32.o: $(SRCDIR)crc32.c
163 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
164
165 deflate.o: $(SRCDIR)deflate.c
166 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
167
168 infback.o: $(SRCDIR)infback.c
169 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
170
171 inffast.o: $(SRCDIR)inffast.c
172 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inffast.c
173
174 inflate.o: $(SRCDIR)inflate.c
175 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inflate.c
176
177 inftrees.o: $(SRCDIR)inftrees.c
178 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inftrees.c
179
180 trees.o: $(SRCDIR)trees.c
181 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)trees.c
182
183 zutil.o: $(SRCDIR)zutil.c
184 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)zutil.c
185
186 compress.o: $(SRCDIR)compress.c
187 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)compress.c
188
189 uncompr.o: $(SRCDIR)uncompr.c
190 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)uncompr.c
191
192 gzclose.o: $(SRCDIR)gzclose.c
193 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzclose.c
194
195 gzlib.o: $(SRCDIR)gzlib.c
196 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzlib.c
197
198 gzread.o: $(SRCDIR)gzread.c
199 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzread.c
200
201 gzwrite.o: $(SRCDIR)gzwrite.c
202 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
203
204
205 adler32.lo: $(SRCDIR)adler32.c
206 -@mkdir objs 2>/dev/null || test -d objs
207 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
208 -@mv objs/adler32.o $@
209
210 crc32.lo: $(SRCDIR)crc32.c
211 -@mkdir objs 2>/dev/null || test -d objs
212 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
213 -@mv objs/crc32.o $@
214
215 deflate.lo: $(SRCDIR)deflate.c
216 -@mkdir objs 2>/dev/null || test -d objs
217 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
218 -@mv objs/deflate.o $@
219
220 infback.lo: $(SRCDIR)infback.c
221 -@mkdir objs 2>/dev/null || test -d objs
222 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/infback.o $(SRCDIR)infback.c
223 -@mv objs/infback.o $@
224
225 inffast.lo: $(SRCDIR)inffast.c
226 -@mkdir objs 2>/dev/null || test -d objs
227 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
228 -@mv objs/inffast.o $@
229
230 inflate.lo: $(SRCDIR)inflate.c
231 -@mkdir objs 2>/dev/null || test -d objs
232 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
233 -@mv objs/inflate.o $@
234
235 inftrees.lo: $(SRCDIR)inftrees.c
236 -@mkdir objs 2>/dev/null || test -d objs
237 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
238 -@mv objs/inftrees.o $@
239
240 trees.lo: $(SRCDIR)trees.c
241 -@mkdir objs 2>/dev/null || test -d objs
242 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/trees.o $(SRCDIR)trees.c
243 -@mv objs/trees.o $@
244
245 zutil.lo: $(SRCDIR)zutil.c
246 -@mkdir objs 2>/dev/null || test -d objs
247 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
248 -@mv objs/zutil.o $@
249
250 compress.lo: $(SRCDIR)compress.c
251 -@mkdir objs 2>/dev/null || test -d objs
252 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/compress.o $(SRCDIR)compress.c
253 -@mv objs/compress.o $@
254
255 uncompr.lo: $(SRCDIR)uncompr.c
256 -@mkdir objs 2>/dev/null || test -d objs
257 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
258 -@mv objs/uncompr.o $@
259
260 gzclose.lo: $(SRCDIR)gzclose.c
261 -@mkdir objs 2>/dev/null || test -d objs
262 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
263 -@mv objs/gzclose.o $@
264
265 gzlib.lo: $(SRCDIR)gzlib.c
266 -@mkdir objs 2>/dev/null || test -d objs
267 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
268 -@mv objs/gzlib.o $@
269
270 gzread.lo: $(SRCDIR)gzread.c
271 -@mkdir objs 2>/dev/null || test -d objs
272 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
273 -@mv objs/gzread.o $@
274
275 gzwrite.lo: $(SRCDIR)gzwrite.c
276 -@mkdir objs 2>/dev/null || test -d objs
277 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
278 -@mv objs/gzwrite.o $@
279
280
281 placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
282 $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
283 rm -f $(SHAREDLIB) $(SHAREDLIBM)
284 ln -s $@ $(SHAREDLIB)
285 ln -s $@ $(SHAREDLIBM)
286 -@rmdir objs
287
288 example$(EXE): example.o $(STATICLIB)
289 $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
290
291 minigzip$(EXE): minigzip.o $(STATICLIB)
292 $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
293
294 examplesh$(EXE): example.o $(SHAREDLIBV)
295 $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
296
297 minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
298 $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
299
300 example64$(EXE): example64.o $(STATICLIB)
301 $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
302
303 minigzip64$(EXE): minigzip64.o $(STATICLIB)
304 $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
305
306 install-libs: $(LIBS)
307 -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
308 -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
309 -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
310 -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
311 -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
312 rm -f $(DESTDIR)$(libdir)/$(STATICLIB)
313 cp $(STATICLIB) $(DESTDIR)$(libdir)
314 chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
315 -@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
316 -@if test -n "$(SHAREDLIBV)"; then \
317 rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
318 cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
319 echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
320 chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
321 echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
322 rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
323 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
324 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
325 ($(LDCONFIG) || true) >/dev/null 2>&1; \
326 fi
327 rm -f $(DESTDIR)$(man3dir)/zlib.3
328 cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
329 chmod 644 $(DESTDIR)$(man3dir)/zlib.3
330 rm -f $(DESTDIR)$(pkgconfigdir)/zlib.pc
331 cp zlib.pc $(DESTDIR)$(pkgconfigdir)
332 chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
333 # The ranlib in install is needed on NeXTSTEP which checks file times
334 # ldconfig is for Linux
335
336 install: install-libs
337 -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
338 rm -f $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
339 cp $(SRCDIR)zlib.h zconf.h $(DESTDIR)$(includedir)
340 chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
341
342 uninstall:
343 cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
344 cd $(DESTDIR)$(libdir) && rm -f libz.a; \
345 if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
346 rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
347 fi
348 cd $(DESTDIR)$(man3dir) && rm -f zlib.3
349 cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
350
351 docs: zlib.3.pdf
352
353 zlib.3.pdf: $(SRCDIR)zlib.3
354 groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@
355
356 zconf.h.cmakein: $(SRCDIR)zconf.h.in
357 -@ TEMPFILE=zconfh_$$; \
358 echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
359 sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
360 touch -r $(SRCDIR)zconf.h.in $@ &&\
361 rm $$TEMPFILE
362
363 zconf: $(SRCDIR)zconf.h.in
364 cp -p $(SRCDIR)zconf.h.in zconf.h
365
366 mostlyclean: clean
367 clean:
368 rm -f *.o *.lo *~ \
369 example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
370 example64$(EXE) minigzip64$(EXE) \
371 infcover \
372 libz.* foo.gz so_locations \
373 _match.s maketree contrib/infback9/*.o
374 rm -rf objs
375 rm -f *.gcda *.gcno *.gcov
376 rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
377
378 maintainer-clean: distclean
379 distclean: clean zconf zconf.h.cmakein
380 rm -f Makefile zlib.pc configure.log
381 -@rm -f .DS_Store
382 @if [ -f Makefile.in ]; then \
383 printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
384 printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
385 touch -r $(SRCDIR)Makefile.in Makefile ; fi
386
387 tags:
388 etags $(SRCDIR)*.[ch]
389
390 adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
391 gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
392 compress.o example.o minigzip.o uncompr.o: $(SRCDIR)zlib.h zconf.h
393 crc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
394 deflate.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
395 infback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
396 inffast.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
397 inftrees.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
398 trees.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
399
400 adler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
401 gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
402 compress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)zlib.h zconf.h
403 crc32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
404 deflate.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
405 infback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
406 inffast.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
407 inftrees.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
408 trees.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
409
--- compat/zlib/Makefile.in
+++ compat/zlib/Makefile.in
@@ -30,11 +30,11 @@
3030
LDSHARED=$(CC)
3131
CPP=$(CC) -E
3232
3333
STATICLIB=libz.a
3434
SHAREDLIB=libz.so
35
-SHAREDLIBV=libz.so.1.2.11
35
+SHAREDLIBV=libz.so.1.2.12
3636
SHAREDLIBM=libz.so.1
3737
LIBS=$(STATICLIB) $(SHAREDLIBV)
3838
3939
AR=ar
4040
ARFLAGS=rc
@@ -89,12 +89,12 @@
8989
@TMPST=tmpst_$$; \
9090
if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
9191
echo ' *** zlib test OK ***'; \
9292
else \
9393
echo ' *** zlib test FAILED ***'; false; \
94
- fi; \
95
- rm -f $$TMPST
94
+ fi
95
+ @rm -f tmpst_$$
9696
9797
testshared: shared
9898
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
9999
LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
100100
DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
@@ -102,21 +102,21 @@
102102
TMPSH=tmpsh_$$; \
103103
if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
104104
echo ' *** zlib shared test OK ***'; \
105105
else \
106106
echo ' *** zlib shared test FAILED ***'; false; \
107
- fi; \
108
- rm -f $$TMPSH
107
+ fi
108
+ @rm -f tmpsh_$$
109109
110110
test64: all64
111111
@TMP64=tmp64_$$; \
112112
if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
113113
echo ' *** zlib 64-bit test OK ***'; \
114114
else \
115115
echo ' *** zlib 64-bit test FAILED ***'; false; \
116
- fi; \
117
- rm -f $$TMP64
116
+ fi
117
+ @rm -f tmp64_$$
118118
119119
infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
120120
$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
121121
122122
infcover: infcover.o libz.a
@@ -202,81 +202,81 @@
202202
$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
203203
204204
205205
adler32.lo: $(SRCDIR)adler32.c
206206
-@mkdir objs 2>/dev/null || test -d objs
207
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
207
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
208208
-@mv objs/adler32.o $@
209209
210210
crc32.lo: $(SRCDIR)crc32.c
211211
-@mkdir objs 2>/dev/null || test -d objs
212
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
212
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
213213
-@mv objs/crc32.o $@
214214
215215
deflate.lo: $(SRCDIR)deflate.c
216216
-@mkdir objs 2>/dev/null || test -d objs
217
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
217
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
218218
-@mv objs/deflate.o $@
219219
220220
infback.lo: $(SRCDIR)infback.c
221221
-@mkdir objs 2>/dev/null || test -d objs
222
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
222
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/infback.o $(SRCDIR)infback.c
223223
-@mv objs/infback.o $@
224224
225225
inffast.lo: $(SRCDIR)inffast.c
226226
-@mkdir objs 2>/dev/null || test -d objs
227
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
227
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
228228
-@mv objs/inffast.o $@
229229
230230
inflate.lo: $(SRCDIR)inflate.c
231231
-@mkdir objs 2>/dev/null || test -d objs
232
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
232
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
233233
-@mv objs/inflate.o $@
234234
235235
inftrees.lo: $(SRCDIR)inftrees.c
236236
-@mkdir objs 2>/dev/null || test -d objs
237
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
237
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
238238
-@mv objs/inftrees.o $@
239239
240240
trees.lo: $(SRCDIR)trees.c
241241
-@mkdir objs 2>/dev/null || test -d objs
242
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
242
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/trees.o $(SRCDIR)trees.c
243243
-@mv objs/trees.o $@
244244
245245
zutil.lo: $(SRCDIR)zutil.c
246246
-@mkdir objs 2>/dev/null || test -d objs
247
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
247
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
248248
-@mv objs/zutil.o $@
249249
250250
compress.lo: $(SRCDIR)compress.c
251251
-@mkdir objs 2>/dev/null || test -d objs
252
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/compress.o $(SRCDIR)compress.c
252
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/compress.o $(SRCDIR)compress.c
253253
-@mv objs/compress.o $@
254254
255255
uncompr.lo: $(SRCDIR)uncompr.c
256256
-@mkdir objs 2>/dev/null || test -d objs
257
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
257
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
258258
-@mv objs/uncompr.o $@
259259
260260
gzclose.lo: $(SRCDIR)gzclose.c
261261
-@mkdir objs 2>/dev/null || test -d objs
262
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
262
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
263263
-@mv objs/gzclose.o $@
264264
265265
gzlib.lo: $(SRCDIR)gzlib.c
266266
-@mkdir objs 2>/dev/null || test -d objs
267
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
267
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
268268
-@mv objs/gzlib.o $@
269269
270270
gzread.lo: $(SRCDIR)gzread.c
271271
-@mkdir objs 2>/dev/null || test -d objs
272
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
272
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
273273
-@mv objs/gzread.o $@
274274
275275
gzwrite.lo: $(SRCDIR)gzwrite.c
276276
-@mkdir objs 2>/dev/null || test -d objs
277
- $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
277
+ $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
278278
-@mv objs/gzwrite.o $@
279279
280280
281281
placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
282282
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
@@ -374,19 +374,17 @@
374374
rm -rf objs
375375
rm -f *.gcda *.gcno *.gcov
376376
rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
377377
378378
maintainer-clean: distclean
379
-distclean: clean zconf zconf.h.cmakein docs
379
+distclean: clean zconf zconf.h.cmakein
380380
rm -f Makefile zlib.pc configure.log
381381
-@rm -f .DS_Store
382382
@if [ -f Makefile.in ]; then \
383383
printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
384384
printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
385385
touch -r $(SRCDIR)Makefile.in Makefile ; fi
386
- @if [ ! -f zconf.h.in ]; then rm -f zconf.h zconf.h.cmakein ; fi
387
- @if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf ; fi
388386
389387
tags:
390388
etags $(SRCDIR)*.[ch]
391389
392390
adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
393391
--- compat/zlib/Makefile.in
+++ compat/zlib/Makefile.in
@@ -30,11 +30,11 @@
30 LDSHARED=$(CC)
31 CPP=$(CC) -E
32
33 STATICLIB=libz.a
34 SHAREDLIB=libz.so
35 SHAREDLIBV=libz.so.1.2.11
36 SHAREDLIBM=libz.so.1
37 LIBS=$(STATICLIB) $(SHAREDLIBV)
38
39 AR=ar
40 ARFLAGS=rc
@@ -89,12 +89,12 @@
89 @TMPST=tmpst_$$; \
90 if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
91 echo ' *** zlib test OK ***'; \
92 else \
93 echo ' *** zlib test FAILED ***'; false; \
94 fi; \
95 rm -f $$TMPST
96
97 testshared: shared
98 @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
99 LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
100 DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
@@ -102,21 +102,21 @@
102 TMPSH=tmpsh_$$; \
103 if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
104 echo ' *** zlib shared test OK ***'; \
105 else \
106 echo ' *** zlib shared test FAILED ***'; false; \
107 fi; \
108 rm -f $$TMPSH
109
110 test64: all64
111 @TMP64=tmp64_$$; \
112 if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
113 echo ' *** zlib 64-bit test OK ***'; \
114 else \
115 echo ' *** zlib 64-bit test FAILED ***'; false; \
116 fi; \
117 rm -f $$TMP64
118
119 infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
120 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
121
122 infcover: infcover.o libz.a
@@ -202,81 +202,81 @@
202 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
203
204
205 adler32.lo: $(SRCDIR)adler32.c
206 -@mkdir objs 2>/dev/null || test -d objs
207 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
208 -@mv objs/adler32.o $@
209
210 crc32.lo: $(SRCDIR)crc32.c
211 -@mkdir objs 2>/dev/null || test -d objs
212 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
213 -@mv objs/crc32.o $@
214
215 deflate.lo: $(SRCDIR)deflate.c
216 -@mkdir objs 2>/dev/null || test -d objs
217 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
218 -@mv objs/deflate.o $@
219
220 infback.lo: $(SRCDIR)infback.c
221 -@mkdir objs 2>/dev/null || test -d objs
222 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
223 -@mv objs/infback.o $@
224
225 inffast.lo: $(SRCDIR)inffast.c
226 -@mkdir objs 2>/dev/null || test -d objs
227 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
228 -@mv objs/inffast.o $@
229
230 inflate.lo: $(SRCDIR)inflate.c
231 -@mkdir objs 2>/dev/null || test -d objs
232 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
233 -@mv objs/inflate.o $@
234
235 inftrees.lo: $(SRCDIR)inftrees.c
236 -@mkdir objs 2>/dev/null || test -d objs
237 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
238 -@mv objs/inftrees.o $@
239
240 trees.lo: $(SRCDIR)trees.c
241 -@mkdir objs 2>/dev/null || test -d objs
242 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
243 -@mv objs/trees.o $@
244
245 zutil.lo: $(SRCDIR)zutil.c
246 -@mkdir objs 2>/dev/null || test -d objs
247 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
248 -@mv objs/zutil.o $@
249
250 compress.lo: $(SRCDIR)compress.c
251 -@mkdir objs 2>/dev/null || test -d objs
252 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/compress.o $(SRCDIR)compress.c
253 -@mv objs/compress.o $@
254
255 uncompr.lo: $(SRCDIR)uncompr.c
256 -@mkdir objs 2>/dev/null || test -d objs
257 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
258 -@mv objs/uncompr.o $@
259
260 gzclose.lo: $(SRCDIR)gzclose.c
261 -@mkdir objs 2>/dev/null || test -d objs
262 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
263 -@mv objs/gzclose.o $@
264
265 gzlib.lo: $(SRCDIR)gzlib.c
266 -@mkdir objs 2>/dev/null || test -d objs
267 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
268 -@mv objs/gzlib.o $@
269
270 gzread.lo: $(SRCDIR)gzread.c
271 -@mkdir objs 2>/dev/null || test -d objs
272 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
273 -@mv objs/gzread.o $@
274
275 gzwrite.lo: $(SRCDIR)gzwrite.c
276 -@mkdir objs 2>/dev/null || test -d objs
277 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
278 -@mv objs/gzwrite.o $@
279
280
281 placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
282 $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
@@ -374,19 +374,17 @@
374 rm -rf objs
375 rm -f *.gcda *.gcno *.gcov
376 rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
377
378 maintainer-clean: distclean
379 distclean: clean zconf zconf.h.cmakein docs
380 rm -f Makefile zlib.pc configure.log
381 -@rm -f .DS_Store
382 @if [ -f Makefile.in ]; then \
383 printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
384 printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
385 touch -r $(SRCDIR)Makefile.in Makefile ; fi
386 @if [ ! -f zconf.h.in ]; then rm -f zconf.h zconf.h.cmakein ; fi
387 @if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf ; fi
388
389 tags:
390 etags $(SRCDIR)*.[ch]
391
392 adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
393
--- compat/zlib/Makefile.in
+++ compat/zlib/Makefile.in
@@ -30,11 +30,11 @@
30 LDSHARED=$(CC)
31 CPP=$(CC) -E
32
33 STATICLIB=libz.a
34 SHAREDLIB=libz.so
35 SHAREDLIBV=libz.so.1.2.12
36 SHAREDLIBM=libz.so.1
37 LIBS=$(STATICLIB) $(SHAREDLIBV)
38
39 AR=ar
40 ARFLAGS=rc
@@ -89,12 +89,12 @@
89 @TMPST=tmpst_$$; \
90 if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
91 echo ' *** zlib test OK ***'; \
92 else \
93 echo ' *** zlib test FAILED ***'; false; \
94 fi
95 @rm -f tmpst_$$
96
97 testshared: shared
98 @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
99 LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
100 DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
@@ -102,21 +102,21 @@
102 TMPSH=tmpsh_$$; \
103 if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
104 echo ' *** zlib shared test OK ***'; \
105 else \
106 echo ' *** zlib shared test FAILED ***'; false; \
107 fi
108 @rm -f tmpsh_$$
109
110 test64: all64
111 @TMP64=tmp64_$$; \
112 if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
113 echo ' *** zlib 64-bit test OK ***'; \
114 else \
115 echo ' *** zlib 64-bit test FAILED ***'; false; \
116 fi
117 @rm -f tmp64_$$
118
119 infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
120 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
121
122 infcover: infcover.o libz.a
@@ -202,81 +202,81 @@
202 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
203
204
205 adler32.lo: $(SRCDIR)adler32.c
206 -@mkdir objs 2>/dev/null || test -d objs
207 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
208 -@mv objs/adler32.o $@
209
210 crc32.lo: $(SRCDIR)crc32.c
211 -@mkdir objs 2>/dev/null || test -d objs
212 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
213 -@mv objs/crc32.o $@
214
215 deflate.lo: $(SRCDIR)deflate.c
216 -@mkdir objs 2>/dev/null || test -d objs
217 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
218 -@mv objs/deflate.o $@
219
220 infback.lo: $(SRCDIR)infback.c
221 -@mkdir objs 2>/dev/null || test -d objs
222 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/infback.o $(SRCDIR)infback.c
223 -@mv objs/infback.o $@
224
225 inffast.lo: $(SRCDIR)inffast.c
226 -@mkdir objs 2>/dev/null || test -d objs
227 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
228 -@mv objs/inffast.o $@
229
230 inflate.lo: $(SRCDIR)inflate.c
231 -@mkdir objs 2>/dev/null || test -d objs
232 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
233 -@mv objs/inflate.o $@
234
235 inftrees.lo: $(SRCDIR)inftrees.c
236 -@mkdir objs 2>/dev/null || test -d objs
237 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
238 -@mv objs/inftrees.o $@
239
240 trees.lo: $(SRCDIR)trees.c
241 -@mkdir objs 2>/dev/null || test -d objs
242 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/trees.o $(SRCDIR)trees.c
243 -@mv objs/trees.o $@
244
245 zutil.lo: $(SRCDIR)zutil.c
246 -@mkdir objs 2>/dev/null || test -d objs
247 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
248 -@mv objs/zutil.o $@
249
250 compress.lo: $(SRCDIR)compress.c
251 -@mkdir objs 2>/dev/null || test -d objs
252 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/compress.o $(SRCDIR)compress.c
253 -@mv objs/compress.o $@
254
255 uncompr.lo: $(SRCDIR)uncompr.c
256 -@mkdir objs 2>/dev/null || test -d objs
257 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
258 -@mv objs/uncompr.o $@
259
260 gzclose.lo: $(SRCDIR)gzclose.c
261 -@mkdir objs 2>/dev/null || test -d objs
262 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
263 -@mv objs/gzclose.o $@
264
265 gzlib.lo: $(SRCDIR)gzlib.c
266 -@mkdir objs 2>/dev/null || test -d objs
267 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
268 -@mv objs/gzlib.o $@
269
270 gzread.lo: $(SRCDIR)gzread.c
271 -@mkdir objs 2>/dev/null || test -d objs
272 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
273 -@mv objs/gzread.o $@
274
275 gzwrite.lo: $(SRCDIR)gzwrite.c
276 -@mkdir objs 2>/dev/null || test -d objs
277 $(CC) $(SFLAGS) $(ZINC) -fPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
278 -@mv objs/gzwrite.o $@
279
280
281 placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
282 $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
@@ -374,19 +374,17 @@
374 rm -rf objs
375 rm -f *.gcda *.gcno *.gcov
376 rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
377
378 maintainer-clean: distclean
379 distclean: clean zconf zconf.h.cmakein
380 rm -f Makefile zlib.pc configure.log
381 -@rm -f .DS_Store
382 @if [ -f Makefile.in ]; then \
383 printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
384 printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
385 touch -r $(SRCDIR)Makefile.in Makefile ; fi
 
 
386
387 tags:
388 etags $(SRCDIR)*.[ch]
389
390 adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
391
--- compat/zlib/README
+++ compat/zlib/README
@@ -1,8 +1,8 @@
11
ZLIB DATA COMPRESSION LIBRARY
22
3
-zlib 1.2.11 is a general purpose data compression library. All the code is
3
+zlib 1.2.12 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
77
rfc1952 (gzip format).
88
@@ -29,11 +29,11 @@
2929
3030
Mark Nelson <[email protected]> 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.11 are documented in the file ChangeLog.
34
+The changes made in version 1.2.12 are documented in the file ChangeLog.
3535
3636
Unsupported third party contributions are provided in directory contrib/ .
3737
3838
zlib is available in Java using the java.util.zip package, documented at
3939
http://java.sun.com/developer/technicalArticles/Programming/compression/ .
@@ -82,11 +82,11 @@
8282
people who reported problems and suggested various improvements in zlib; they
8383
are too numerous to cite here.
8484
8585
Copyright notice:
8686
87
- (C) 1995-2017 Jean-loup Gailly and Mark Adler
87
+ (C) 1995-2022 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
9191
arising from the use of this software.
9292
@@ -106,10 +106,13 @@
106106
[email protected] [email protected]
107107
108108
If you use the zlib library in a product, we would appreciate *not* receiving
109109
lengthy legal documents to sign. The sources are provided for free but without
110110
warranty of any kind. The library has been entirely written by Jean-loup
111
-Gailly and Mark Adler; it does not include third-party code.
111
+Gailly and Mark Adler; it does not include third-party code. We make all
112
+contributions to and distributions of this project solely in our personal
113
+capacity, and are not conveying any rights to any intellectual property of
114
+any third parties.
112115
113116
If you redistribute modified sources, we would appreciate that you include in
114117
the file ChangeLog history information documenting your changes. Please read
115118
the FAQ for more information on the distribution of modified source versions.
116119
--- compat/zlib/README
+++ compat/zlib/README
@@ -1,8 +1,8 @@
1 ZLIB DATA COMPRESSION LIBRARY
2
3 zlib 1.2.11 is a general purpose data compression library. All the code is
4 thread safe. The data format used by the zlib library is described by RFCs
5 (Request for Comments) 1950 to 1952 in the files
6 http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
7 rfc1952 (gzip format).
8
@@ -29,11 +29,11 @@
29
30 Mark Nelson <[email protected]> wrote an article about zlib for the Jan. 1997
31 issue of Dr. Dobb's Journal; a copy of the article is available at
32 http://marknelson.us/1997/01/01/zlib-engine/ .
33
34 The changes made in version 1.2.11 are documented in the file ChangeLog.
35
36 Unsupported third party contributions are provided in directory contrib/ .
37
38 zlib is available in Java using the java.util.zip package, documented at
39 http://java.sun.com/developer/technicalArticles/Programming/compression/ .
@@ -82,11 +82,11 @@
82 people who reported problems and suggested various improvements in zlib; they
83 are too numerous to cite here.
84
85 Copyright notice:
86
87 (C) 1995-2017 Jean-loup Gailly and Mark Adler
88
89 This software is provided 'as-is', without any express or implied
90 warranty. In no event will the authors be held liable for any damages
91 arising from the use of this software.
92
@@ -106,10 +106,13 @@
106 [email protected] [email protected]
107
108 If you use the zlib library in a product, we would appreciate *not* receiving
109 lengthy legal documents to sign. The sources are provided for free but without
110 warranty of any kind. The library has been entirely written by Jean-loup
111 Gailly and Mark Adler; it does not include third-party code.
 
 
 
112
113 If you redistribute modified sources, we would appreciate that you include in
114 the file ChangeLog history information documenting your changes. Please read
115 the FAQ for more information on the distribution of modified source versions.
116
--- compat/zlib/README
+++ compat/zlib/README
@@ -1,8 +1,8 @@
1 ZLIB DATA COMPRESSION LIBRARY
2
3 zlib 1.2.12 is a general purpose data compression library. All the code is
4 thread safe. The data format used by the zlib library is described by RFCs
5 (Request for Comments) 1950 to 1952 in the files
6 http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
7 rfc1952 (gzip format).
8
@@ -29,11 +29,11 @@
29
30 Mark Nelson <[email protected]> wrote an article about zlib for the Jan. 1997
31 issue of Dr. Dobb's Journal; a copy of the article is available at
32 http://marknelson.us/1997/01/01/zlib-engine/ .
33
34 The changes made in version 1.2.12 are documented in the file ChangeLog.
35
36 Unsupported third party contributions are provided in directory contrib/ .
37
38 zlib is available in Java using the java.util.zip package, documented at
39 http://java.sun.com/developer/technicalArticles/Programming/compression/ .
@@ -82,11 +82,11 @@
82 people who reported problems and suggested various improvements in zlib; they
83 are too numerous to cite here.
84
85 Copyright notice:
86
87 (C) 1995-2022 Jean-loup Gailly and Mark Adler
88
89 This software is provided 'as-is', without any express or implied
90 warranty. In no event will the authors be held liable for any damages
91 arising from the use of this software.
92
@@ -106,10 +106,13 @@
106 [email protected] [email protected]
107
108 If you use the zlib library in a product, we would appreciate *not* receiving
109 lengthy legal documents to sign. The sources are provided for free but without
110 warranty of any kind. The library has been entirely written by Jean-loup
111 Gailly and Mark Adler; it does not include third-party code. We make all
112 contributions to and distributions of this project solely in our personal
113 capacity, and are not conveying any rights to any intellectual property of
114 any third parties.
115
116 If you redistribute modified sources, we would appreciate that you include in
117 the file ChangeLog history information documenting your changes. Please read
118 the FAQ for more information on the distribution of modified source versions.
119
--- compat/zlib/configure
+++ compat/zlib/configure
@@ -85,10 +85,11 @@
8585
zconst=0
8686
build64=0
8787
gcc=0
8888
warn=0
8989
debug=0
90
+sanitize=0
9091
old_cc="$CC"
9192
old_cflags="$CFLAGS"
9293
OBJC='$(OBJZ) $(OBJG)'
9394
PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
9495
@@ -135,10 +136,11 @@
135136
--sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
136137
--localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
137138
-c* | --const) zconst=1; shift ;;
138139
-w* | --warn) warn=1; shift ;;
139140
-d* | --debug) debug=1; shift ;;
141
+ --sanitize) sanitize=1; shift ;;
140142
*)
141143
echo "unknown option: $1" | tee -a configure.log
142144
echo "$0 --help for help" | tee -a configure.log
143145
leave 1;;
144146
esac
@@ -163,12 +165,18 @@
163165
cat > $test.c <<EOF
164166
extern int getchar();
165167
int hello() {return getchar();}
166168
EOF
167169
168
-test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
169
-cc=${CC-${CROSS_PREFIX}gcc}
170
+if test -z "$CC"; then
171
+ echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
172
+ if ${CROSS_PREFIX}gcc -v >/dev/null 2>&1; then
173
+ cc=${CROSS_PREFIX}gcc
174
+ else
175
+ cc=${CROSS_PREFIX}cc
176
+ fi
177
+fi
170178
cflags=${CFLAGS-"-O3"}
171179
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
172180
case "$cc" in
173181
*gcc*) gcc=1 ;;
174182
*clang*) gcc=1 ;;
@@ -197,10 +205,13 @@
197205
CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
198206
else
199207
CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
200208
fi
201209
fi
210
+ if test $sanitize -eq 1; then
211
+ CFLAGS="${CFLAGS} -fsanitize=address"
212
+ fi
202213
if test $debug -eq 1; then
203214
CFLAGS="${CFLAGS} -DZLIB_DEBUG"
204215
SFLAGS="${SFLAGS} -DZLIB_DEBUG"
205216
fi
206217
if test -z "$uname"; then
@@ -365,12 +376,15 @@
365376
echo - using any output from compiler to indicate an error >> configure.log
366377
else
367378
try()
368379
{
369380
show $*
370
- ( $* ) >> configure.log 2>&1
381
+ got=`( $* ) 2>&1`
371382
ret=$?
383
+ if test "$got" != ""; then
384
+ printf "%s\n" "$got" >> configure.log
385
+ fi
372386
if test $ret -ne 0; then
373387
echo "(exit code "$ret")" >> configure.log
374388
fi
375389
return $ret
376390
}
@@ -379,12 +393,15 @@
379393
tryboth()
380394
{
381395
show $*
382396
got=`( $* ) 2>&1`
383397
ret=$?
384
- printf %s "$got" >> configure.log
398
+ if test "$got" != ""; then
399
+ printf "%s\n" "$got" >> configure.log
400
+ fi
385401
if test $ret -ne 0; then
402
+ echo "(exit code "$ret")" >> configure.log
386403
return $ret
387404
fi
388405
test "$got" = ""
389406
}
390407
@@ -455,21 +472,15 @@
455472
#include <stdlib.h>
456473
size_t dummy = 0;
457474
EOF
458475
if try $CC -c $CFLAGS $test.c; then
459476
echo "Checking for size_t... Yes." | tee -a configure.log
460
- need_sizet=0
461477
else
462478
echo "Checking for size_t... No." | tee -a configure.log
463
- need_sizet=1
464
-fi
465
-
466
-echo >> configure.log
467
-
468
-# find the size_t integer type, if needed
469
-if test $need_sizet -eq 1; then
470
- cat > $test.c <<EOF
479
+ # find a size_t integer type
480
+ # check for long long
481
+ cat > $test.c << EOF
471482
long long dummy = 0;
472483
EOF
473484
if try $CC -c $CFLAGS $test.c; then
474485
echo "Checking for long long... Yes." | tee -a configure.log
475486
cat > $test.c <<EOF
@@ -493,19 +504,15 @@
493504
EOF
494505
fi
495506
if try $CC $CFLAGS -o $test $test.c; then
496507
sizet=`./$test`
497508
echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
509
+ CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
510
+ SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
498511
else
499
- echo "Failed to find a pointer-size integer type." | tee -a configure.log
500
- leave 1
501
- fi
502
-fi
503
-
504
-if test $need_sizet -eq 1; then
505
- CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
506
- SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
512
+ echo "Checking for a pointer-size integer type... not found." | tee -a configure.log
513
+ fi
507514
fi
508515
509516
echo >> configure.log
510517
511518
# check for large file support, and if none, check for fseeko()
@@ -847,11 +854,10 @@
847854
echo SHAREDLIBM = $SHAREDLIBM >> configure.log
848855
echo SHAREDLIBV = $SHAREDLIBV >> configure.log
849856
echo STATICLIB = $STATICLIB >> configure.log
850857
echo TEST = $TEST >> configure.log
851858
echo VER = $VER >> configure.log
852
-echo Z_U4 = $Z_U4 >> configure.log
853859
echo SRCDIR = $SRCDIR >> configure.log
854860
echo exec_prefix = $exec_prefix >> configure.log
855861
echo includedir = $includedir >> configure.log
856862
echo libdir = $libdir >> configure.log
857863
echo mandir = $mandir >> configure.log
858864
--- compat/zlib/configure
+++ compat/zlib/configure
@@ -85,10 +85,11 @@
85 zconst=0
86 build64=0
87 gcc=0
88 warn=0
89 debug=0
 
90 old_cc="$CC"
91 old_cflags="$CFLAGS"
92 OBJC='$(OBJZ) $(OBJG)'
93 PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
94
@@ -135,10 +136,11 @@
135 --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
136 --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
137 -c* | --const) zconst=1; shift ;;
138 -w* | --warn) warn=1; shift ;;
139 -d* | --debug) debug=1; shift ;;
 
140 *)
141 echo "unknown option: $1" | tee -a configure.log
142 echo "$0 --help for help" | tee -a configure.log
143 leave 1;;
144 esac
@@ -163,12 +165,18 @@
163 cat > $test.c <<EOF
164 extern int getchar();
165 int hello() {return getchar();}
166 EOF
167
168 test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
169 cc=${CC-${CROSS_PREFIX}gcc}
 
 
 
 
 
 
170 cflags=${CFLAGS-"-O3"}
171 # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
172 case "$cc" in
173 *gcc*) gcc=1 ;;
174 *clang*) gcc=1 ;;
@@ -197,10 +205,13 @@
197 CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
198 else
199 CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
200 fi
201 fi
 
 
 
202 if test $debug -eq 1; then
203 CFLAGS="${CFLAGS} -DZLIB_DEBUG"
204 SFLAGS="${SFLAGS} -DZLIB_DEBUG"
205 fi
206 if test -z "$uname"; then
@@ -365,12 +376,15 @@
365 echo - using any output from compiler to indicate an error >> configure.log
366 else
367 try()
368 {
369 show $*
370 ( $* ) >> configure.log 2>&1
371 ret=$?
 
 
 
372 if test $ret -ne 0; then
373 echo "(exit code "$ret")" >> configure.log
374 fi
375 return $ret
376 }
@@ -379,12 +393,15 @@
379 tryboth()
380 {
381 show $*
382 got=`( $* ) 2>&1`
383 ret=$?
384 printf %s "$got" >> configure.log
 
 
385 if test $ret -ne 0; then
 
386 return $ret
387 fi
388 test "$got" = ""
389 }
390
@@ -455,21 +472,15 @@
455 #include <stdlib.h>
456 size_t dummy = 0;
457 EOF
458 if try $CC -c $CFLAGS $test.c; then
459 echo "Checking for size_t... Yes." | tee -a configure.log
460 need_sizet=0
461 else
462 echo "Checking for size_t... No." | tee -a configure.log
463 need_sizet=1
464 fi
465
466 echo >> configure.log
467
468 # find the size_t integer type, if needed
469 if test $need_sizet -eq 1; then
470 cat > $test.c <<EOF
471 long long dummy = 0;
472 EOF
473 if try $CC -c $CFLAGS $test.c; then
474 echo "Checking for long long... Yes." | tee -a configure.log
475 cat > $test.c <<EOF
@@ -493,19 +504,15 @@
493 EOF
494 fi
495 if try $CC $CFLAGS -o $test $test.c; then
496 sizet=`./$test`
497 echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
 
 
498 else
499 echo "Failed to find a pointer-size integer type." | tee -a configure.log
500 leave 1
501 fi
502 fi
503
504 if test $need_sizet -eq 1; then
505 CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
506 SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
507 fi
508
509 echo >> configure.log
510
511 # check for large file support, and if none, check for fseeko()
@@ -847,11 +854,10 @@
847 echo SHAREDLIBM = $SHAREDLIBM >> configure.log
848 echo SHAREDLIBV = $SHAREDLIBV >> configure.log
849 echo STATICLIB = $STATICLIB >> configure.log
850 echo TEST = $TEST >> configure.log
851 echo VER = $VER >> configure.log
852 echo Z_U4 = $Z_U4 >> configure.log
853 echo SRCDIR = $SRCDIR >> configure.log
854 echo exec_prefix = $exec_prefix >> configure.log
855 echo includedir = $includedir >> configure.log
856 echo libdir = $libdir >> configure.log
857 echo mandir = $mandir >> configure.log
858
--- compat/zlib/configure
+++ compat/zlib/configure
@@ -85,10 +85,11 @@
85 zconst=0
86 build64=0
87 gcc=0
88 warn=0
89 debug=0
90 sanitize=0
91 old_cc="$CC"
92 old_cflags="$CFLAGS"
93 OBJC='$(OBJZ) $(OBJG)'
94 PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
95
@@ -135,10 +136,11 @@
136 --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
137 --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
138 -c* | --const) zconst=1; shift ;;
139 -w* | --warn) warn=1; shift ;;
140 -d* | --debug) debug=1; shift ;;
141 --sanitize) sanitize=1; shift ;;
142 *)
143 echo "unknown option: $1" | tee -a configure.log
144 echo "$0 --help for help" | tee -a configure.log
145 leave 1;;
146 esac
@@ -163,12 +165,18 @@
165 cat > $test.c <<EOF
166 extern int getchar();
167 int hello() {return getchar();}
168 EOF
169
170 if test -z "$CC"; then
171 echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
172 if ${CROSS_PREFIX}gcc -v >/dev/null 2>&1; then
173 cc=${CROSS_PREFIX}gcc
174 else
175 cc=${CROSS_PREFIX}cc
176 fi
177 fi
178 cflags=${CFLAGS-"-O3"}
179 # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
180 case "$cc" in
181 *gcc*) gcc=1 ;;
182 *clang*) gcc=1 ;;
@@ -197,10 +205,13 @@
205 CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
206 else
207 CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
208 fi
209 fi
210 if test $sanitize -eq 1; then
211 CFLAGS="${CFLAGS} -fsanitize=address"
212 fi
213 if test $debug -eq 1; then
214 CFLAGS="${CFLAGS} -DZLIB_DEBUG"
215 SFLAGS="${SFLAGS} -DZLIB_DEBUG"
216 fi
217 if test -z "$uname"; then
@@ -365,12 +376,15 @@
376 echo - using any output from compiler to indicate an error >> configure.log
377 else
378 try()
379 {
380 show $*
381 got=`( $* ) 2>&1`
382 ret=$?
383 if test "$got" != ""; then
384 printf "%s\n" "$got" >> configure.log
385 fi
386 if test $ret -ne 0; then
387 echo "(exit code "$ret")" >> configure.log
388 fi
389 return $ret
390 }
@@ -379,12 +393,15 @@
393 tryboth()
394 {
395 show $*
396 got=`( $* ) 2>&1`
397 ret=$?
398 if test "$got" != ""; then
399 printf "%s\n" "$got" >> configure.log
400 fi
401 if test $ret -ne 0; then
402 echo "(exit code "$ret")" >> configure.log
403 return $ret
404 fi
405 test "$got" = ""
406 }
407
@@ -455,21 +472,15 @@
472 #include <stdlib.h>
473 size_t dummy = 0;
474 EOF
475 if try $CC -c $CFLAGS $test.c; then
476 echo "Checking for size_t... Yes." | tee -a configure.log
 
477 else
478 echo "Checking for size_t... No." | tee -a configure.log
479 # find a size_t integer type
480 # check for long long
481 cat > $test.c << EOF
 
 
 
 
 
482 long long dummy = 0;
483 EOF
484 if try $CC -c $CFLAGS $test.c; then
485 echo "Checking for long long... Yes." | tee -a configure.log
486 cat > $test.c <<EOF
@@ -493,19 +504,15 @@
504 EOF
505 fi
506 if try $CC $CFLAGS -o $test $test.c; then
507 sizet=`./$test`
508 echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
509 CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
510 SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
511 else
512 echo "Checking for a pointer-size integer type... not found." | tee -a configure.log
513 fi
 
 
 
 
 
 
514 fi
515
516 echo >> configure.log
517
518 # check for large file support, and if none, check for fseeko()
@@ -847,11 +854,10 @@
854 echo SHAREDLIBM = $SHAREDLIBM >> configure.log
855 echo SHAREDLIBV = $SHAREDLIBV >> configure.log
856 echo STATICLIB = $STATICLIB >> configure.log
857 echo TEST = $TEST >> configure.log
858 echo VER = $VER >> configure.log
 
859 echo SRCDIR = $SRCDIR >> configure.log
860 echo exec_prefix = $exec_prefix >> configure.log
861 echo includedir = $includedir >> configure.log
862 echo libdir = $libdir >> configure.log
863 echo mandir = $mandir >> configure.log
864
--- compat/zlib/contrib/README.contrib
+++ compat/zlib/contrib/README.contrib
@@ -6,18 +6,10 @@
66
77
ada/ by Dmitriy Anisimkov <[email protected]>
88
Support for Ada
99
See http://zlib-ada.sourceforge.net/
1010
11
-amd64/ by Mikhail Teterin <[email protected]>
12
- asm code for AMD64
13
- See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393
14
-
15
-asm686/ by Brian Raiter <[email protected]>
16
- asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
17
- See http://www.muppetlabs.com/~breadbox/software/assembly.html
18
-
1911
blast/ by Mark Adler <[email protected]>
2012
Decompressor for output of PKWare Data Compression Library (DCL)
2113
2214
delphi/ by Cosmin Truta <[email protected]>
2315
Support for Delphi and C++ Builder
@@ -30,13 +22,10 @@
3022
assembler to replace longest_match() and inflate_fast()
3123
3224
infback9/ by Mark Adler <[email protected]>
3325
Unsupported diffs to infback to decode the deflate64 format
3426
35
-inflate86/ by Chris Anderson <[email protected]>
36
- Tuned x86 gcc asm code to replace inflate_fast()
37
-
3827
iostream/ by Kevin Ruland <[email protected]>
3928
A C++ I/O streams interface to the zlib gz* functions
4029
4130
iostream2/ by Tyge Løvset <[email protected]>
4231
Another C++ I/O streams interface
@@ -43,20 +32,10 @@
4332
4433
iostream3/ by Ludwig Schwardt <[email protected]>
4534
and Kevin Ruland <[email protected]>
4635
Yet another C++ I/O streams interface
4736
48
-masmx64/ by Gilles Vollant <[email protected]>
49
- x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
50
- replace longest_match() and inflate_fast(), also masm x86
51
- 64-bits translation of Chris Anderson inflate_fast()
52
-
53
-masmx86/ by Gilles Vollant <[email protected]>
54
- x86 asm code to replace longest_match() and inflate_fast(),
55
- for Visual C++ and MASM (32 bits).
56
- Based on Brian Raiter (asm686) and Chris Anderson (inflate86)
57
-
5837
minizip/ by Gilles Vollant <[email protected]>
5938
Mini zip and unzip based on zlib
6039
Includes Zip64 support by Mathias Svensson <[email protected]>
6140
See http://www.winimage.com/zLibDll/minizip.html
6241
6342
--- compat/zlib/contrib/README.contrib
+++ compat/zlib/contrib/README.contrib
@@ -6,18 +6,10 @@
6
7 ada/ by Dmitriy Anisimkov <[email protected]>
8 Support for Ada
9 See http://zlib-ada.sourceforge.net/
10
11 amd64/ by Mikhail Teterin <[email protected]>
12 asm code for AMD64
13 See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393
14
15 asm686/ by Brian Raiter <[email protected]>
16 asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax
17 See http://www.muppetlabs.com/~breadbox/software/assembly.html
18
19 blast/ by Mark Adler <[email protected]>
20 Decompressor for output of PKWare Data Compression Library (DCL)
21
22 delphi/ by Cosmin Truta <[email protected]>
23 Support for Delphi and C++ Builder
@@ -30,13 +22,10 @@
30 assembler to replace longest_match() and inflate_fast()
31
32 infback9/ by Mark Adler <[email protected]>
33 Unsupported diffs to infback to decode the deflate64 format
34
35 inflate86/ by Chris Anderson <[email protected]>
36 Tuned x86 gcc asm code to replace inflate_fast()
37
38 iostream/ by Kevin Ruland <[email protected]>
39 A C++ I/O streams interface to the zlib gz* functions
40
41 iostream2/ by Tyge Løvset <[email protected]>
42 Another C++ I/O streams interface
@@ -43,20 +32,10 @@
43
44 iostream3/ by Ludwig Schwardt <[email protected]>
45 and Kevin Ruland <[email protected]>
46 Yet another C++ I/O streams interface
47
48 masmx64/ by Gilles Vollant <[email protected]>
49 x86 64-bit (AMD64 and Intel EM64t) code for x64 assembler to
50 replace longest_match() and inflate_fast(), also masm x86
51 64-bits translation of Chris Anderson inflate_fast()
52
53 masmx86/ by Gilles Vollant <[email protected]>
54 x86 asm code to replace longest_match() and inflate_fast(),
55 for Visual C++ and MASM (32 bits).
56 Based on Brian Raiter (asm686) and Chris Anderson (inflate86)
57
58 minizip/ by Gilles Vollant <[email protected]>
59 Mini zip and unzip based on zlib
60 Includes Zip64 support by Mathias Svensson <[email protected]>
61 See http://www.winimage.com/zLibDll/minizip.html
62
63
--- compat/zlib/contrib/README.contrib
+++ compat/zlib/contrib/README.contrib
@@ -6,18 +6,10 @@
6
7 ada/ by Dmitriy Anisimkov <[email protected]>
8 Support for Ada
9 See http://zlib-ada.sourceforge.net/
10
 
 
 
 
 
 
 
 
11 blast/ by Mark Adler <[email protected]>
12 Decompressor for output of PKWare Data Compression Library (DCL)
13
14 delphi/ by Cosmin Truta <[email protected]>
15 Support for Delphi and C++ Builder
@@ -30,13 +22,10 @@
22 assembler to replace longest_match() and inflate_fast()
23
24 infback9/ by Mark Adler <[email protected]>
25 Unsupported diffs to infback to decode the deflate64 format
26
 
 
 
27 iostream/ by Kevin Ruland <[email protected]>
28 A C++ I/O streams interface to the zlib gz* functions
29
30 iostream2/ by Tyge Løvset <[email protected]>
31 Another C++ I/O streams interface
@@ -43,20 +32,10 @@
32
33 iostream3/ by Ludwig Schwardt <[email protected]>
34 and Kevin Ruland <[email protected]>
35 Yet another C++ I/O streams interface
36
 
 
 
 
 
 
 
 
 
 
37 minizip/ by Gilles Vollant <[email protected]>
38 Mini zip and unzip based on zlib
39 Includes Zip64 support by Mathias Svensson <[email protected]>
40 See http://www.winimage.com/zLibDll/minizip.html
41
42
--- compat/zlib/contrib/blast/blast.h
+++ compat/zlib/contrib/blast/blast.h
@@ -55,11 +55,11 @@
5555
* available bytes there. If infun() returns zero, then blast() returns with
5656
* an input error. (blast() only asks for input if it needs it.) inhow is for
5757
* use by the application to pass an input descriptor to infun(), if desired.
5858
*
5959
* If left and in are not NULL and *left is not zero when blast() is called,
60
- * then the *left bytes are *in are consumed for input before infun() is used.
60
+ * then the *left bytes at *in are consumed for input before infun() is used.
6161
*
6262
* The output function is invoked: err = outfun(how, buf, len), where the bytes
6363
* to be written are buf[0..len-1]. If err is not zero, then blast() returns
6464
* with an output error. outfun() is always called with len <= 4096. outhow
6565
* is for use by the application to pass an output descriptor to outfun(), if
6666
--- compat/zlib/contrib/blast/blast.h
+++ compat/zlib/contrib/blast/blast.h
@@ -55,11 +55,11 @@
55 * available bytes there. If infun() returns zero, then blast() returns with
56 * an input error. (blast() only asks for input if it needs it.) inhow is for
57 * use by the application to pass an input descriptor to infun(), if desired.
58 *
59 * If left and in are not NULL and *left is not zero when blast() is called,
60 * then the *left bytes are *in are consumed for input before infun() is used.
61 *
62 * The output function is invoked: err = outfun(how, buf, len), where the bytes
63 * to be written are buf[0..len-1]. If err is not zero, then blast() returns
64 * with an output error. outfun() is always called with len <= 4096. outhow
65 * is for use by the application to pass an output descriptor to outfun(), if
66
--- compat/zlib/contrib/blast/blast.h
+++ compat/zlib/contrib/blast/blast.h
@@ -55,11 +55,11 @@
55 * available bytes there. If infun() returns zero, then blast() returns with
56 * an input error. (blast() only asks for input if it needs it.) inhow is for
57 * use by the application to pass an input descriptor to infun(), if desired.
58 *
59 * If left and in are not NULL and *left is not zero when blast() is called,
60 * then the *left bytes at *in are consumed for input before infun() is used.
61 *
62 * The output function is invoked: err = outfun(how, buf, len), where the bytes
63 * to be written are buf[0..len-1]. If err is not zero, then blast() returns
64 * with an output error. outfun() is always called with len <= 4096. outhow
65 * is for use by the application to pass an output descriptor to outfun(), if
66
--- compat/zlib/contrib/delphi/ZLib.pas
+++ compat/zlib/contrib/delphi/ZLib.pas
@@ -150,11 +150,11 @@
150150
BufSize = number of bytes in OutBuf }
151151
procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
152152
const OutBuf: Pointer; BufSize: Integer);
153153
154154
const
155
- zlib_version = '1.2.11';
155
+ zlib_version = '1.2.12';
156156
157157
type
158158
EZlibError = class(Exception);
159159
ECompressionError = class(EZlibError);
160160
EDecompressionError = class(EZlibError);
161161
--- compat/zlib/contrib/delphi/ZLib.pas
+++ compat/zlib/contrib/delphi/ZLib.pas
@@ -150,11 +150,11 @@
150 BufSize = number of bytes in OutBuf }
151 procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
152 const OutBuf: Pointer; BufSize: Integer);
153
154 const
155 zlib_version = '1.2.11';
156
157 type
158 EZlibError = class(Exception);
159 ECompressionError = class(EZlibError);
160 EDecompressionError = class(EZlibError);
161
--- compat/zlib/contrib/delphi/ZLib.pas
+++ compat/zlib/contrib/delphi/ZLib.pas
@@ -150,11 +150,11 @@
150 BufSize = number of bytes in OutBuf }
151 procedure DecompressToUserBuf(const InBuf: Pointer; InBytes: Integer;
152 const OutBuf: Pointer; BufSize: Integer);
153
154 const
155 zlib_version = '1.2.12';
156
157 type
158 EZlibError = class(Exception);
159 ECompressionError = class(EZlibError);
160 EDecompressionError = class(EZlibError);
161
--- compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
+++ compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
@@ -154,11 +154,11 @@
154154
#region Info tests
155155
[Test]
156156
public void Info_Version()
157157
{
158158
Info info = new Info();
159
- Assert.AreEqual("1.2.11", Info.Version);
159
+ Assert.AreEqual("1.2.12", Info.Version);
160160
Assert.AreEqual(32, info.SizeOfUInt);
161161
Assert.AreEqual(32, info.SizeOfULong);
162162
Assert.AreEqual(32, info.SizeOfPointer);
163163
Assert.AreEqual(32, info.SizeOfOffset);
164164
}
165165
--- compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
+++ compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
@@ -154,11 +154,11 @@
154 #region Info tests
155 [Test]
156 public void Info_Version()
157 {
158 Info info = new Info();
159 Assert.AreEqual("1.2.11", Info.Version);
160 Assert.AreEqual(32, info.SizeOfUInt);
161 Assert.AreEqual(32, info.SizeOfULong);
162 Assert.AreEqual(32, info.SizeOfPointer);
163 Assert.AreEqual(32, info.SizeOfOffset);
164 }
165
--- compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
+++ compat/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
@@ -154,11 +154,11 @@
154 #region Info tests
155 [Test]
156 public void Info_Version()
157 {
158 Info info = new Info();
159 Assert.AreEqual("1.2.12", Info.Version);
160 Assert.AreEqual(32, info.SizeOfUInt);
161 Assert.AreEqual(32, info.SizeOfULong);
162 Assert.AreEqual(32, info.SizeOfPointer);
163 Assert.AreEqual(32, info.SizeOfOffset);
164 }
165
--- compat/zlib/contrib/infback9/inftree9.c
+++ compat/zlib/contrib/infback9/inftree9.c
@@ -1,17 +1,17 @@
11
/* inftree9.c -- generate Huffman trees for efficient decoding
2
- * Copyright (C) 1995-2017 Mark Adler
2
+ * Copyright (C) 1995-2022 Mark Adler
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*/
55
66
#include "zutil.h"
77
#include "inftree9.h"
88
99
#define MAXBITS 15
1010
1111
const char inflate9_copyright[] =
12
- " inflate9 1.2.11 Copyright 1995-2017 Mark Adler ";
12
+ " inflate9 1.2.12 Copyright 1995-2022 Mark Adler ";
1313
/*
1414
If you use the zlib library in a product, an acknowledgment is welcome
1515
in the documentation of your product. If for some reason you cannot
1616
include such an acknowledgment, I would appreciate that you keep this
1717
copyright string in the executable of your product.
@@ -62,11 +62,11 @@
6262
19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115,
6363
131, 163, 195, 227, 3, 0, 0};
6464
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
6565
128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
6666
130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
67
- 133, 133, 133, 133, 144, 77, 202};
67
+ 133, 133, 133, 133, 144, 199, 202};
6868
static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
6969
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
7070
65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
7171
4097, 6145, 8193, 12289, 16385, 24577, 32769, 49153};
7272
static const unsigned short dext[32] = { /* Distance codes 0..31 extra */
7373
--- compat/zlib/contrib/infback9/inftree9.c
+++ compat/zlib/contrib/infback9/inftree9.c
@@ -1,17 +1,17 @@
1 /* inftree9.c -- generate Huffman trees for efficient decoding
2 * Copyright (C) 1995-2017 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6 #include "zutil.h"
7 #include "inftree9.h"
8
9 #define MAXBITS 15
10
11 const char inflate9_copyright[] =
12 " inflate9 1.2.11 Copyright 1995-2017 Mark Adler ";
13 /*
14 If you use the zlib library in a product, an acknowledgment is welcome
15 in the documentation of your product. If for some reason you cannot
16 include such an acknowledgment, I would appreciate that you keep this
17 copyright string in the executable of your product.
@@ -62,11 +62,11 @@
62 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115,
63 131, 163, 195, 227, 3, 0, 0};
64 static const unsigned short lext[31] = { /* Length codes 257..285 extra */
65 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
66 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
67 133, 133, 133, 133, 144, 77, 202};
68 static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
69 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
70 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
71 4097, 6145, 8193, 12289, 16385, 24577, 32769, 49153};
72 static const unsigned short dext[32] = { /* Distance codes 0..31 extra */
73
--- compat/zlib/contrib/infback9/inftree9.c
+++ compat/zlib/contrib/infback9/inftree9.c
@@ -1,17 +1,17 @@
1 /* inftree9.c -- generate Huffman trees for efficient decoding
2 * Copyright (C) 1995-2022 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6 #include "zutil.h"
7 #include "inftree9.h"
8
9 #define MAXBITS 15
10
11 const char inflate9_copyright[] =
12 " inflate9 1.2.12 Copyright 1995-2022 Mark Adler ";
13 /*
14 If you use the zlib library in a product, an acknowledgment is welcome
15 in the documentation of your product. If for some reason you cannot
16 include such an acknowledgment, I would appreciate that you keep this
17 copyright string in the executable of your product.
@@ -62,11 +62,11 @@
62 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115,
63 131, 163, 195, 227, 3, 0, 0};
64 static const unsigned short lext[31] = { /* Length codes 257..285 extra */
65 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
66 130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
67 133, 133, 133, 133, 144, 199, 202};
68 static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
69 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
70 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
71 4097, 6145, 8193, 12289, 16385, 24577, 32769, 49153};
72 static const unsigned short dext[32] = { /* Distance codes 0..31 extra */
73
--- compat/zlib/contrib/minizip/Makefile
+++ compat/zlib/contrib/minizip/Makefile
@@ -1,7 +1,7 @@
11
CC=cc
2
-CFLAGS=-O -I../..
2
+CFLAGS := $(CFLAGS) -O -I../..
33
44
UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
55
ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a
66
77
.c.o:
@@ -14,12 +14,16 @@
1414
1515
minizip: $(ZIP_OBJS)
1616
$(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
1717
1818
test: miniunz minizip
19
- ./minizip test readme.txt
19
+ @rm -f test.*
20
+ @echo hello hello hello > test.txt
21
+ ./minizip test test.txt
2022
./miniunz -l test.zip
21
- mv readme.txt readme.old
23
+ @mv test.txt test.old
2224
./miniunz test.zip
25
+ @cmp test.txt test.old
26
+ @rm -f test.*
2327
2428
clean:
25
- /bin/rm -f *.o *~ minizip miniunz
29
+ /bin/rm -f *.o *~ minizip miniunz test.*
2630
--- compat/zlib/contrib/minizip/Makefile
+++ compat/zlib/contrib/minizip/Makefile
@@ -1,7 +1,7 @@
1 CC=cc
2 CFLAGS=-O -I../..
3
4 UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
5 ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a
6
7 .c.o:
@@ -14,12 +14,16 @@
14
15 minizip: $(ZIP_OBJS)
16 $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
17
18 test: miniunz minizip
19 ./minizip test readme.txt
 
 
20 ./miniunz -l test.zip
21 mv readme.txt readme.old
22 ./miniunz test.zip
 
 
23
24 clean:
25 /bin/rm -f *.o *~ minizip miniunz
26
--- compat/zlib/contrib/minizip/Makefile
+++ compat/zlib/contrib/minizip/Makefile
@@ -1,7 +1,7 @@
1 CC=cc
2 CFLAGS := $(CFLAGS) -O -I../..
3
4 UNZ_OBJS = miniunz.o unzip.o ioapi.o ../../libz.a
5 ZIP_OBJS = minizip.o zip.o ioapi.o ../../libz.a
6
7 .c.o:
@@ -14,12 +14,16 @@
14
15 minizip: $(ZIP_OBJS)
16 $(CC) $(CFLAGS) -o $@ $(ZIP_OBJS)
17
18 test: miniunz minizip
19 @rm -f test.*
20 @echo hello hello hello > test.txt
21 ./minizip test test.txt
22 ./miniunz -l test.zip
23 @mv test.txt test.old
24 ./miniunz test.zip
25 @cmp test.txt test.old
26 @rm -f test.*
27
28 clean:
29 /bin/rm -f *.o *~ minizip miniunz test.*
30
--- compat/zlib/contrib/minizip/configure.ac
+++ compat/zlib/contrib/minizip/configure.ac
@@ -1,9 +1,9 @@
11
# -*- Autoconf -*-
22
# Process this file with autoconf to produce a configure script.
33
4
-AC_INIT([minizip], [1.2.11], [bugzilla.redhat.com])
4
+AC_INIT([minizip], [1.2.12], [bugzilla.redhat.com])
55
AC_CONFIG_SRCDIR([minizip.c])
66
AM_INIT_AUTOMAKE([foreign])
77
LT_INIT
88
99
AC_MSG_CHECKING([whether to build example programs])
1010
--- compat/zlib/contrib/minizip/configure.ac
+++ compat/zlib/contrib/minizip/configure.ac
@@ -1,9 +1,9 @@
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_INIT([minizip], [1.2.11], [bugzilla.redhat.com])
5 AC_CONFIG_SRCDIR([minizip.c])
6 AM_INIT_AUTOMAKE([foreign])
7 LT_INIT
8
9 AC_MSG_CHECKING([whether to build example programs])
10
--- compat/zlib/contrib/minizip/configure.ac
+++ compat/zlib/contrib/minizip/configure.ac
@@ -1,9 +1,9 @@
1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_INIT([minizip], [1.2.12], [bugzilla.redhat.com])
5 AC_CONFIG_SRCDIR([minizip.c])
6 AM_INIT_AUTOMAKE([foreign])
7 LT_INIT
8
9 AC_MSG_CHECKING([whether to build example programs])
10
--- compat/zlib/contrib/minizip/crypt.h
+++ compat/zlib/contrib/minizip/crypt.h
@@ -36,10 +36,11 @@
3636
{
3737
unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
3838
* unpredictable manner on 16-bit systems; not a problem
3939
* with any known compiler so far, though */
4040
41
+ (void)pcrc_32_tab;
4142
temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
4243
return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
4344
}
4445
4546
/***********************************************************************
@@ -75,28 +76,28 @@
7576
7677
#define zdecode(pkeys,pcrc_32_tab,c) \
7778
(update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
7879
7980
#define zencode(pkeys,pcrc_32_tab,c,t) \
80
- (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
81
+ (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), (Byte)t^(c))
8182
8283
#ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
8384
8485
#define RAND_HEAD_LEN 12
8586
/* "last resort" source for second part of crypt seed pattern */
8687
# ifndef ZCR_SEED2
87
-# define ZCR_SEED2 3141592654UL /* use PI as default pattern */
88
+# define ZCR_SEED2 3141592654L /* use PI as default pattern */
8889
# endif
8990
90
-static int crypthead(const char* passwd, /* password string */
91
- unsigned char* buf, /* where to write header */
92
- int bufSize,
93
- unsigned long* pkeys,
94
- const z_crc_t* pcrc_32_tab,
95
- unsigned long crcForCrypting)
96
-{
97
- int n; /* index in random header */
91
+static unsigned crypthead(const char* passwd, /* password string */
92
+ unsigned char* buf, /* where to write header */
93
+ int bufSize,
94
+ unsigned long* pkeys,
95
+ const z_crc_t* pcrc_32_tab,
96
+ unsigned long crcForCrypting)
97
+{
98
+ unsigned n; /* index in random header */
9899
int t; /* temporary */
99100
int c; /* random byte */
100101
unsigned char header[RAND_HEAD_LEN-2]; /* random header */
101102
static unsigned calls = 0; /* ensure different random header each time */
102103
103104
--- compat/zlib/contrib/minizip/crypt.h
+++ compat/zlib/contrib/minizip/crypt.h
@@ -36,10 +36,11 @@
36 {
37 unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
38 * unpredictable manner on 16-bit systems; not a problem
39 * with any known compiler so far, though */
40
 
41 temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
42 return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
43 }
44
45 /***********************************************************************
@@ -75,28 +76,28 @@
75
76 #define zdecode(pkeys,pcrc_32_tab,c) \
77 (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
78
79 #define zencode(pkeys,pcrc_32_tab,c,t) \
80 (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c))
81
82 #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
83
84 #define RAND_HEAD_LEN 12
85 /* "last resort" source for second part of crypt seed pattern */
86 # ifndef ZCR_SEED2
87 # define ZCR_SEED2 3141592654UL /* use PI as default pattern */
88 # endif
89
90 static int crypthead(const char* passwd, /* password string */
91 unsigned char* buf, /* where to write header */
92 int bufSize,
93 unsigned long* pkeys,
94 const z_crc_t* pcrc_32_tab,
95 unsigned long crcForCrypting)
96 {
97 int n; /* index in random header */
98 int t; /* temporary */
99 int c; /* random byte */
100 unsigned char header[RAND_HEAD_LEN-2]; /* random header */
101 static unsigned calls = 0; /* ensure different random header each time */
102
103
--- compat/zlib/contrib/minizip/crypt.h
+++ compat/zlib/contrib/minizip/crypt.h
@@ -36,10 +36,11 @@
36 {
37 unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an
38 * unpredictable manner on 16-bit systems; not a problem
39 * with any known compiler so far, though */
40
41 (void)pcrc_32_tab;
42 temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2;
43 return (int)(((temp * (temp ^ 1)) >> 8) & 0xff);
44 }
45
46 /***********************************************************************
@@ -75,28 +76,28 @@
76
77 #define zdecode(pkeys,pcrc_32_tab,c) \
78 (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab)))
79
80 #define zencode(pkeys,pcrc_32_tab,c,t) \
81 (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), (Byte)t^(c))
82
83 #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED
84
85 #define RAND_HEAD_LEN 12
86 /* "last resort" source for second part of crypt seed pattern */
87 # ifndef ZCR_SEED2
88 # define ZCR_SEED2 3141592654L /* use PI as default pattern */
89 # endif
90
91 static unsigned crypthead(const char* passwd, /* password string */
92 unsigned char* buf, /* where to write header */
93 int bufSize,
94 unsigned long* pkeys,
95 const z_crc_t* pcrc_32_tab,
96 unsigned long crcForCrypting)
97 {
98 unsigned n; /* index in random header */
99 int t; /* temporary */
100 int c; /* random byte */
101 unsigned char header[RAND_HEAD_LEN-2]; /* random header */
102 static unsigned calls = 0; /* ensure different random header each time */
103
104
--- compat/zlib/contrib/minizip/ioapi.c
+++ compat/zlib/contrib/minizip/ioapi.c
@@ -56,11 +56,11 @@
5656
{
5757
if (pfilefunc->zfile_func64.zseek64_file != NULL)
5858
return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
5959
else
6060
{
61
- uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
61
+ uLong tell_uLong = (uLong)(*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
6262
if ((tell_uLong) == MAXU32)
6363
return (ZPOS64_T)-1;
6464
else
6565
return tell_uLong;
6666
}
@@ -92,10 +92,11 @@
9292
static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
9393
static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
9494
9595
static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
9696
{
97
+ (void)opaque;
9798
FILE* file = NULL;
9899
const char* mode_fopen = NULL;
99100
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
100101
mode_fopen = "rb";
101102
else
@@ -110,10 +111,11 @@
110111
return file;
111112
}
112113
113114
static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
114115
{
116
+ (void)opaque;
115117
FILE* file = NULL;
116118
const char* mode_fopen = NULL;
117119
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
118120
mode_fopen = "rb";
119121
else
@@ -129,39 +131,44 @@
129131
}
130132
131133
132134
static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
133135
{
136
+ (void)opaque;
134137
uLong ret;
135138
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
136139
return ret;
137140
}
138141
139142
static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
140143
{
144
+ (void)opaque;
141145
uLong ret;
142146
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
143147
return ret;
144148
}
145149
146150
static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
147151
{
152
+ (void)opaque;
148153
long ret;
149154
ret = ftell((FILE *)stream);
150155
return ret;
151156
}
152157
153158
154159
static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
155160
{
161
+ (void)opaque;
156162
ZPOS64_T ret;
157
- ret = FTELLO_FUNC((FILE *)stream);
163
+ ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream);
158164
return ret;
159165
}
160166
161167
static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
162168
{
169
+ (void)opaque;
163170
int fseek_origin=0;
164171
long ret;
165172
switch (origin)
166173
{
167174
case ZLIB_FILEFUNC_SEEK_CUR :
@@ -174,17 +181,18 @@
174181
fseek_origin = SEEK_SET;
175182
break;
176183
default: return -1;
177184
}
178185
ret = 0;
179
- if (fseek((FILE *)stream, offset, fseek_origin) != 0)
186
+ if (fseek((FILE *)stream, (long)offset, fseek_origin) != 0)
180187
ret = -1;
181188
return ret;
182189
}
183190
184191
static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
185192
{
193
+ (void)opaque;
186194
int fseek_origin=0;
187195
long ret;
188196
switch (origin)
189197
{
190198
case ZLIB_FILEFUNC_SEEK_CUR :
@@ -198,26 +206,28 @@
198206
break;
199207
default: return -1;
200208
}
201209
ret = 0;
202210
203
- if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0)
211
+ if(FSEEKO_FUNC((FILE *)stream, (long)offset, fseek_origin) != 0)
204212
ret = -1;
205213
206214
return ret;
207215
}
208216
209217
210218
static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
211219
{
220
+ (void)opaque;
212221
int ret;
213222
ret = fclose((FILE *)stream);
214223
return ret;
215224
}
216225
217226
static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
218227
{
228
+ (void)opaque;
219229
int ret;
220230
ret = ferror((FILE *)stream);
221231
return ret;
222232
}
223233
224234
--- compat/zlib/contrib/minizip/ioapi.c
+++ compat/zlib/contrib/minizip/ioapi.c
@@ -56,11 +56,11 @@
56 {
57 if (pfilefunc->zfile_func64.zseek64_file != NULL)
58 return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
59 else
60 {
61 uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
62 if ((tell_uLong) == MAXU32)
63 return (ZPOS64_T)-1;
64 else
65 return tell_uLong;
66 }
@@ -92,10 +92,11 @@
92 static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
93 static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
94
95 static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
96 {
 
97 FILE* file = NULL;
98 const char* mode_fopen = NULL;
99 if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
100 mode_fopen = "rb";
101 else
@@ -110,10 +111,11 @@
110 return file;
111 }
112
113 static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
114 {
 
115 FILE* file = NULL;
116 const char* mode_fopen = NULL;
117 if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
118 mode_fopen = "rb";
119 else
@@ -129,39 +131,44 @@
129 }
130
131
132 static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
133 {
 
134 uLong ret;
135 ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
136 return ret;
137 }
138
139 static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
140 {
 
141 uLong ret;
142 ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
143 return ret;
144 }
145
146 static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
147 {
 
148 long ret;
149 ret = ftell((FILE *)stream);
150 return ret;
151 }
152
153
154 static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
155 {
 
156 ZPOS64_T ret;
157 ret = FTELLO_FUNC((FILE *)stream);
158 return ret;
159 }
160
161 static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
162 {
 
163 int fseek_origin=0;
164 long ret;
165 switch (origin)
166 {
167 case ZLIB_FILEFUNC_SEEK_CUR :
@@ -174,17 +181,18 @@
174 fseek_origin = SEEK_SET;
175 break;
176 default: return -1;
177 }
178 ret = 0;
179 if (fseek((FILE *)stream, offset, fseek_origin) != 0)
180 ret = -1;
181 return ret;
182 }
183
184 static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
185 {
 
186 int fseek_origin=0;
187 long ret;
188 switch (origin)
189 {
190 case ZLIB_FILEFUNC_SEEK_CUR :
@@ -198,26 +206,28 @@
198 break;
199 default: return -1;
200 }
201 ret = 0;
202
203 if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0)
204 ret = -1;
205
206 return ret;
207 }
208
209
210 static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
211 {
 
212 int ret;
213 ret = fclose((FILE *)stream);
214 return ret;
215 }
216
217 static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
218 {
 
219 int ret;
220 ret = ferror((FILE *)stream);
221 return ret;
222 }
223
224
--- compat/zlib/contrib/minizip/ioapi.c
+++ compat/zlib/contrib/minizip/ioapi.c
@@ -56,11 +56,11 @@
56 {
57 if (pfilefunc->zfile_func64.zseek64_file != NULL)
58 return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
59 else
60 {
61 uLong tell_uLong = (uLong)(*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
62 if ((tell_uLong) == MAXU32)
63 return (ZPOS64_T)-1;
64 else
65 return tell_uLong;
66 }
@@ -92,10 +92,11 @@
92 static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
93 static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
94
95 static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
96 {
97 (void)opaque;
98 FILE* file = NULL;
99 const char* mode_fopen = NULL;
100 if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
101 mode_fopen = "rb";
102 else
@@ -110,10 +111,11 @@
111 return file;
112 }
113
114 static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
115 {
116 (void)opaque;
117 FILE* file = NULL;
118 const char* mode_fopen = NULL;
119 if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
120 mode_fopen = "rb";
121 else
@@ -129,39 +131,44 @@
131 }
132
133
134 static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
135 {
136 (void)opaque;
137 uLong ret;
138 ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
139 return ret;
140 }
141
142 static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
143 {
144 (void)opaque;
145 uLong ret;
146 ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
147 return ret;
148 }
149
150 static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
151 {
152 (void)opaque;
153 long ret;
154 ret = ftell((FILE *)stream);
155 return ret;
156 }
157
158
159 static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
160 {
161 (void)opaque;
162 ZPOS64_T ret;
163 ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream);
164 return ret;
165 }
166
167 static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
168 {
169 (void)opaque;
170 int fseek_origin=0;
171 long ret;
172 switch (origin)
173 {
174 case ZLIB_FILEFUNC_SEEK_CUR :
@@ -174,17 +181,18 @@
181 fseek_origin = SEEK_SET;
182 break;
183 default: return -1;
184 }
185 ret = 0;
186 if (fseek((FILE *)stream, (long)offset, fseek_origin) != 0)
187 ret = -1;
188 return ret;
189 }
190
191 static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
192 {
193 (void)opaque;
194 int fseek_origin=0;
195 long ret;
196 switch (origin)
197 {
198 case ZLIB_FILEFUNC_SEEK_CUR :
@@ -198,26 +206,28 @@
206 break;
207 default: return -1;
208 }
209 ret = 0;
210
211 if(FSEEKO_FUNC((FILE *)stream, (long)offset, fseek_origin) != 0)
212 ret = -1;
213
214 return ret;
215 }
216
217
218 static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
219 {
220 (void)opaque;
221 int ret;
222 ret = fclose((FILE *)stream);
223 return ret;
224 }
225
226 static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
227 {
228 (void)opaque;
229 int ret;
230 ret = ferror((FILE *)stream);
231 return ret;
232 }
233
234
--- compat/zlib/contrib/minizip/ioapi.h
+++ compat/zlib/contrib/minizip/ioapi.h
@@ -89,22 +89,24 @@
8989
#ifdef HAS_STDINT_H
9090
#include "stdint.h"
9191
typedef uint64_t ZPOS64_T;
9292
#else
9393
94
-/* Maximum unsigned 32-bit value used as placeholder for zip64 */
95
-#define MAXU32 0xffffffff
94
+
9695
9796
#if defined(_MSC_VER) || defined(__BORLANDC__)
9897
typedef unsigned __int64 ZPOS64_T;
9998
#else
10099
typedef unsigned long long int ZPOS64_T;
101100
#endif
102101
#endif
103102
#endif
104103
105
-
104
+/* Maximum unsigned 32-bit value used as placeholder for zip64 */
105
+#ifndef MAXU32
106
+#define MAXU32 (0xffffffff)
107
+#endif
106108
107109
#ifdef __cplusplus
108110
extern "C" {
109111
#endif
110112
111113
--- compat/zlib/contrib/minizip/ioapi.h
+++ compat/zlib/contrib/minizip/ioapi.h
@@ -89,22 +89,24 @@
89 #ifdef HAS_STDINT_H
90 #include "stdint.h"
91 typedef uint64_t ZPOS64_T;
92 #else
93
94 /* Maximum unsigned 32-bit value used as placeholder for zip64 */
95 #define MAXU32 0xffffffff
96
97 #if defined(_MSC_VER) || defined(__BORLANDC__)
98 typedef unsigned __int64 ZPOS64_T;
99 #else
100 typedef unsigned long long int ZPOS64_T;
101 #endif
102 #endif
103 #endif
104
105
 
 
 
106
107 #ifdef __cplusplus
108 extern "C" {
109 #endif
110
111
--- compat/zlib/contrib/minizip/ioapi.h
+++ compat/zlib/contrib/minizip/ioapi.h
@@ -89,22 +89,24 @@
89 #ifdef HAS_STDINT_H
90 #include "stdint.h"
91 typedef uint64_t ZPOS64_T;
92 #else
93
94
 
95
96 #if defined(_MSC_VER) || defined(__BORLANDC__)
97 typedef unsigned __int64 ZPOS64_T;
98 #else
99 typedef unsigned long long int ZPOS64_T;
100 #endif
101 #endif
102 #endif
103
104 /* Maximum unsigned 32-bit value used as placeholder for zip64 */
105 #ifndef MAXU32
106 #define MAXU32 (0xffffffff)
107 #endif
108
109 #ifdef __cplusplus
110 extern "C" {
111 #endif
112
113
--- compat/zlib/contrib/minizip/miniunz.c
+++ compat/zlib/contrib/minizip/miniunz.c
@@ -43,10 +43,11 @@
4343
#include <stdlib.h>
4444
#include <string.h>
4545
#include <time.h>
4646
#include <errno.h>
4747
#include <fcntl.h>
48
+#include <sys/stat.h>
4849
4950
#ifdef _WIN32
5051
# include <direct.h>
5152
# include <io.h>
5253
#else
@@ -78,11 +79,11 @@
7879
7980
/* change_file_date : change the date/time of a file
8081
filename : the filename of the file where date/time must be modified
8182
dosdate : the new date at the MSDos format (4 bytes)
8283
tmu_date : the SAME new date at the tm_unz format */
83
-void change_file_date(filename,dosdate,tmu_date)
84
+static void change_file_date(filename,dosdate,tmu_date)
8485
const char *filename;
8586
uLong dosdate;
8687
tm_unz tmu_date;
8788
{
8889
#ifdef _WIN32
@@ -95,11 +96,12 @@
9596
DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
9697
LocalFileTimeToFileTime(&ftLocal,&ftm);
9798
SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
9899
CloseHandle(hFile);
99100
#else
100
-#ifdef unix || __APPLE__
101
+#if defined(unix) || defined(__APPLE__)
102
+ (void)dosdate;
101103
struct utimbuf ut;
102104
struct tm newdate;
103105
newdate.tm_sec = tmu_date.tm_sec;
104106
newdate.tm_min=tmu_date.tm_min;
105107
newdate.tm_hour=tmu_date.tm_hour;
@@ -119,11 +121,11 @@
119121
120122
121123
/* mymkdir and change_file_date are not 100 % portable
122124
As I don't know well Unix, I wait feedback for the unix portion */
123125
124
-int mymkdir(dirname)
126
+static int mymkdir(dirname)
125127
const char* dirname;
126128
{
127129
int ret=0;
128130
#ifdef _WIN32
129131
ret = _mkdir(dirname);
@@ -133,18 +135,18 @@
133135
ret = mkdir (dirname,0775);
134136
#endif
135137
return ret;
136138
}
137139
138
-int makedir (newdir)
139
- char *newdir;
140
+static int makedir (newdir)
141
+ const char *newdir;
140142
{
141143
char *buffer ;
142144
char *p;
143
- int len = (int)strlen(newdir);
145
+ size_t len = strlen(newdir);
144146
145
- if (len <= 0)
147
+ if (len == 0)
146148
return 0;
147149
148150
buffer = (char*)malloc(len+1);
149151
if (buffer==NULL)
150152
{
@@ -183,17 +185,17 @@
183185
}
184186
free(buffer);
185187
return 1;
186188
}
187189
188
-void do_banner()
190
+static void do_banner()
189191
{
190192
printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n");
191193
printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
192194
}
193195
194
-void do_help()
196
+static void do_help()
195197
{
196198
printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \
197199
" -e Extract without pathname (junk paths)\n" \
198200
" -x Extract with pathname\n" \
199201
" -v list files\n" \
@@ -201,11 +203,11 @@
201203
" -d directory to extract into\n" \
202204
" -o overwrite files without prompting\n" \
203205
" -p extract crypted file using password\n\n");
204206
}
205207
206
-void Display64BitsSize(ZPOS64_T n, int size_char)
208
+static void Display64BitsSize(ZPOS64_T n, int size_char)
207209
{
208210
/* to avoid compatibility problem , we do here the conversion */
209211
char number[21];
210212
int offset=19;
211213
int pos_string = 19;
@@ -229,11 +231,11 @@
229231
}
230232
231233
printf("%s",&number[pos_string]);
232234
}
233235
234
-int do_list(uf)
236
+static int do_list(uf)
235237
unzFile uf;
236238
{
237239
uLong i;
238240
unz_global_info64 gi;
239241
int err;
@@ -307,11 +309,11 @@
307309
308310
return 0;
309311
}
310312
311313
312
-int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
314
+static int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
313315
unzFile uf;
314316
const int* popt_extract_without_path;
315317
int* popt_overwrite;
316318
const char* password;
317319
{
@@ -322,11 +324,10 @@
322324
FILE *fout=NULL;
323325
void* buf;
324326
uInt size_buf;
325327
326328
unz_file_info64 file_info;
327
- uLong ratio=0;
328329
err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
329330
330331
if (err!=UNZ_OK)
331332
{
332333
printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
@@ -437,11 +438,11 @@
437438
{
438439
printf("error %d with zipfile in unzReadCurrentFile\n",err);
439440
break;
440441
}
441442
if (err>0)
442
- if (fwrite(buf,err,1,fout)!=1)
443
+ if (fwrite(buf,(unsigned)err,1,fout)!=1)
443444
{
444445
printf("error in writing extracted file\n");
445446
err=UNZ_ERRNO;
446447
break;
447448
}
@@ -470,20 +471,19 @@
470471
free(buf);
471472
return err;
472473
}
473474
474475
475
-int do_extract(uf,opt_extract_without_path,opt_overwrite,password)
476
+static int do_extract(uf,opt_extract_without_path,opt_overwrite,password)
476477
unzFile uf;
477478
int opt_extract_without_path;
478479
int opt_overwrite;
479480
const char* password;
480481
{
481482
uLong i;
482483
unz_global_info64 gi;
483484
int err;
484
- FILE* fout=NULL;
485485
486486
err = unzGetGlobalInfo64(uf,&gi);
487487
if (err!=UNZ_OK)
488488
printf("error %d with zipfile in unzGetGlobalInfo \n",err);
489489
@@ -506,18 +506,17 @@
506506
}
507507
508508
return 0;
509509
}
510510
511
-int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password)
511
+static int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password)
512512
unzFile uf;
513513
const char* filename;
514514
int opt_extract_without_path;
515515
int opt_overwrite;
516516
const char* password;
517517
{
518
- int err = UNZ_OK;
519518
if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK)
520519
{
521520
printf("file %s not found in the zipfile\n",filename);
522521
return 2;
523522
}
524523
--- compat/zlib/contrib/minizip/miniunz.c
+++ compat/zlib/contrib/minizip/miniunz.c
@@ -43,10 +43,11 @@
43 #include <stdlib.h>
44 #include <string.h>
45 #include <time.h>
46 #include <errno.h>
47 #include <fcntl.h>
 
48
49 #ifdef _WIN32
50 # include <direct.h>
51 # include <io.h>
52 #else
@@ -78,11 +79,11 @@
78
79 /* change_file_date : change the date/time of a file
80 filename : the filename of the file where date/time must be modified
81 dosdate : the new date at the MSDos format (4 bytes)
82 tmu_date : the SAME new date at the tm_unz format */
83 void change_file_date(filename,dosdate,tmu_date)
84 const char *filename;
85 uLong dosdate;
86 tm_unz tmu_date;
87 {
88 #ifdef _WIN32
@@ -95,11 +96,12 @@
95 DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
96 LocalFileTimeToFileTime(&ftLocal,&ftm);
97 SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
98 CloseHandle(hFile);
99 #else
100 #ifdef unix || __APPLE__
 
101 struct utimbuf ut;
102 struct tm newdate;
103 newdate.tm_sec = tmu_date.tm_sec;
104 newdate.tm_min=tmu_date.tm_min;
105 newdate.tm_hour=tmu_date.tm_hour;
@@ -119,11 +121,11 @@
119
120
121 /* mymkdir and change_file_date are not 100 % portable
122 As I don't know well Unix, I wait feedback for the unix portion */
123
124 int mymkdir(dirname)
125 const char* dirname;
126 {
127 int ret=0;
128 #ifdef _WIN32
129 ret = _mkdir(dirname);
@@ -133,18 +135,18 @@
133 ret = mkdir (dirname,0775);
134 #endif
135 return ret;
136 }
137
138 int makedir (newdir)
139 char *newdir;
140 {
141 char *buffer ;
142 char *p;
143 int len = (int)strlen(newdir);
144
145 if (len <= 0)
146 return 0;
147
148 buffer = (char*)malloc(len+1);
149 if (buffer==NULL)
150 {
@@ -183,17 +185,17 @@
183 }
184 free(buffer);
185 return 1;
186 }
187
188 void do_banner()
189 {
190 printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n");
191 printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
192 }
193
194 void do_help()
195 {
196 printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \
197 " -e Extract without pathname (junk paths)\n" \
198 " -x Extract with pathname\n" \
199 " -v list files\n" \
@@ -201,11 +203,11 @@
201 " -d directory to extract into\n" \
202 " -o overwrite files without prompting\n" \
203 " -p extract crypted file using password\n\n");
204 }
205
206 void Display64BitsSize(ZPOS64_T n, int size_char)
207 {
208 /* to avoid compatibility problem , we do here the conversion */
209 char number[21];
210 int offset=19;
211 int pos_string = 19;
@@ -229,11 +231,11 @@
229 }
230
231 printf("%s",&number[pos_string]);
232 }
233
234 int do_list(uf)
235 unzFile uf;
236 {
237 uLong i;
238 unz_global_info64 gi;
239 int err;
@@ -307,11 +309,11 @@
307
308 return 0;
309 }
310
311
312 int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
313 unzFile uf;
314 const int* popt_extract_without_path;
315 int* popt_overwrite;
316 const char* password;
317 {
@@ -322,11 +324,10 @@
322 FILE *fout=NULL;
323 void* buf;
324 uInt size_buf;
325
326 unz_file_info64 file_info;
327 uLong ratio=0;
328 err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
329
330 if (err!=UNZ_OK)
331 {
332 printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
@@ -437,11 +438,11 @@
437 {
438 printf("error %d with zipfile in unzReadCurrentFile\n",err);
439 break;
440 }
441 if (err>0)
442 if (fwrite(buf,err,1,fout)!=1)
443 {
444 printf("error in writing extracted file\n");
445 err=UNZ_ERRNO;
446 break;
447 }
@@ -470,20 +471,19 @@
470 free(buf);
471 return err;
472 }
473
474
475 int do_extract(uf,opt_extract_without_path,opt_overwrite,password)
476 unzFile uf;
477 int opt_extract_without_path;
478 int opt_overwrite;
479 const char* password;
480 {
481 uLong i;
482 unz_global_info64 gi;
483 int err;
484 FILE* fout=NULL;
485
486 err = unzGetGlobalInfo64(uf,&gi);
487 if (err!=UNZ_OK)
488 printf("error %d with zipfile in unzGetGlobalInfo \n",err);
489
@@ -506,18 +506,17 @@
506 }
507
508 return 0;
509 }
510
511 int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password)
512 unzFile uf;
513 const char* filename;
514 int opt_extract_without_path;
515 int opt_overwrite;
516 const char* password;
517 {
518 int err = UNZ_OK;
519 if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK)
520 {
521 printf("file %s not found in the zipfile\n",filename);
522 return 2;
523 }
524
--- compat/zlib/contrib/minizip/miniunz.c
+++ compat/zlib/contrib/minizip/miniunz.c
@@ -43,10 +43,11 @@
43 #include <stdlib.h>
44 #include <string.h>
45 #include <time.h>
46 #include <errno.h>
47 #include <fcntl.h>
48 #include <sys/stat.h>
49
50 #ifdef _WIN32
51 # include <direct.h>
52 # include <io.h>
53 #else
@@ -78,11 +79,11 @@
79
80 /* change_file_date : change the date/time of a file
81 filename : the filename of the file where date/time must be modified
82 dosdate : the new date at the MSDos format (4 bytes)
83 tmu_date : the SAME new date at the tm_unz format */
84 static void change_file_date(filename,dosdate,tmu_date)
85 const char *filename;
86 uLong dosdate;
87 tm_unz tmu_date;
88 {
89 #ifdef _WIN32
@@ -95,11 +96,12 @@
96 DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
97 LocalFileTimeToFileTime(&ftLocal,&ftm);
98 SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
99 CloseHandle(hFile);
100 #else
101 #if defined(unix) || defined(__APPLE__)
102 (void)dosdate;
103 struct utimbuf ut;
104 struct tm newdate;
105 newdate.tm_sec = tmu_date.tm_sec;
106 newdate.tm_min=tmu_date.tm_min;
107 newdate.tm_hour=tmu_date.tm_hour;
@@ -119,11 +121,11 @@
121
122
123 /* mymkdir and change_file_date are not 100 % portable
124 As I don't know well Unix, I wait feedback for the unix portion */
125
126 static int mymkdir(dirname)
127 const char* dirname;
128 {
129 int ret=0;
130 #ifdef _WIN32
131 ret = _mkdir(dirname);
@@ -133,18 +135,18 @@
135 ret = mkdir (dirname,0775);
136 #endif
137 return ret;
138 }
139
140 static int makedir (newdir)
141 const char *newdir;
142 {
143 char *buffer ;
144 char *p;
145 size_t len = strlen(newdir);
146
147 if (len == 0)
148 return 0;
149
150 buffer = (char*)malloc(len+1);
151 if (buffer==NULL)
152 {
@@ -183,17 +185,17 @@
185 }
186 free(buffer);
187 return 1;
188 }
189
190 static void do_banner()
191 {
192 printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n");
193 printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n");
194 }
195
196 static void do_help()
197 {
198 printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \
199 " -e Extract without pathname (junk paths)\n" \
200 " -x Extract with pathname\n" \
201 " -v list files\n" \
@@ -201,11 +203,11 @@
203 " -d directory to extract into\n" \
204 " -o overwrite files without prompting\n" \
205 " -p extract crypted file using password\n\n");
206 }
207
208 static void Display64BitsSize(ZPOS64_T n, int size_char)
209 {
210 /* to avoid compatibility problem , we do here the conversion */
211 char number[21];
212 int offset=19;
213 int pos_string = 19;
@@ -229,11 +231,11 @@
231 }
232
233 printf("%s",&number[pos_string]);
234 }
235
236 static int do_list(uf)
237 unzFile uf;
238 {
239 uLong i;
240 unz_global_info64 gi;
241 int err;
@@ -307,11 +309,11 @@
309
310 return 0;
311 }
312
313
314 static int do_extract_currentfile(uf,popt_extract_without_path,popt_overwrite,password)
315 unzFile uf;
316 const int* popt_extract_without_path;
317 int* popt_overwrite;
318 const char* password;
319 {
@@ -322,11 +324,10 @@
324 FILE *fout=NULL;
325 void* buf;
326 uInt size_buf;
327
328 unz_file_info64 file_info;
 
329 err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
330
331 if (err!=UNZ_OK)
332 {
333 printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
@@ -437,11 +438,11 @@
438 {
439 printf("error %d with zipfile in unzReadCurrentFile\n",err);
440 break;
441 }
442 if (err>0)
443 if (fwrite(buf,(unsigned)err,1,fout)!=1)
444 {
445 printf("error in writing extracted file\n");
446 err=UNZ_ERRNO;
447 break;
448 }
@@ -470,20 +471,19 @@
471 free(buf);
472 return err;
473 }
474
475
476 static int do_extract(uf,opt_extract_without_path,opt_overwrite,password)
477 unzFile uf;
478 int opt_extract_without_path;
479 int opt_overwrite;
480 const char* password;
481 {
482 uLong i;
483 unz_global_info64 gi;
484 int err;
 
485
486 err = unzGetGlobalInfo64(uf,&gi);
487 if (err!=UNZ_OK)
488 printf("error %d with zipfile in unzGetGlobalInfo \n",err);
489
@@ -506,18 +506,17 @@
506 }
507
508 return 0;
509 }
510
511 static int do_extract_onefile(uf,filename,opt_extract_without_path,opt_overwrite,password)
512 unzFile uf;
513 const char* filename;
514 int opt_extract_without_path;
515 int opt_overwrite;
516 const char* password;
517 {
 
518 if (unzLocateFile(uf,filename,CASESENSITIVITY)!=UNZ_OK)
519 {
520 printf("file %s not found in the zipfile\n",filename);
521 return 2;
522 }
523
--- compat/zlib/contrib/minizip/minizip.c
+++ compat/zlib/contrib/minizip/minizip.c
@@ -69,12 +69,12 @@
6969
7070
#define WRITEBUFFERSIZE (16384)
7171
#define MAXFILENAME (256)
7272
7373
#ifdef _WIN32
74
-uLong filetime(f, tmzip, dt)
75
- char *f; /* name of file to get info on */
74
+static int filetime(f, tmzip, dt)
75
+ const char *f; /* name of file to get info on */
7676
tm_zip *tmzip; /* return value: access, modific. and creation times */
7777
uLong *dt; /* dostime */
7878
{
7979
int ret = 0;
8080
{
@@ -92,25 +92,26 @@
9292
}
9393
}
9494
return ret;
9595
}
9696
#else
97
-#ifdef unix || __APPLE__
98
-uLong filetime(f, tmzip, dt)
99
- char *f; /* name of file to get info on */
97
+#if defined(unix) || defined(__APPLE__)
98
+static int filetime(f, tmzip, dt)
99
+ const char *f; /* name of file to get info on */
100100
tm_zip *tmzip; /* return value: access, modific. and creation times */
101101
uLong *dt; /* dostime */
102102
{
103
+ (void)dt;
103104
int ret=0;
104105
struct stat s; /* results of stat() */
105106
struct tm* filedate;
106107
time_t tm_t=0;
107108
108109
if (strcmp(f,"-")!=0)
109110
{
110111
char name[MAXFILENAME+1];
111
- int len = strlen(f);
112
+ size_t len = strlen(f);
112113
if (len > MAXFILENAME)
113114
len = MAXFILENAME;
114115
115116
strncpy(name, f,MAXFILENAME-1);
116117
/* strncpy doesnt append the trailing NULL, of the string is too long. */
@@ -136,11 +137,11 @@
136137
137138
return ret;
138139
}
139140
#else
140141
uLong filetime(f, tmzip, dt)
141
- char *f; /* name of file to get info on */
142
+ const char *f; /* name of file to get info on */
142143
tm_zip *tmzip; /* return value: access, modific. and creation times */
143144
uLong *dt; /* dostime */
144145
{
145146
return 0;
146147
}
@@ -148,11 +149,11 @@
148149
#endif
149150
150151
151152
152153
153
-int check_exist_file(filename)
154
+static int check_exist_file(filename)
154155
const char* filename;
155156
{
156157
FILE* ftestexist;
157158
int ret = 1;
158159
ftestexist = FOPEN_FUNC(filename,"rb");
@@ -161,17 +162,17 @@
161162
else
162163
fclose(ftestexist);
163164
return ret;
164165
}
165166
166
-void do_banner()
167
+static void do_banner()
167168
{
168169
printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n");
169170
printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n");
170171
}
171172
172
-void do_help()
173
+static void do_help()
173174
{
174175
printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
175176
" -o Overwrite existing file.zip\n" \
176177
" -a Append to existing file.zip\n" \
177178
" -0 Store only\n" \
@@ -180,11 +181,11 @@
180181
" -j exclude path. store only the file name.\n\n");
181182
}
182183
183184
/* calculate the CRC32 of a file,
184185
because to encrypt a file, we need known the CRC32 of the file before */
185
-int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc)
186
+static int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc)
186187
{
187188
unsigned long calculate_crc=0;
188189
int err=ZIP_OK;
189190
FILE * fin = FOPEN_FUNC(filenameinzip,"rb");
190191
@@ -197,20 +198,20 @@
197198
198199
if (err == ZIP_OK)
199200
do
200201
{
201202
err = ZIP_OK;
202
- size_read = (int)fread(buf,1,size_buf,fin);
203
+ size_read = fread(buf,1,size_buf,fin);
203204
if (size_read < size_buf)
204205
if (feof(fin)==0)
205206
{
206207
printf("error in reading %s\n",filenameinzip);
207208
err = ZIP_ERRNO;
208209
}
209210
210211
if (size_read>0)
211
- calculate_crc = crc32(calculate_crc,buf,size_read);
212
+ calculate_crc = crc32_z(calculate_crc,buf,size_read);
212213
total_read += size_read;
213214
214215
} while ((err == ZIP_OK) && (size_read>0));
215216
216217
if (fin)
@@ -219,20 +220,20 @@
219220
*result_crc=calculate_crc;
220221
printf("file %s crc %lx\n", filenameinzip, calculate_crc);
221222
return err;
222223
}
223224
224
-int isLargeFile(const char* filename)
225
+static int isLargeFile(const char* filename)
225226
{
226227
int largeFile = 0;
227228
ZPOS64_T pos = 0;
228229
FILE* pFile = FOPEN_FUNC(filename, "rb");
229230
230231
if(pFile != NULL)
231232
{
232
- int n = FSEEKO_FUNC(pFile, 0, SEEK_END);
233
- pos = FTELLO_FUNC(pFile);
233
+ FSEEKO_FUNC(pFile, 0, SEEK_END);
234
+ pos = (ZPOS64_T)FTELLO_FUNC(pFile);
234235
235236
printf("File : %s is %lld bytes\n", filename, pos);
236237
237238
if(pos >= 0xffffffff)
238239
largeFile = 1;
@@ -253,11 +254,11 @@
253254
int opt_exclude_path=0;
254255
int zipfilenamearg = 0;
255256
char filename_try[MAXFILENAME+16];
256257
int zipok;
257258
int err=0;
258
- int size_buf=0;
259
+ size_t size_buf=0;
259260
void* buf=NULL;
260261
const char* password=NULL;
261262
262263
263264
do_banner();
@@ -394,11 +395,11 @@
394395
(argv[i][1]=='p') || (argv[i][1]=='P') ||
395396
((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
396397
(strlen(argv[i]) == 2)))
397398
{
398399
FILE * fin;
399
- int size_read;
400
+ size_t size_read;
400401
const char* filenameinzip = argv[i];
401402
const char *savefilenameinzip;
402403
zip_fileinfo zi;
403404
unsigned long crcFile=0;
404405
int zip64 = 0;
@@ -470,21 +471,21 @@
470471
471472
if (err == ZIP_OK)
472473
do
473474
{
474475
err = ZIP_OK;
475
- size_read = (int)fread(buf,1,size_buf,fin);
476
+ size_read = fread(buf,1,size_buf,fin);
476477
if (size_read < size_buf)
477478
if (feof(fin)==0)
478479
{
479480
printf("error in reading %s\n",filenameinzip);
480481
err = ZIP_ERRNO;
481482
}
482483
483484
if (size_read>0)
484485
{
485
- err = zipWriteInFileInZip (zf,buf,size_read);
486
+ err = zipWriteInFileInZip (zf,buf,(unsigned)size_read);
486487
if (err<0)
487488
{
488489
printf("error in writing %s in the zipfile\n",
489490
filenameinzip);
490491
}
491492
--- compat/zlib/contrib/minizip/minizip.c
+++ compat/zlib/contrib/minizip/minizip.c
@@ -69,12 +69,12 @@
69
70 #define WRITEBUFFERSIZE (16384)
71 #define MAXFILENAME (256)
72
73 #ifdef _WIN32
74 uLong filetime(f, tmzip, dt)
75 char *f; /* name of file to get info on */
76 tm_zip *tmzip; /* return value: access, modific. and creation times */
77 uLong *dt; /* dostime */
78 {
79 int ret = 0;
80 {
@@ -92,25 +92,26 @@
92 }
93 }
94 return ret;
95 }
96 #else
97 #ifdef unix || __APPLE__
98 uLong filetime(f, tmzip, dt)
99 char *f; /* name of file to get info on */
100 tm_zip *tmzip; /* return value: access, modific. and creation times */
101 uLong *dt; /* dostime */
102 {
 
103 int ret=0;
104 struct stat s; /* results of stat() */
105 struct tm* filedate;
106 time_t tm_t=0;
107
108 if (strcmp(f,"-")!=0)
109 {
110 char name[MAXFILENAME+1];
111 int len = strlen(f);
112 if (len > MAXFILENAME)
113 len = MAXFILENAME;
114
115 strncpy(name, f,MAXFILENAME-1);
116 /* strncpy doesnt append the trailing NULL, of the string is too long. */
@@ -136,11 +137,11 @@
136
137 return ret;
138 }
139 #else
140 uLong filetime(f, tmzip, dt)
141 char *f; /* name of file to get info on */
142 tm_zip *tmzip; /* return value: access, modific. and creation times */
143 uLong *dt; /* dostime */
144 {
145 return 0;
146 }
@@ -148,11 +149,11 @@
148 #endif
149
150
151
152
153 int check_exist_file(filename)
154 const char* filename;
155 {
156 FILE* ftestexist;
157 int ret = 1;
158 ftestexist = FOPEN_FUNC(filename,"rb");
@@ -161,17 +162,17 @@
161 else
162 fclose(ftestexist);
163 return ret;
164 }
165
166 void do_banner()
167 {
168 printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n");
169 printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n");
170 }
171
172 void do_help()
173 {
174 printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
175 " -o Overwrite existing file.zip\n" \
176 " -a Append to existing file.zip\n" \
177 " -0 Store only\n" \
@@ -180,11 +181,11 @@
180 " -j exclude path. store only the file name.\n\n");
181 }
182
183 /* calculate the CRC32 of a file,
184 because to encrypt a file, we need known the CRC32 of the file before */
185 int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc)
186 {
187 unsigned long calculate_crc=0;
188 int err=ZIP_OK;
189 FILE * fin = FOPEN_FUNC(filenameinzip,"rb");
190
@@ -197,20 +198,20 @@
197
198 if (err == ZIP_OK)
199 do
200 {
201 err = ZIP_OK;
202 size_read = (int)fread(buf,1,size_buf,fin);
203 if (size_read < size_buf)
204 if (feof(fin)==0)
205 {
206 printf("error in reading %s\n",filenameinzip);
207 err = ZIP_ERRNO;
208 }
209
210 if (size_read>0)
211 calculate_crc = crc32(calculate_crc,buf,size_read);
212 total_read += size_read;
213
214 } while ((err == ZIP_OK) && (size_read>0));
215
216 if (fin)
@@ -219,20 +220,20 @@
219 *result_crc=calculate_crc;
220 printf("file %s crc %lx\n", filenameinzip, calculate_crc);
221 return err;
222 }
223
224 int isLargeFile(const char* filename)
225 {
226 int largeFile = 0;
227 ZPOS64_T pos = 0;
228 FILE* pFile = FOPEN_FUNC(filename, "rb");
229
230 if(pFile != NULL)
231 {
232 int n = FSEEKO_FUNC(pFile, 0, SEEK_END);
233 pos = FTELLO_FUNC(pFile);
234
235 printf("File : %s is %lld bytes\n", filename, pos);
236
237 if(pos >= 0xffffffff)
238 largeFile = 1;
@@ -253,11 +254,11 @@
253 int opt_exclude_path=0;
254 int zipfilenamearg = 0;
255 char filename_try[MAXFILENAME+16];
256 int zipok;
257 int err=0;
258 int size_buf=0;
259 void* buf=NULL;
260 const char* password=NULL;
261
262
263 do_banner();
@@ -394,11 +395,11 @@
394 (argv[i][1]=='p') || (argv[i][1]=='P') ||
395 ((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
396 (strlen(argv[i]) == 2)))
397 {
398 FILE * fin;
399 int size_read;
400 const char* filenameinzip = argv[i];
401 const char *savefilenameinzip;
402 zip_fileinfo zi;
403 unsigned long crcFile=0;
404 int zip64 = 0;
@@ -470,21 +471,21 @@
470
471 if (err == ZIP_OK)
472 do
473 {
474 err = ZIP_OK;
475 size_read = (int)fread(buf,1,size_buf,fin);
476 if (size_read < size_buf)
477 if (feof(fin)==0)
478 {
479 printf("error in reading %s\n",filenameinzip);
480 err = ZIP_ERRNO;
481 }
482
483 if (size_read>0)
484 {
485 err = zipWriteInFileInZip (zf,buf,size_read);
486 if (err<0)
487 {
488 printf("error in writing %s in the zipfile\n",
489 filenameinzip);
490 }
491
--- compat/zlib/contrib/minizip/minizip.c
+++ compat/zlib/contrib/minizip/minizip.c
@@ -69,12 +69,12 @@
69
70 #define WRITEBUFFERSIZE (16384)
71 #define MAXFILENAME (256)
72
73 #ifdef _WIN32
74 static int filetime(f, tmzip, dt)
75 const char *f; /* name of file to get info on */
76 tm_zip *tmzip; /* return value: access, modific. and creation times */
77 uLong *dt; /* dostime */
78 {
79 int ret = 0;
80 {
@@ -92,25 +92,26 @@
92 }
93 }
94 return ret;
95 }
96 #else
97 #if defined(unix) || defined(__APPLE__)
98 static int filetime(f, tmzip, dt)
99 const char *f; /* name of file to get info on */
100 tm_zip *tmzip; /* return value: access, modific. and creation times */
101 uLong *dt; /* dostime */
102 {
103 (void)dt;
104 int ret=0;
105 struct stat s; /* results of stat() */
106 struct tm* filedate;
107 time_t tm_t=0;
108
109 if (strcmp(f,"-")!=0)
110 {
111 char name[MAXFILENAME+1];
112 size_t len = strlen(f);
113 if (len > MAXFILENAME)
114 len = MAXFILENAME;
115
116 strncpy(name, f,MAXFILENAME-1);
117 /* strncpy doesnt append the trailing NULL, of the string is too long. */
@@ -136,11 +137,11 @@
137
138 return ret;
139 }
140 #else
141 uLong filetime(f, tmzip, dt)
142 const char *f; /* name of file to get info on */
143 tm_zip *tmzip; /* return value: access, modific. and creation times */
144 uLong *dt; /* dostime */
145 {
146 return 0;
147 }
@@ -148,11 +149,11 @@
149 #endif
150
151
152
153
154 static int check_exist_file(filename)
155 const char* filename;
156 {
157 FILE* ftestexist;
158 int ret = 1;
159 ftestexist = FOPEN_FUNC(filename,"rb");
@@ -161,17 +162,17 @@
162 else
163 fclose(ftestexist);
164 return ret;
165 }
166
167 static void do_banner()
168 {
169 printf("MiniZip 1.1, demo of zLib + MiniZip64 package, written by Gilles Vollant\n");
170 printf("more info on MiniZip at http://www.winimage.com/zLibDll/minizip.html\n\n");
171 }
172
173 static void do_help()
174 {
175 printf("Usage : minizip [-o] [-a] [-0 to -9] [-p password] [-j] file.zip [files_to_add]\n\n" \
176 " -o Overwrite existing file.zip\n" \
177 " -a Append to existing file.zip\n" \
178 " -0 Store only\n" \
@@ -180,11 +181,11 @@
181 " -j exclude path. store only the file name.\n\n");
182 }
183
184 /* calculate the CRC32 of a file,
185 because to encrypt a file, we need known the CRC32 of the file before */
186 static int getFileCrc(const char* filenameinzip,void*buf,unsigned long size_buf,unsigned long* result_crc)
187 {
188 unsigned long calculate_crc=0;
189 int err=ZIP_OK;
190 FILE * fin = FOPEN_FUNC(filenameinzip,"rb");
191
@@ -197,20 +198,20 @@
198
199 if (err == ZIP_OK)
200 do
201 {
202 err = ZIP_OK;
203 size_read = fread(buf,1,size_buf,fin);
204 if (size_read < size_buf)
205 if (feof(fin)==0)
206 {
207 printf("error in reading %s\n",filenameinzip);
208 err = ZIP_ERRNO;
209 }
210
211 if (size_read>0)
212 calculate_crc = crc32_z(calculate_crc,buf,size_read);
213 total_read += size_read;
214
215 } while ((err == ZIP_OK) && (size_read>0));
216
217 if (fin)
@@ -219,20 +220,20 @@
220 *result_crc=calculate_crc;
221 printf("file %s crc %lx\n", filenameinzip, calculate_crc);
222 return err;
223 }
224
225 static int isLargeFile(const char* filename)
226 {
227 int largeFile = 0;
228 ZPOS64_T pos = 0;
229 FILE* pFile = FOPEN_FUNC(filename, "rb");
230
231 if(pFile != NULL)
232 {
233 FSEEKO_FUNC(pFile, 0, SEEK_END);
234 pos = (ZPOS64_T)FTELLO_FUNC(pFile);
235
236 printf("File : %s is %lld bytes\n", filename, pos);
237
238 if(pos >= 0xffffffff)
239 largeFile = 1;
@@ -253,11 +254,11 @@
254 int opt_exclude_path=0;
255 int zipfilenamearg = 0;
256 char filename_try[MAXFILENAME+16];
257 int zipok;
258 int err=0;
259 size_t size_buf=0;
260 void* buf=NULL;
261 const char* password=NULL;
262
263
264 do_banner();
@@ -394,11 +395,11 @@
395 (argv[i][1]=='p') || (argv[i][1]=='P') ||
396 ((argv[i][1]>='0') || (argv[i][1]<='9'))) &&
397 (strlen(argv[i]) == 2)))
398 {
399 FILE * fin;
400 size_t size_read;
401 const char* filenameinzip = argv[i];
402 const char *savefilenameinzip;
403 zip_fileinfo zi;
404 unsigned long crcFile=0;
405 int zip64 = 0;
@@ -470,21 +471,21 @@
471
472 if (err == ZIP_OK)
473 do
474 {
475 err = ZIP_OK;
476 size_read = fread(buf,1,size_buf,fin);
477 if (size_read < size_buf)
478 if (feof(fin)==0)
479 {
480 printf("error in reading %s\n",filenameinzip);
481 err = ZIP_ERRNO;
482 }
483
484 if (size_read>0)
485 {
486 err = zipWriteInFileInZip (zf,buf,(unsigned)size_read);
487 if (err<0)
488 {
489 printf("error in writing %s in the zipfile\n",
490 filenameinzip);
491 }
492
--- compat/zlib/contrib/minizip/unzip.c
+++ compat/zlib/contrib/minizip/unzip.c
@@ -453,11 +453,11 @@
453453
454454
for (i=(int)uReadSize-3; (i--)>0;)
455455
if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
456456
((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
457457
{
458
- uPosFound = uReadPos+i;
458
+ uPosFound = uReadPos+(unsigned)i;
459459
break;
460460
}
461461
462462
if (uPosFound!=0)
463463
break;
@@ -521,11 +521,11 @@
521521
522522
for (i=(int)uReadSize-3; (i--)>0;)
523523
if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
524524
((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
525525
{
526
- uPosFound = uReadPos+i;
526
+ uPosFound = uReadPos+(unsigned)i;
527527
break;
528528
}
529529
530530
if (uPosFound!=0)
531531
break;
@@ -851,17 +851,17 @@
851851
*/
852852
local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm)
853853
{
854854
ZPOS64_T uDate;
855855
uDate = (ZPOS64_T)(ulDosDate>>16);
856
- ptm->tm_mday = (uInt)(uDate&0x1f) ;
857
- ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;
858
- ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
856
+ ptm->tm_mday = (int)(uDate&0x1f) ;
857
+ ptm->tm_mon = (int)((((uDate)&0x1E0)/0x20)-1) ;
858
+ ptm->tm_year = (int)(((uDate&0x0FE00)/0x0200)+1980) ;
859859
860
- ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
861
- ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ;
862
- ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ;
860
+ ptm->tm_hour = (int) ((ulDosDate &0xF800)/0x800);
861
+ ptm->tm_min = (int) ((ulDosDate&0x7E0)/0x20) ;
862
+ ptm->tm_sec = (int) (2*(ulDosDate&0x1f)) ;
863863
}
864864
865865
/*
866866
Get Info about the current file in the zipfile, with internal only info
867867
*/
@@ -991,11 +991,11 @@
991991
else
992992
uSizeRead = extraFieldBufferSize;
993993
994994
if (lSeek!=0)
995995
{
996
- if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
996
+ if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
997997
lSeek=0;
998998
else
999999
err=UNZ_ERRNO;
10001000
}
10011001
@@ -1016,11 +1016,11 @@
10161016
// since lSeek now points to after the extra field we need to move back
10171017
lSeek -= file_info.size_file_extra;
10181018
10191019
if (lSeek!=0)
10201020
{
1021
- if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
1021
+ if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
10221022
lSeek=0;
10231023
else
10241024
err=UNZ_ERRNO;
10251025
}
10261026
@@ -1088,11 +1088,11 @@
10881088
else
10891089
uSizeRead = commentBufferSize;
10901090
10911091
if (lSeek!=0)
10921092
{
1093
- if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
1093
+ if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
10941094
lSeek=0;
10951095
else
10961096
err=UNZ_ERRNO;
10971097
}
10981098
@@ -1765,11 +1765,11 @@
17651765
{
17661766
uInt uDoCopy,i ;
17671767
17681768
if ((pfile_in_zip_read_info->stream.avail_in == 0) &&
17691769
(pfile_in_zip_read_info->rest_read_compressed == 0))
1770
- return (iRead==0) ? UNZ_EOF : iRead;
1770
+ return (iRead==0) ? UNZ_EOF : (int)iRead;
17711771
17721772
if (pfile_in_zip_read_info->stream.avail_out <
17731773
pfile_in_zip_read_info->stream.avail_in)
17741774
uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
17751775
else
@@ -1855,10 +1855,13 @@
18551855
18561856
if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))
18571857
err = Z_DATA_ERROR;
18581858
18591859
uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
1860
+ /* Detect overflow, because z_stream.total_out is uLong (32 bits) */
1861
+ if (uTotalOutAfter<uTotalOutBefore)
1862
+ uTotalOutAfter += 1LL << 32; /* Add maximum value of uLong + 1 */
18601863
uOutThis = uTotalOutAfter-uTotalOutBefore;
18611864
18621865
pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;
18631866
18641867
pfile_in_zip_read_info->crc32 =
@@ -1869,18 +1872,18 @@
18691872
uOutThis;
18701873
18711874
iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
18721875
18731876
if (err==Z_STREAM_END)
1874
- return (iRead==0) ? UNZ_EOF : iRead;
1877
+ return (iRead==0) ? UNZ_EOF : (int)iRead;
18751878
if (err!=Z_OK)
18761879
break;
18771880
}
18781881
}
18791882
18801883
if (err==Z_OK)
1881
- return iRead;
1884
+ return (int)iRead;
18821885
return err;
18831886
}
18841887
18851888
18861889
/*
18871890
--- compat/zlib/contrib/minizip/unzip.c
+++ compat/zlib/contrib/minizip/unzip.c
@@ -453,11 +453,11 @@
453
454 for (i=(int)uReadSize-3; (i--)>0;)
455 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
456 ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
457 {
458 uPosFound = uReadPos+i;
459 break;
460 }
461
462 if (uPosFound!=0)
463 break;
@@ -521,11 +521,11 @@
521
522 for (i=(int)uReadSize-3; (i--)>0;)
523 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
524 ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
525 {
526 uPosFound = uReadPos+i;
527 break;
528 }
529
530 if (uPosFound!=0)
531 break;
@@ -851,17 +851,17 @@
851 */
852 local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm)
853 {
854 ZPOS64_T uDate;
855 uDate = (ZPOS64_T)(ulDosDate>>16);
856 ptm->tm_mday = (uInt)(uDate&0x1f) ;
857 ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ;
858 ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ;
859
860 ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800);
861 ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ;
862 ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ;
863 }
864
865 /*
866 Get Info about the current file in the zipfile, with internal only info
867 */
@@ -991,11 +991,11 @@
991 else
992 uSizeRead = extraFieldBufferSize;
993
994 if (lSeek!=0)
995 {
996 if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
997 lSeek=0;
998 else
999 err=UNZ_ERRNO;
1000 }
1001
@@ -1016,11 +1016,11 @@
1016 // since lSeek now points to after the extra field we need to move back
1017 lSeek -= file_info.size_file_extra;
1018
1019 if (lSeek!=0)
1020 {
1021 if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
1022 lSeek=0;
1023 else
1024 err=UNZ_ERRNO;
1025 }
1026
@@ -1088,11 +1088,11 @@
1088 else
1089 uSizeRead = commentBufferSize;
1090
1091 if (lSeek!=0)
1092 {
1093 if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
1094 lSeek=0;
1095 else
1096 err=UNZ_ERRNO;
1097 }
1098
@@ -1765,11 +1765,11 @@
1765 {
1766 uInt uDoCopy,i ;
1767
1768 if ((pfile_in_zip_read_info->stream.avail_in == 0) &&
1769 (pfile_in_zip_read_info->rest_read_compressed == 0))
1770 return (iRead==0) ? UNZ_EOF : iRead;
1771
1772 if (pfile_in_zip_read_info->stream.avail_out <
1773 pfile_in_zip_read_info->stream.avail_in)
1774 uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
1775 else
@@ -1855,10 +1855,13 @@
1855
1856 if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))
1857 err = Z_DATA_ERROR;
1858
1859 uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
 
 
 
1860 uOutThis = uTotalOutAfter-uTotalOutBefore;
1861
1862 pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;
1863
1864 pfile_in_zip_read_info->crc32 =
@@ -1869,18 +1872,18 @@
1869 uOutThis;
1870
1871 iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
1872
1873 if (err==Z_STREAM_END)
1874 return (iRead==0) ? UNZ_EOF : iRead;
1875 if (err!=Z_OK)
1876 break;
1877 }
1878 }
1879
1880 if (err==Z_OK)
1881 return iRead;
1882 return err;
1883 }
1884
1885
1886 /*
1887
--- compat/zlib/contrib/minizip/unzip.c
+++ compat/zlib/contrib/minizip/unzip.c
@@ -453,11 +453,11 @@
453
454 for (i=(int)uReadSize-3; (i--)>0;)
455 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
456 ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
457 {
458 uPosFound = uReadPos+(unsigned)i;
459 break;
460 }
461
462 if (uPosFound!=0)
463 break;
@@ -521,11 +521,11 @@
521
522 for (i=(int)uReadSize-3; (i--)>0;)
523 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
524 ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
525 {
526 uPosFound = uReadPos+(unsigned)i;
527 break;
528 }
529
530 if (uPosFound!=0)
531 break;
@@ -851,17 +851,17 @@
851 */
852 local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm)
853 {
854 ZPOS64_T uDate;
855 uDate = (ZPOS64_T)(ulDosDate>>16);
856 ptm->tm_mday = (int)(uDate&0x1f) ;
857 ptm->tm_mon = (int)((((uDate)&0x1E0)/0x20)-1) ;
858 ptm->tm_year = (int)(((uDate&0x0FE00)/0x0200)+1980) ;
859
860 ptm->tm_hour = (int) ((ulDosDate &0xF800)/0x800);
861 ptm->tm_min = (int) ((ulDosDate&0x7E0)/0x20) ;
862 ptm->tm_sec = (int) (2*(ulDosDate&0x1f)) ;
863 }
864
865 /*
866 Get Info about the current file in the zipfile, with internal only info
867 */
@@ -991,11 +991,11 @@
991 else
992 uSizeRead = extraFieldBufferSize;
993
994 if (lSeek!=0)
995 {
996 if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
997 lSeek=0;
998 else
999 err=UNZ_ERRNO;
1000 }
1001
@@ -1016,11 +1016,11 @@
1016 // since lSeek now points to after the extra field we need to move back
1017 lSeek -= file_info.size_file_extra;
1018
1019 if (lSeek!=0)
1020 {
1021 if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
1022 lSeek=0;
1023 else
1024 err=UNZ_ERRNO;
1025 }
1026
@@ -1088,11 +1088,11 @@
1088 else
1089 uSizeRead = commentBufferSize;
1090
1091 if (lSeek!=0)
1092 {
1093 if (ZSEEK64(s->z_filefunc, s->filestream,(ZPOS64_T)lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
1094 lSeek=0;
1095 else
1096 err=UNZ_ERRNO;
1097 }
1098
@@ -1765,11 +1765,11 @@
1765 {
1766 uInt uDoCopy,i ;
1767
1768 if ((pfile_in_zip_read_info->stream.avail_in == 0) &&
1769 (pfile_in_zip_read_info->rest_read_compressed == 0))
1770 return (iRead==0) ? UNZ_EOF : (int)iRead;
1771
1772 if (pfile_in_zip_read_info->stream.avail_out <
1773 pfile_in_zip_read_info->stream.avail_in)
1774 uDoCopy = pfile_in_zip_read_info->stream.avail_out ;
1775 else
@@ -1855,10 +1855,13 @@
1855
1856 if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL))
1857 err = Z_DATA_ERROR;
1858
1859 uTotalOutAfter = pfile_in_zip_read_info->stream.total_out;
1860 /* Detect overflow, because z_stream.total_out is uLong (32 bits) */
1861 if (uTotalOutAfter<uTotalOutBefore)
1862 uTotalOutAfter += 1LL << 32; /* Add maximum value of uLong + 1 */
1863 uOutThis = uTotalOutAfter-uTotalOutBefore;
1864
1865 pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis;
1866
1867 pfile_in_zip_read_info->crc32 =
@@ -1869,18 +1872,18 @@
1872 uOutThis;
1873
1874 iRead += (uInt)(uTotalOutAfter - uTotalOutBefore);
1875
1876 if (err==Z_STREAM_END)
1877 return (iRead==0) ? UNZ_EOF : (int)iRead;
1878 if (err!=Z_OK)
1879 break;
1880 }
1881 }
1882
1883 if (err==Z_OK)
1884 return (int)iRead;
1885 return err;
1886 }
1887
1888
1889 /*
1890
--- compat/zlib/contrib/minizip/unzip.h
+++ compat/zlib/contrib/minizip/unzip.h
@@ -81,16 +81,16 @@
8181
#define UNZ_CRCERROR (-105)
8282
8383
/* tm_unz contain date/time info */
8484
typedef struct tm_unz_s
8585
{
86
- uInt tm_sec; /* seconds after the minute - [0,59] */
87
- uInt tm_min; /* minutes after the hour - [0,59] */
88
- uInt tm_hour; /* hours since midnight - [0,23] */
89
- uInt tm_mday; /* day of the month - [1,31] */
90
- uInt tm_mon; /* months since January - [0,11] */
91
- uInt tm_year; /* years - [1980..2044] */
86
+ int tm_sec; /* seconds after the minute - [0,59] */
87
+ int tm_min; /* minutes after the hour - [0,59] */
88
+ int tm_hour; /* hours since midnight - [0,23] */
89
+ int tm_mday; /* day of the month - [1,31] */
90
+ int tm_mon; /* months since January - [0,11] */
91
+ int tm_year; /* years - [1980..2044] */
9292
} tm_unz;
9393
9494
/* unz_global_info structure contain global data about the ZIPfile
9595
These data comes from the end of central dir */
9696
typedef struct unz_global_info64_s
9797
--- compat/zlib/contrib/minizip/unzip.h
+++ compat/zlib/contrib/minizip/unzip.h
@@ -81,16 +81,16 @@
81 #define UNZ_CRCERROR (-105)
82
83 /* tm_unz contain date/time info */
84 typedef struct tm_unz_s
85 {
86 uInt tm_sec; /* seconds after the minute - [0,59] */
87 uInt tm_min; /* minutes after the hour - [0,59] */
88 uInt tm_hour; /* hours since midnight - [0,23] */
89 uInt tm_mday; /* day of the month - [1,31] */
90 uInt tm_mon; /* months since January - [0,11] */
91 uInt tm_year; /* years - [1980..2044] */
92 } tm_unz;
93
94 /* unz_global_info structure contain global data about the ZIPfile
95 These data comes from the end of central dir */
96 typedef struct unz_global_info64_s
97
--- compat/zlib/contrib/minizip/unzip.h
+++ compat/zlib/contrib/minizip/unzip.h
@@ -81,16 +81,16 @@
81 #define UNZ_CRCERROR (-105)
82
83 /* tm_unz contain date/time info */
84 typedef struct tm_unz_s
85 {
86 int tm_sec; /* seconds after the minute - [0,59] */
87 int tm_min; /* minutes after the hour - [0,59] */
88 int tm_hour; /* hours since midnight - [0,23] */
89 int tm_mday; /* day of the month - [1,31] */
90 int tm_mon; /* months since January - [0,11] */
91 int tm_year; /* years - [1980..2044] */
92 } tm_unz;
93
94 /* unz_global_info structure contain global data about the ZIPfile
95 These data comes from the end of central dir */
96 typedef struct unz_global_info64_s
97
--- compat/zlib/contrib/minizip/zip.c
+++ compat/zlib/contrib/minizip/zip.c
@@ -156,11 +156,11 @@
156156
ZPOS64_T totalCompressedData;
157157
ZPOS64_T totalUncompressedData;
158158
#ifndef NOCRYPT
159159
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
160160
const z_crc_t* pcrc_32_tab;
161
- int crypt_header_size;
161
+ unsigned crypt_header_size;
162162
#endif
163163
} curfile64_info;
164164
165165
typedef struct
166166
{
@@ -299,11 +299,11 @@
299299
{
300300
buf[n] = 0xff;
301301
}
302302
}
303303
304
- if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte)
304
+ if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,(uLong)nbByte)!=(uLong)nbByte)
305305
return ZIP_ERRNO;
306306
else
307307
return ZIP_OK;
308308
}
309309
@@ -335,12 +335,12 @@
335335
if (year>=1980)
336336
year-=1980;
337337
else if (year>=80)
338338
year-=80;
339339
return
340
- (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) |
341
- ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
340
+ (uLong) (((uLong)(ptm->tm_mday) + (32 * (uLong)(ptm->tm_mon+1)) + (512 * year)) << 16) |
341
+ (((uLong)ptm->tm_sec/2) + (32 * (uLong)ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
342342
}
343343
344344
345345
/****************************************************************************/
346346
@@ -520,16 +520,16 @@
520520
521521
for (i=(int)uReadSize-3; (i--)>0;)
522522
if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
523523
((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
524524
{
525
- uPosFound = uReadPos+i;
525
+ uPosFound = uReadPos+(unsigned)i;
526526
break;
527527
}
528528
529
- if (uPosFound!=0)
530
- break;
529
+ if (uPosFound!=0)
530
+ break;
531531
}
532532
TRYFREE(buf);
533533
return uPosFound;
534534
}
535535
@@ -584,11 +584,11 @@
584584
for (i=(int)uReadSize-3; (i--)>0;)
585585
{
586586
// Signature "0x07064b50" Zip64 end of central directory locater
587587
if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
588588
{
589
- uPosFound = uReadPos+i;
589
+ uPosFound = uReadPos+(unsigned)i;
590590
break;
591591
}
592592
}
593593
594594
if (uPosFound!=0)
@@ -635,11 +635,11 @@
635635
return 0;
636636
637637
return relativeOffset;
638638
}
639639
640
-int LoadCentralDirectoryRecord(zip64_internal* pziinit)
640
+local int LoadCentralDirectoryRecord(zip64_internal* pziinit)
641641
{
642642
int err=ZIP_OK;
643643
ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
644644
645645
ZPOS64_T size_central_dir; /* size of the central directory */
@@ -953,11 +953,11 @@
953953
extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append)
954954
{
955955
return zipOpen3(pathname,append,NULL,NULL);
956956
}
957957
958
-int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local)
958
+local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local)
959959
{
960960
/* write the local header */
961961
int err;
962962
uInt size_filename = (uInt)strlen(filename);
963963
uInt size_extrafield = size_extrafield_local;
@@ -1032,12 +1032,12 @@
10321032
ZPOS64_T UncompressedSize = 0;
10331033
10341034
// Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file)
10351035
zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream);
10361036
1037
- err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2);
1038
- err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2);
1037
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)HeaderID,2);
1038
+ err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)DataSize,2);
10391039
10401040
err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8);
10411041
err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8);
10421042
}
10431043
@@ -1514,11 +1514,11 @@
15141514
extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32)
15151515
{
15161516
zip64_internal* zi;
15171517
ZPOS64_T compressed_size;
15181518
uLong invalidValue = 0xffffffff;
1519
- short datasize = 0;
1519
+ unsigned datasize = 0;
15201520
int err=ZIP_OK;
15211521
15221522
if (file == NULL)
15231523
return ZIP_PARAMERROR;
15241524
zi = (zip64_internal*)file;
@@ -1750,11 +1750,11 @@
17501750
extern int ZEXPORT zipCloseFileInZip (zipFile file)
17511751
{
17521752
return zipCloseFileInZipRaw (file,0,0);
17531753
}
17541754
1755
-int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip)
1755
+local int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip)
17561756
{
17571757
int err = ZIP_OK;
17581758
ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writing_offset;
17591759
17601760
err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4);
@@ -1772,11 +1772,11 @@
17721772
err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)1,4);
17731773
17741774
return err;
17751775
}
17761776
1777
-int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1777
+local int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
17781778
{
17791779
int err = ZIP_OK;
17801780
17811781
uLong Zip64DataSize = 44;
17821782
@@ -1811,11 +1811,11 @@
18111811
ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writing_offset;
18121812
err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8);
18131813
}
18141814
return err;
18151815
}
1816
-int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1816
+local int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
18171817
{
18181818
int err = ZIP_OK;
18191819
18201820
/*signature*/
18211821
err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4);
@@ -1859,11 +1859,11 @@
18591859
}
18601860
18611861
return err;
18621862
}
18631863
1864
-int Write_GlobalComment(zip64_internal* zi, const char* global_comment)
1864
+local int Write_GlobalComment(zip64_internal* zi, const char* global_comment)
18651865
{
18661866
int err = ZIP_OK;
18671867
uInt size_global_comment = 0;
18681868
18691869
if(global_comment != NULL)
@@ -1960,11 +1960,11 @@
19601960
int retVal = ZIP_OK;
19611961
19621962
if(pData == NULL || *dataLen < 4)
19631963
return ZIP_PARAMERROR;
19641964
1965
- pNewHeader = (char*)ALLOC(*dataLen);
1965
+ pNewHeader = (char*)ALLOC((unsigned)*dataLen);
19661966
pTmp = pNewHeader;
19671967
19681968
while(p < (pData + *dataLen))
19691969
{
19701970
header = *(short*)p;
19711971
--- compat/zlib/contrib/minizip/zip.c
+++ compat/zlib/contrib/minizip/zip.c
@@ -156,11 +156,11 @@
156 ZPOS64_T totalCompressedData;
157 ZPOS64_T totalUncompressedData;
158 #ifndef NOCRYPT
159 unsigned long keys[3]; /* keys defining the pseudo-random sequence */
160 const z_crc_t* pcrc_32_tab;
161 int crypt_header_size;
162 #endif
163 } curfile64_info;
164
165 typedef struct
166 {
@@ -299,11 +299,11 @@
299 {
300 buf[n] = 0xff;
301 }
302 }
303
304 if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte)
305 return ZIP_ERRNO;
306 else
307 return ZIP_OK;
308 }
309
@@ -335,12 +335,12 @@
335 if (year>=1980)
336 year-=1980;
337 else if (year>=80)
338 year-=80;
339 return
340 (uLong) (((ptm->tm_mday) + (32 * (ptm->tm_mon+1)) + (512 * year)) << 16) |
341 ((ptm->tm_sec/2) + (32* ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
342 }
343
344
345 /****************************************************************************/
346
@@ -520,16 +520,16 @@
520
521 for (i=(int)uReadSize-3; (i--)>0;)
522 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
523 ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
524 {
525 uPosFound = uReadPos+i;
526 break;
527 }
528
529 if (uPosFound!=0)
530 break;
531 }
532 TRYFREE(buf);
533 return uPosFound;
534 }
535
@@ -584,11 +584,11 @@
584 for (i=(int)uReadSize-3; (i--)>0;)
585 {
586 // Signature "0x07064b50" Zip64 end of central directory locater
587 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
588 {
589 uPosFound = uReadPos+i;
590 break;
591 }
592 }
593
594 if (uPosFound!=0)
@@ -635,11 +635,11 @@
635 return 0;
636
637 return relativeOffset;
638 }
639
640 int LoadCentralDirectoryRecord(zip64_internal* pziinit)
641 {
642 int err=ZIP_OK;
643 ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
644
645 ZPOS64_T size_central_dir; /* size of the central directory */
@@ -953,11 +953,11 @@
953 extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append)
954 {
955 return zipOpen3(pathname,append,NULL,NULL);
956 }
957
958 int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local)
959 {
960 /* write the local header */
961 int err;
962 uInt size_filename = (uInt)strlen(filename);
963 uInt size_extrafield = size_extrafield_local;
@@ -1032,12 +1032,12 @@
1032 ZPOS64_T UncompressedSize = 0;
1033
1034 // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file)
1035 zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream);
1036
1037 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)HeaderID,2);
1038 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (short)DataSize,2);
1039
1040 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8);
1041 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8);
1042 }
1043
@@ -1514,11 +1514,11 @@
1514 extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32)
1515 {
1516 zip64_internal* zi;
1517 ZPOS64_T compressed_size;
1518 uLong invalidValue = 0xffffffff;
1519 short datasize = 0;
1520 int err=ZIP_OK;
1521
1522 if (file == NULL)
1523 return ZIP_PARAMERROR;
1524 zi = (zip64_internal*)file;
@@ -1750,11 +1750,11 @@
1750 extern int ZEXPORT zipCloseFileInZip (zipFile file)
1751 {
1752 return zipCloseFileInZipRaw (file,0,0);
1753 }
1754
1755 int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip)
1756 {
1757 int err = ZIP_OK;
1758 ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writing_offset;
1759
1760 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4);
@@ -1772,11 +1772,11 @@
1772 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)1,4);
1773
1774 return err;
1775 }
1776
1777 int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1778 {
1779 int err = ZIP_OK;
1780
1781 uLong Zip64DataSize = 44;
1782
@@ -1811,11 +1811,11 @@
1811 ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writing_offset;
1812 err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8);
1813 }
1814 return err;
1815 }
1816 int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1817 {
1818 int err = ZIP_OK;
1819
1820 /*signature*/
1821 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4);
@@ -1859,11 +1859,11 @@
1859 }
1860
1861 return err;
1862 }
1863
1864 int Write_GlobalComment(zip64_internal* zi, const char* global_comment)
1865 {
1866 int err = ZIP_OK;
1867 uInt size_global_comment = 0;
1868
1869 if(global_comment != NULL)
@@ -1960,11 +1960,11 @@
1960 int retVal = ZIP_OK;
1961
1962 if(pData == NULL || *dataLen < 4)
1963 return ZIP_PARAMERROR;
1964
1965 pNewHeader = (char*)ALLOC(*dataLen);
1966 pTmp = pNewHeader;
1967
1968 while(p < (pData + *dataLen))
1969 {
1970 header = *(short*)p;
1971
--- compat/zlib/contrib/minizip/zip.c
+++ compat/zlib/contrib/minizip/zip.c
@@ -156,11 +156,11 @@
156 ZPOS64_T totalCompressedData;
157 ZPOS64_T totalUncompressedData;
158 #ifndef NOCRYPT
159 unsigned long keys[3]; /* keys defining the pseudo-random sequence */
160 const z_crc_t* pcrc_32_tab;
161 unsigned crypt_header_size;
162 #endif
163 } curfile64_info;
164
165 typedef struct
166 {
@@ -299,11 +299,11 @@
299 {
300 buf[n] = 0xff;
301 }
302 }
303
304 if (ZWRITE64(*pzlib_filefunc_def,filestream,buf,(uLong)nbByte)!=(uLong)nbByte)
305 return ZIP_ERRNO;
306 else
307 return ZIP_OK;
308 }
309
@@ -335,12 +335,12 @@
335 if (year>=1980)
336 year-=1980;
337 else if (year>=80)
338 year-=80;
339 return
340 (uLong) (((uLong)(ptm->tm_mday) + (32 * (uLong)(ptm->tm_mon+1)) + (512 * year)) << 16) |
341 (((uLong)ptm->tm_sec/2) + (32 * (uLong)ptm->tm_min) + (2048 * (uLong)ptm->tm_hour));
342 }
343
344
345 /****************************************************************************/
346
@@ -520,16 +520,16 @@
520
521 for (i=(int)uReadSize-3; (i--)>0;)
522 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) &&
523 ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06))
524 {
525 uPosFound = uReadPos+(unsigned)i;
526 break;
527 }
528
529 if (uPosFound!=0)
530 break;
531 }
532 TRYFREE(buf);
533 return uPosFound;
534 }
535
@@ -584,11 +584,11 @@
584 for (i=(int)uReadSize-3; (i--)>0;)
585 {
586 // Signature "0x07064b50" Zip64 end of central directory locater
587 if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07))
588 {
589 uPosFound = uReadPos+(unsigned)i;
590 break;
591 }
592 }
593
594 if (uPosFound!=0)
@@ -635,11 +635,11 @@
635 return 0;
636
637 return relativeOffset;
638 }
639
640 local int LoadCentralDirectoryRecord(zip64_internal* pziinit)
641 {
642 int err=ZIP_OK;
643 ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/
644
645 ZPOS64_T size_central_dir; /* size of the central directory */
@@ -953,11 +953,11 @@
953 extern zipFile ZEXPORT zipOpen64 (const void* pathname, int append)
954 {
955 return zipOpen3(pathname,append,NULL,NULL);
956 }
957
958 local int Write_LocalFileHeader(zip64_internal* zi, const char* filename, uInt size_extrafield_local, const void* extrafield_local)
959 {
960 /* write the local header */
961 int err;
962 uInt size_filename = (uInt)strlen(filename);
963 uInt size_extrafield = size_extrafield_local;
@@ -1032,12 +1032,12 @@
1032 ZPOS64_T UncompressedSize = 0;
1033
1034 // Remember position of Zip64 extended info for the local file header. (needed when we update size after done with file)
1035 zi->ci.pos_zip64extrainfo = ZTELL64(zi->z_filefunc,zi->filestream);
1036
1037 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)HeaderID,2);
1038 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)DataSize,2);
1039
1040 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)UncompressedSize,8);
1041 err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)CompressedSize,8);
1042 }
1043
@@ -1514,11 +1514,11 @@
1514 extern int ZEXPORT zipCloseFileInZipRaw64 (zipFile file, ZPOS64_T uncompressed_size, uLong crc32)
1515 {
1516 zip64_internal* zi;
1517 ZPOS64_T compressed_size;
1518 uLong invalidValue = 0xffffffff;
1519 unsigned datasize = 0;
1520 int err=ZIP_OK;
1521
1522 if (file == NULL)
1523 return ZIP_PARAMERROR;
1524 zi = (zip64_internal*)file;
@@ -1750,11 +1750,11 @@
1750 extern int ZEXPORT zipCloseFileInZip (zipFile file)
1751 {
1752 return zipCloseFileInZipRaw (file,0,0);
1753 }
1754
1755 local int Write_Zip64EndOfCentralDirectoryLocator(zip64_internal* zi, ZPOS64_T zip64eocd_pos_inzip)
1756 {
1757 int err = ZIP_OK;
1758 ZPOS64_T pos = zip64eocd_pos_inzip - zi->add_position_when_writing_offset;
1759
1760 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ZIP64ENDLOCHEADERMAGIC,4);
@@ -1772,11 +1772,11 @@
1772 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)1,4);
1773
1774 return err;
1775 }
1776
1777 local int Write_Zip64EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1778 {
1779 int err = ZIP_OK;
1780
1781 uLong Zip64DataSize = 44;
1782
@@ -1811,11 +1811,11 @@
1811 ZPOS64_T pos = centraldir_pos_inzip - zi->add_position_when_writing_offset;
1812 err = zip64local_putValue(&zi->z_filefunc,zi->filestream, (ZPOS64_T)pos,8);
1813 }
1814 return err;
1815 }
1816 local int Write_EndOfCentralDirectoryRecord(zip64_internal* zi, uLong size_centraldir, ZPOS64_T centraldir_pos_inzip)
1817 {
1818 int err = ZIP_OK;
1819
1820 /*signature*/
1821 err = zip64local_putValue(&zi->z_filefunc,zi->filestream,(uLong)ENDHEADERMAGIC,4);
@@ -1859,11 +1859,11 @@
1859 }
1860
1861 return err;
1862 }
1863
1864 local int Write_GlobalComment(zip64_internal* zi, const char* global_comment)
1865 {
1866 int err = ZIP_OK;
1867 uInt size_global_comment = 0;
1868
1869 if(global_comment != NULL)
@@ -1960,11 +1960,11 @@
1960 int retVal = ZIP_OK;
1961
1962 if(pData == NULL || *dataLen < 4)
1963 return ZIP_PARAMERROR;
1964
1965 pNewHeader = (char*)ALLOC((unsigned)*dataLen);
1966 pTmp = pNewHeader;
1967
1968 while(p < (pData + *dataLen))
1969 {
1970 header = *(short*)p;
1971
--- compat/zlib/contrib/minizip/zip.h
+++ compat/zlib/contrib/minizip/zip.h
@@ -86,16 +86,16 @@
8686
/* default memLevel */
8787
8888
/* tm_zip contain date/time info */
8989
typedef struct tm_zip_s
9090
{
91
- uInt tm_sec; /* seconds after the minute - [0,59] */
92
- uInt tm_min; /* minutes after the hour - [0,59] */
93
- uInt tm_hour; /* hours since midnight - [0,23] */
94
- uInt tm_mday; /* day of the month - [1,31] */
95
- uInt tm_mon; /* months since January - [0,11] */
96
- uInt tm_year; /* years - [1980..2044] */
91
+ int tm_sec; /* seconds after the minute - [0,59] */
92
+ int tm_min; /* minutes after the hour - [0,59] */
93
+ int tm_hour; /* hours since midnight - [0,23] */
94
+ int tm_mday; /* day of the month - [1,31] */
95
+ int tm_mon; /* months since January - [0,11] */
96
+ int tm_year; /* years - [1980..2044] */
9797
} tm_zip;
9898
9999
typedef struct
100100
{
101101
tm_zip tmz_date; /* date in understandable format */
@@ -142,10 +142,15 @@
142142
extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
143143
int append,
144144
zipcharpc* globalcomment,
145145
zlib_filefunc64_def* pzlib_filefunc_def));
146146
147
+extern zipFile ZEXPORT zipOpen3 OF((const void *pathname,
148
+ int append,
149
+ zipcharpc* globalcomment,
150
+ zlib_filefunc64_32_def* pzlib_filefunc64_32_def));
151
+
147152
extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
148153
const char* filename,
149154
const zip_fileinfo* zipfi,
150155
const void* extrafield_local,
151156
uInt size_extrafield_local,
152157
--- compat/zlib/contrib/minizip/zip.h
+++ compat/zlib/contrib/minizip/zip.h
@@ -86,16 +86,16 @@
86 /* default memLevel */
87
88 /* tm_zip contain date/time info */
89 typedef struct tm_zip_s
90 {
91 uInt tm_sec; /* seconds after the minute - [0,59] */
92 uInt tm_min; /* minutes after the hour - [0,59] */
93 uInt tm_hour; /* hours since midnight - [0,23] */
94 uInt tm_mday; /* day of the month - [1,31] */
95 uInt tm_mon; /* months since January - [0,11] */
96 uInt tm_year; /* years - [1980..2044] */
97 } tm_zip;
98
99 typedef struct
100 {
101 tm_zip tmz_date; /* date in understandable format */
@@ -142,10 +142,15 @@
142 extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
143 int append,
144 zipcharpc* globalcomment,
145 zlib_filefunc64_def* pzlib_filefunc_def));
146
 
 
 
 
 
147 extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
148 const char* filename,
149 const zip_fileinfo* zipfi,
150 const void* extrafield_local,
151 uInt size_extrafield_local,
152
--- compat/zlib/contrib/minizip/zip.h
+++ compat/zlib/contrib/minizip/zip.h
@@ -86,16 +86,16 @@
86 /* default memLevel */
87
88 /* tm_zip contain date/time info */
89 typedef struct tm_zip_s
90 {
91 int tm_sec; /* seconds after the minute - [0,59] */
92 int tm_min; /* minutes after the hour - [0,59] */
93 int tm_hour; /* hours since midnight - [0,23] */
94 int tm_mday; /* day of the month - [1,31] */
95 int tm_mon; /* months since January - [0,11] */
96 int tm_year; /* years - [1980..2044] */
97 } tm_zip;
98
99 typedef struct
100 {
101 tm_zip tmz_date; /* date in understandable format */
@@ -142,10 +142,15 @@
142 extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
143 int append,
144 zipcharpc* globalcomment,
145 zlib_filefunc64_def* pzlib_filefunc_def));
146
147 extern zipFile ZEXPORT zipOpen3 OF((const void *pathname,
148 int append,
149 zipcharpc* globalcomment,
150 zlib_filefunc64_32_def* pzlib_filefunc64_32_def));
151
152 extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
153 const char* filename,
154 const zip_fileinfo* zipfi,
155 const void* extrafield_local,
156 uInt size_extrafield_local,
157
--- compat/zlib/contrib/pascal/zlibpas.pas
+++ compat/zlib/contrib/pascal/zlibpas.pas
@@ -8,11 +8,11 @@
88
unit zlibpas;
99
1010
interface
1111
1212
const
13
- ZLIB_VERSION = '1.2.11';
13
+ ZLIB_VERSION = '1.2.12';
1414
ZLIB_VERNUM = $12a0;
1515
1616
type
1717
alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
1818
cdecl;
1919
--- compat/zlib/contrib/pascal/zlibpas.pas
+++ compat/zlib/contrib/pascal/zlibpas.pas
@@ -8,11 +8,11 @@
8 unit zlibpas;
9
10 interface
11
12 const
13 ZLIB_VERSION = '1.2.11';
14 ZLIB_VERNUM = $12a0;
15
16 type
17 alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
18 cdecl;
19
--- compat/zlib/contrib/pascal/zlibpas.pas
+++ compat/zlib/contrib/pascal/zlibpas.pas
@@ -8,11 +8,11 @@
8 unit zlibpas;
9
10 interface
11
12 const
13 ZLIB_VERSION = '1.2.12';
14 ZLIB_VERNUM = $12a0;
15
16 type
17 alloc_func = function(opaque: Pointer; items, size: Integer): Pointer;
18 cdecl;
19
--- compat/zlib/contrib/vstudio/readme.txt
+++ compat/zlib/contrib/vstudio/readme.txt
@@ -1,6 +1,6 @@
1
-Building instructions for the DLL versions of Zlib 1.2.11
1
+Building instructions for the DLL versions of Zlib 1.2.12
22
========================================================
33
44
This directory contains projects that build zlib and minizip using
55
Microsoft Visual C++ 9.0/10.0.
66
77
--- compat/zlib/contrib/vstudio/readme.txt
+++ compat/zlib/contrib/vstudio/readme.txt
@@ -1,6 +1,6 @@
1 Building instructions for the DLL versions of Zlib 1.2.11
2 ========================================================
3
4 This directory contains projects that build zlib and minizip using
5 Microsoft Visual C++ 9.0/10.0.
6
7
--- compat/zlib/contrib/vstudio/readme.txt
+++ compat/zlib/contrib/vstudio/readme.txt
@@ -1,6 +1,6 @@
1 Building instructions for the DLL versions of Zlib 1.2.12
2 ========================================================
3
4 This directory contains projects that build zlib and minizip using
5 Microsoft Visual C++ 9.0/10.0.
6
7
--- compat/zlib/contrib/vstudio/vc10/zlib.rc
+++ compat/zlib/contrib/vstudio/vc10/zlib.rc
@@ -1,11 +1,11 @@
11
#include <windows.h>
22
33
#define IDR_VERSION1 1
44
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5
- FILEVERSION 1, 2, 11, 0
6
- PRODUCTVERSION 1, 2, 11, 0
5
+ FILEVERSION 1, 2, 12, 0
6
+ PRODUCTVERSION 1, 2, 12, 0
77
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
88
FILEFLAGS 0
99
FILEOS VOS_DOS_WINDOWS32
1010
FILETYPE VFT_DLL
1111
FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
1515
BLOCK "040904E4"
1616
//language ID = U.S. English, char set = Windows, Multilingual
1717
1818
BEGIN
1919
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20
- VALUE "FileVersion", "1.2.11\0"
20
+ VALUE "FileVersion", "1.2.12\0"
2121
VALUE "InternalName", "zlib\0"
2222
VALUE "OriginalFilename", "zlibwapi.dll\0"
2323
VALUE "ProductName", "ZLib.DLL\0"
2424
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25
- VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
25
+ VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
2626
END
2727
END
2828
BLOCK "VarFileInfo"
2929
BEGIN
3030
VALUE "Translation", 0x0409, 1252
3131
END
3232
END
3333
--- compat/zlib/contrib/vstudio/vc10/zlib.rc
+++ compat/zlib/contrib/vstudio/vc10/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 11, 0
6 PRODUCTVERSION 1, 2, 11, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.11\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc10/zlib.rc
+++ compat/zlib/contrib/vstudio/vc10/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 12, 0
6 PRODUCTVERSION 1, 2, 12, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.12\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc10/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc10/zlibvc.def
@@ -149,5 +149,10 @@
149149
gzfread @171
150150
gzfwrite @172
151151
deflateGetDictionary @173
152152
adler32_z @174
153153
crc32_z @175
154
+
155
+; zlib1 v1.2.12 added:
156
+ crc32_combine_gen @176
157
+ crc32_combine_gen64 @177
158
+ crc32_combine_op @178
154159
--- compat/zlib/contrib/vstudio/vc10/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc10/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
 
 
 
 
 
154
--- compat/zlib/contrib/vstudio/vc10/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc10/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
154
155 ; zlib1 v1.2.12 added:
156 crc32_combine_gen @176
157 crc32_combine_gen64 @177
158 crc32_combine_op @178
159
--- compat/zlib/contrib/vstudio/vc11/zlib.rc
+++ compat/zlib/contrib/vstudio/vc11/zlib.rc
@@ -1,11 +1,11 @@
11
#include <windows.h>
22
33
#define IDR_VERSION1 1
44
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5
- FILEVERSION 1, 2, 11, 0
6
- PRODUCTVERSION 1, 2, 11, 0
5
+ FILEVERSION 1, 2, 12, 0
6
+ PRODUCTVERSION 1, 2, 12, 0
77
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
88
FILEFLAGS 0
99
FILEOS VOS_DOS_WINDOWS32
1010
FILETYPE VFT_DLL
1111
FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
1515
BLOCK "040904E4"
1616
//language ID = U.S. English, char set = Windows, Multilingual
1717
1818
BEGIN
1919
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20
- VALUE "FileVersion", "1.2.11\0"
20
+ VALUE "FileVersion", "1.2.12\0"
2121
VALUE "InternalName", "zlib\0"
2222
VALUE "OriginalFilename", "zlibwapi.dll\0"
2323
VALUE "ProductName", "ZLib.DLL\0"
2424
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25
- VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
25
+ VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
2626
END
2727
END
2828
BLOCK "VarFileInfo"
2929
BEGIN
3030
VALUE "Translation", 0x0409, 1252
3131
END
3232
END
3333
--- compat/zlib/contrib/vstudio/vc11/zlib.rc
+++ compat/zlib/contrib/vstudio/vc11/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 11, 0
6 PRODUCTVERSION 1, 2, 11, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.11\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc11/zlib.rc
+++ compat/zlib/contrib/vstudio/vc11/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 12, 0
6 PRODUCTVERSION 1, 2, 12, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.12\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc11/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc11/zlibvc.def
@@ -149,5 +149,10 @@
149149
gzfread @171
150150
gzfwrite @172
151151
deflateGetDictionary @173
152152
adler32_z @174
153153
crc32_z @175
154
+
155
+; zlib1 v1.2.12 added:
156
+ crc32_combine_gen @176
157
+ crc32_combine_gen64 @177
158
+ crc32_combine_op @178
154159
--- compat/zlib/contrib/vstudio/vc11/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc11/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
 
 
 
 
 
154
--- compat/zlib/contrib/vstudio/vc11/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc11/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
154
155 ; zlib1 v1.2.12 added:
156 crc32_combine_gen @176
157 crc32_combine_gen64 @177
158 crc32_combine_op @178
159
--- compat/zlib/contrib/vstudio/vc12/zlib.rc
+++ compat/zlib/contrib/vstudio/vc12/zlib.rc
@@ -1,11 +1,11 @@
11
#include <windows.h>
22
33
#define IDR_VERSION1 1
44
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5
- FILEVERSION 1, 2, 11, 0
6
- PRODUCTVERSION 1, 2, 11, 0
5
+ FILEVERSION 1, 2, 12, 0
6
+ PRODUCTVERSION 1, 2, 12, 0
77
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
88
FILEFLAGS 0
99
FILEOS VOS_DOS_WINDOWS32
1010
FILETYPE VFT_DLL
1111
FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
1515
BLOCK "040904E4"
1616
//language ID = U.S. English, char set = Windows, Multilingual
1717
1818
BEGIN
1919
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20
- VALUE "FileVersion", "1.2.11\0"
20
+ VALUE "FileVersion", "1.2.12\0"
2121
VALUE "InternalName", "zlib\0"
2222
VALUE "OriginalFilename", "zlibwapi.dll\0"
2323
VALUE "ProductName", "ZLib.DLL\0"
2424
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25
- VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
25
+ VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
2626
END
2727
END
2828
BLOCK "VarFileInfo"
2929
BEGIN
3030
VALUE "Translation", 0x0409, 1252
3131
END
3232
END
3333
--- compat/zlib/contrib/vstudio/vc12/zlib.rc
+++ compat/zlib/contrib/vstudio/vc12/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 11, 0
6 PRODUCTVERSION 1, 2, 11, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.11\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc12/zlib.rc
+++ compat/zlib/contrib/vstudio/vc12/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 12, 0
6 PRODUCTVERSION 1, 2, 12, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.12\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc12/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc12/zlibvc.def
@@ -149,5 +149,10 @@
149149
gzfread @171
150150
gzfwrite @172
151151
deflateGetDictionary @173
152152
adler32_z @174
153153
crc32_z @175
154
+
155
+; zlib1 v1.2.12 added:
156
+ crc32_combine_gen @176
157
+ crc32_combine_gen64 @177
158
+ crc32_combine_op @178
154159
--- compat/zlib/contrib/vstudio/vc12/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc12/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
 
 
 
 
 
154
--- compat/zlib/contrib/vstudio/vc12/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc12/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
154
155 ; zlib1 v1.2.12 added:
156 crc32_combine_gen @176
157 crc32_combine_gen64 @177
158 crc32_combine_op @178
159
--- compat/zlib/contrib/vstudio/vc14/zlib.rc
+++ compat/zlib/contrib/vstudio/vc14/zlib.rc
@@ -1,11 +1,11 @@
11
#include <windows.h>
22
33
#define IDR_VERSION1 1
44
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5
- FILEVERSION 1, 2, 11, 0
6
- PRODUCTVERSION 1, 2, 11, 0
5
+ FILEVERSION 1, 2, 12, 0
6
+ PRODUCTVERSION 1, 2, 12, 0
77
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
88
FILEFLAGS 0
99
FILEOS VOS_DOS_WINDOWS32
1010
FILETYPE VFT_DLL
1111
FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
1515
BLOCK "040904E4"
1616
//language ID = U.S. English, char set = Windows, Multilingual
1717
1818
BEGIN
1919
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20
- VALUE "FileVersion", "1.2.11\0"
20
+ VALUE "FileVersion", "1.2.12\0"
2121
VALUE "InternalName", "zlib\0"
2222
VALUE "OriginalFilename", "zlibwapi.dll\0"
2323
VALUE "ProductName", "ZLib.DLL\0"
2424
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25
- VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
25
+ VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
2626
END
2727
END
2828
BLOCK "VarFileInfo"
2929
BEGIN
3030
VALUE "Translation", 0x0409, 1252
3131
END
3232
END
3333
--- compat/zlib/contrib/vstudio/vc14/zlib.rc
+++ compat/zlib/contrib/vstudio/vc14/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 11, 0
6 PRODUCTVERSION 1, 2, 11, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.11\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc14/zlib.rc
+++ compat/zlib/contrib/vstudio/vc14/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 12, 0
6 PRODUCTVERSION 1, 2, 12, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.12\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc14/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc14/zlibvc.def
@@ -149,5 +149,10 @@
149149
gzfread @171
150150
gzfwrite @172
151151
deflateGetDictionary @173
152152
adler32_z @174
153153
crc32_z @175
154
+
155
+; zlib1 v1.2.12 added:
156
+ crc32_combine_gen @176
157
+ crc32_combine_gen64 @177
158
+ crc32_combine_op @178
154159
--- compat/zlib/contrib/vstudio/vc14/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc14/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
 
 
 
 
 
154
--- compat/zlib/contrib/vstudio/vc14/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc14/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
154
155 ; zlib1 v1.2.12 added:
156 crc32_combine_gen @176
157 crc32_combine_gen64 @177
158 crc32_combine_op @178
159
--- compat/zlib/contrib/vstudio/vc9/zlib.rc
+++ compat/zlib/contrib/vstudio/vc9/zlib.rc
@@ -1,11 +1,11 @@
11
#include <windows.h>
22
33
#define IDR_VERSION1 1
44
IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5
- FILEVERSION 1, 2, 11, 0
6
- PRODUCTVERSION 1, 2, 11, 0
5
+ FILEVERSION 1, 2, 12, 0
6
+ PRODUCTVERSION 1, 2, 12, 0
77
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
88
FILEFLAGS 0
99
FILEOS VOS_DOS_WINDOWS32
1010
FILETYPE VFT_DLL
1111
FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
1515
BLOCK "040904E4"
1616
//language ID = U.S. English, char set = Windows, Multilingual
1717
1818
BEGIN
1919
VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20
- VALUE "FileVersion", "1.2.11\0"
20
+ VALUE "FileVersion", "1.2.12\0"
2121
VALUE "InternalName", "zlib\0"
2222
VALUE "OriginalFilename", "zlibwapi.dll\0"
2323
VALUE "ProductName", "ZLib.DLL\0"
2424
VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25
- VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
25
+ VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
2626
END
2727
END
2828
BLOCK "VarFileInfo"
2929
BEGIN
3030
VALUE "Translation", 0x0409, 1252
3131
END
3232
END
3333
--- compat/zlib/contrib/vstudio/vc9/zlib.rc
+++ compat/zlib/contrib/vstudio/vc9/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 11, 0
6 PRODUCTVERSION 1, 2, 11, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.11\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc9/zlib.rc
+++ compat/zlib/contrib/vstudio/vc9/zlib.rc
@@ -1,11 +1,11 @@
1 #include <windows.h>
2
3 #define IDR_VERSION1 1
4 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE
5 FILEVERSION 1, 2, 12, 0
6 PRODUCTVERSION 1, 2, 12, 0
7 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
8 FILEFLAGS 0
9 FILEOS VOS_DOS_WINDOWS32
10 FILETYPE VFT_DLL
11 FILESUBTYPE 0 // not used
@@ -15,18 +15,18 @@
15 BLOCK "040904E4"
16 //language ID = U.S. English, char set = Windows, Multilingual
17
18 BEGIN
19 VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
20 VALUE "FileVersion", "1.2.12\0"
21 VALUE "InternalName", "zlib\0"
22 VALUE "OriginalFilename", "zlibwapi.dll\0"
23 VALUE "ProductName", "ZLib.DLL\0"
24 VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0"
25 VALUE "LegalCopyright", "(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
26 END
27 END
28 BLOCK "VarFileInfo"
29 BEGIN
30 VALUE "Translation", 0x0409, 1252
31 END
32 END
33
--- compat/zlib/contrib/vstudio/vc9/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc9/zlibvc.def
@@ -149,5 +149,10 @@
149149
gzfread @171
150150
gzfwrite @172
151151
deflateGetDictionary @173
152152
adler32_z @174
153153
crc32_z @175
154
+
155
+; zlib1 v1.2.12 added:
156
+ crc32_combine_gen @176
157
+ crc32_combine_gen64 @177
158
+ crc32_combine_op @178
154159
--- compat/zlib/contrib/vstudio/vc9/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc9/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
 
 
 
 
 
154
--- compat/zlib/contrib/vstudio/vc9/zlibvc.def
+++ compat/zlib/contrib/vstudio/vc9/zlibvc.def
@@ -149,5 +149,10 @@
149 gzfread @171
150 gzfwrite @172
151 deflateGetDictionary @173
152 adler32_z @174
153 crc32_z @175
154
155 ; zlib1 v1.2.12 added:
156 crc32_combine_gen @176
157 crc32_combine_gen64 @177
158 crc32_combine_op @178
159
+994 -320
--- compat/zlib/crc32.c
+++ compat/zlib/crc32.c
@@ -1,239 +1,1065 @@
11
/* crc32.c -- compute the CRC-32 of a data stream
2
- * Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler
2
+ * Copyright (C) 1995-2022 Mark Adler
33
* For conditions of distribution and use, see copyright notice in zlib.h
44
*
5
- * Thanks to Rodney Brown <[email protected]> for his contribution of faster
6
- * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
7
- * tables for updating the shift register in one step with three exclusive-ors
8
- * instead of four steps with four exclusive-ors. This results in about a
9
- * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
5
+ * This interleaved implementation of a CRC makes use of pipelined multiple
6
+ * arithmetic-logic units, commonly found in modern CPU cores. It is due to
7
+ * Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution.
108
*/
119
1210
/* @(#) $Id$ */
1311
1412
/*
1513
Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
1614
protection on the static variables used to control the first-use generation
17
- of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
15
+ of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
1816
first call get_crc_table() to initialize the tables before allowing more than
1917
one thread to use crc32().
2018
21
- DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
19
+ MAKECRCH can be #defined to write out crc32.h. A main() routine is also
20
+ produced, so that this one source file can be compiled to an executable.
2221
*/
2322
2423
#ifdef MAKECRCH
2524
# include <stdio.h>
2625
# ifndef DYNAMIC_CRC_TABLE
2726
# define DYNAMIC_CRC_TABLE
2827
# endif /* !DYNAMIC_CRC_TABLE */
2928
#endif /* MAKECRCH */
3029
31
-#include "zutil.h" /* for STDC and FAR definitions */
32
-
33
-/* Definitions for doing the crc four data bytes at a time. */
34
-#if !defined(NOBYFOUR) && defined(Z_U4)
35
-# define BYFOUR
36
-#endif
37
-#ifdef BYFOUR
38
- local unsigned long crc32_little OF((unsigned long,
39
- const unsigned char FAR *, z_size_t));
40
- local unsigned long crc32_big OF((unsigned long,
41
- const unsigned char FAR *, z_size_t));
42
-# define TBLS 8
30
+#include "zutil.h" /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */
31
+
32
+ /*
33
+ A CRC of a message is computed on N braids of words in the message, where
34
+ each word consists of W bytes (4 or 8). If N is 3, for example, then three
35
+ running sparse CRCs are calculated respectively on each braid, at these
36
+ indices in the array of words: 0, 3, 6, ..., 1, 4, 7, ..., and 2, 5, 8, ...
37
+ This is done starting at a word boundary, and continues until as many blocks
38
+ of N * W bytes as are available have been processed. The results are combined
39
+ into a single CRC at the end. For this code, N must be in the range 1..6 and
40
+ W must be 4 or 8. The upper limit on N can be increased if desired by adding
41
+ more #if blocks, extending the patterns apparent in the code. In addition,
42
+ crc32.h would need to be regenerated, if the maximum N value is increased.
43
+
44
+ N and W are chosen empirically by benchmarking the execution time on a given
45
+ processor. The choices for N and W below were based on testing on Intel Kaby
46
+ Lake i7, AMD Ryzen 7, ARM Cortex-A57, Sparc64-VII, PowerPC POWER9, and MIPS64
47
+ Octeon II processors. The Intel, AMD, and ARM processors were all fastest
48
+ with N=5, W=8. The Sparc, PowerPC, and MIPS64 were all fastest at N=5, W=4.
49
+ They were all tested with either gcc or clang, all using the -O3 optimization
50
+ level. Your mileage may vary.
51
+ */
52
+
53
+/* Define N */
54
+#ifdef Z_TESTN
55
+# define N Z_TESTN
56
+#else
57
+# define N 5
58
+#endif
59
+#if N < 1 || N > 6
60
+# error N must be in 1..6
61
+#endif
62
+
63
+/*
64
+ z_crc_t must be at least 32 bits. z_word_t must be at least as long as
65
+ z_crc_t. It is assumed here that z_word_t is either 32 bits or 64 bits, and
66
+ that bytes are eight bits.
67
+ */
68
+
69
+/*
70
+ Define W and the associated z_word_t type. If W is not defined, then a
71
+ braided calculation is not used, and the associated tables and code are not
72
+ compiled.
73
+ */
74
+#ifdef Z_TESTW
75
+# if Z_TESTW-1 != -1
76
+# define W Z_TESTW
77
+# endif
4378
#else
44
-# define TBLS 1
45
-#endif /* BYFOUR */
46
-
47
-/* Local functions for crc concatenation */
48
-local unsigned long gf2_matrix_times OF((unsigned long *mat,
49
- unsigned long vec));
50
-local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
51
-local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
52
-
79
+# ifdef MAKECRCH
80
+# define W 8 /* required for MAKECRCH */
81
+# else
82
+# if defined(__x86_64__) || defined(__aarch64__)
83
+# define W 8
84
+# else
85
+# define W 4
86
+# endif
87
+# endif
88
+#endif
89
+#ifdef W
90
+# if W == 8 && defined(Z_U8)
91
+ typedef Z_U8 z_word_t;
92
+# elif defined(Z_U4)
93
+# undef W
94
+# define W 4
95
+ typedef Z_U4 z_word_t;
96
+# else
97
+# undef W
98
+# endif
99
+#endif
100
+
101
+/* Local functions. */
102
+local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
103
+local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
104
+
105
+/* If available, use the ARM processor CRC32 instruction. */
106
+#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
107
+# define ARMCRC32
108
+#endif
109
+
110
+#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
111
+/*
112
+ Swap the bytes in a z_word_t to convert between little and big endian. Any
113
+ self-respecting compiler will optimize this to a single machine byte-swap
114
+ instruction, if one is available. This assumes that word_t is either 32 bits
115
+ or 64 bits.
116
+ */
117
+local z_word_t byte_swap(word)
118
+ z_word_t word;
119
+{
120
+# if W == 8
121
+ return
122
+ (word & 0xff00000000000000) >> 56 |
123
+ (word & 0xff000000000000) >> 40 |
124
+ (word & 0xff0000000000) >> 24 |
125
+ (word & 0xff00000000) >> 8 |
126
+ (word & 0xff000000) << 8 |
127
+ (word & 0xff0000) << 24 |
128
+ (word & 0xff00) << 40 |
129
+ (word & 0xff) << 56;
130
+# else /* W == 4 */
131
+ return
132
+ (word & 0xff000000) >> 24 |
133
+ (word & 0xff0000) >> 8 |
134
+ (word & 0xff00) << 8 |
135
+ (word & 0xff) << 24;
136
+# endif
137
+}
138
+#endif
139
+
140
+/* CRC polynomial. */
141
+#define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */
53142
54143
#ifdef DYNAMIC_CRC_TABLE
55144
56
-local volatile int crc_table_empty = 1;
57
-local z_crc_t FAR crc_table[TBLS][256];
145
+local z_crc_t FAR crc_table[256];
146
+local z_crc_t FAR x2n_table[32];
58147
local void make_crc_table OF((void));
148
+#ifdef W
149
+ local z_word_t FAR crc_big_table[256];
150
+ local z_crc_t FAR crc_braid_table[W][256];
151
+ local z_word_t FAR crc_braid_big_table[W][256];
152
+ local void braid OF((z_crc_t [][256], z_word_t [][256], int, int));
153
+#endif
59154
#ifdef MAKECRCH
60
- local void write_table OF((FILE *, const z_crc_t FAR *));
155
+ local void write_table OF((FILE *, const z_crc_t FAR *, int));
156
+ local void write_table32hi OF((FILE *, const z_word_t FAR *, int));
157
+ local void write_table64 OF((FILE *, const z_word_t FAR *, int));
61158
#endif /* MAKECRCH */
159
+
160
+/*
161
+ Define a once() function depending on the availability of atomics. If this is
162
+ compiled with DYNAMIC_CRC_TABLE defined, and if CRCs will be computed in
163
+ multiple threads, and if atomics are not available, then get_crc_table() must
164
+ be called to initialize the tables and must return before any threads are
165
+ allowed to compute or combine CRCs.
166
+ */
167
+
168
+/* Definition of once functionality. */
169
+typedef struct once_s once_t;
170
+local void once OF((once_t *, void (*)(void)));
171
+
172
+/* Check for the availability of atomics. */
173
+#if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \
174
+ !defined(__STDC_NO_ATOMICS__)
175
+
176
+#include <stdatomic.h>
177
+
178
+/* Structure for once(), which must be initialized with ONCE_INIT. */
179
+struct once_s {
180
+ atomic_flag begun;
181
+ atomic_int done;
182
+};
183
+#define ONCE_INIT {ATOMIC_FLAG_INIT, 0}
184
+
185
+/*
186
+ Run the provided init() function exactly once, even if multiple threads
187
+ invoke once() at the same time. The state must be a once_t initialized with
188
+ ONCE_INIT.
189
+ */
190
+local void once(state, init)
191
+ once_t *state;
192
+ void (*init)(void);
193
+{
194
+ if (!atomic_load(&state->done)) {
195
+ if (atomic_flag_test_and_set(&state->begun))
196
+ while (!atomic_load(&state->done))
197
+ ;
198
+ else {
199
+ init();
200
+ atomic_store(&state->done, 1);
201
+ }
202
+ }
203
+}
204
+
205
+#else /* no atomics */
206
+
207
+/* Structure for once(), which must be initialized with ONCE_INIT. */
208
+struct once_s {
209
+ volatile int begun;
210
+ volatile int done;
211
+};
212
+#define ONCE_INIT {0, 0}
213
+
214
+/* Test and set. Alas, not atomic, but tries to minimize the period of
215
+ vulnerability. */
216
+local int test_and_set OF((int volatile *));
217
+local int test_and_set(flag)
218
+ int volatile *flag;
219
+{
220
+ int was;
221
+
222
+ was = *flag;
223
+ *flag = 1;
224
+ return was;
225
+}
226
+
227
+/* Run the provided init() function once. This is not thread-safe. */
228
+local void once(state, init)
229
+ once_t *state;
230
+ void (*init)(void);
231
+{
232
+ if (!state->done) {
233
+ if (test_and_set(&state->begun))
234
+ while (!state->done)
235
+ ;
236
+ else {
237
+ init();
238
+ state->done = 1;
239
+ }
240
+ }
241
+}
242
+
243
+#endif
244
+
245
+/* State for once(). */
246
+local once_t made = ONCE_INIT;
247
+
62248
/*
63249
Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
64250
x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
65251
66252
Polynomials over GF(2) are represented in binary, one bit per coefficient,
67
- with the lowest powers in the most significant bit. Then adding polynomials
253
+ with the lowest powers in the most significant bit. Then adding polynomials
68254
is just exclusive-or, and multiplying a polynomial by x is a right shift by
69
- one. If we call the above polynomial p, and represent a byte as the
255
+ one. If we call the above polynomial p, and represent a byte as the
70256
polynomial q, also with the lowest power in the most significant bit (so the
71
- byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
257
+ byte 0xb1 is the polynomial x^7+x^3+x^2+1), then the CRC is (q*x^32) mod p,
72258
where a mod b means the remainder after dividing a by b.
73259
74260
This calculation is done using the shift-register method of multiplying and
75
- taking the remainder. The register is initialized to zero, and for each
261
+ taking the remainder. The register is initialized to zero, and for each
76262
incoming bit, x^32 is added mod p to the register if the bit is a one (where
77
- x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
78
- x (which is shifting right by one and adding x^32 mod p if the bit shifted
79
- out is a one). We start with the highest power (least significant bit) of
80
- q and repeat for all eight bits of q.
81
-
82
- The first table is simply the CRC of all possible eight bit values. This is
83
- all the information needed to generate CRCs on data a byte at a time for all
84
- combinations of CRC register values and incoming bytes. The remaining tables
85
- allow for word-at-a-time CRC calculation for both big-endian and little-
86
- endian machines, where a word is four bytes.
87
-*/
263
+ x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by x
264
+ (which is shifting right by one and adding x^32 mod p if the bit shifted out
265
+ is a one). We start with the highest power (least significant bit) of q and
266
+ repeat for all eight bits of q.
267
+
268
+ The table is simply the CRC of all possible eight bit values. This is all the
269
+ information needed to generate CRCs on data a byte at a time for all
270
+ combinations of CRC register values and incoming bytes.
271
+ */
272
+
88273
local void make_crc_table()
89274
{
90
- z_crc_t c;
91
- int n, k;
92
- z_crc_t poly; /* polynomial exclusive-or pattern */
93
- /* terms of polynomial defining this crc (except x^32): */
94
- static volatile int first = 1; /* flag to limit concurrent making */
95
- static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
96
-
97
- /* See if another task is already doing this (not thread-safe, but better
98
- than nothing -- significantly reduces duration of vulnerability in
99
- case the advice about DYNAMIC_CRC_TABLE is ignored) */
100
- if (first) {
101
- first = 0;
102
-
103
- /* make exclusive-or pattern from polynomial (0xedb88320UL) */
104
- poly = 0;
105
- for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
106
- poly |= (z_crc_t)1 << (31 - p[n]);
107
-
108
- /* generate a crc for every 8-bit value */
109
- for (n = 0; n < 256; n++) {
110
- c = (z_crc_t)n;
111
- for (k = 0; k < 8; k++)
112
- c = c & 1 ? poly ^ (c >> 1) : c >> 1;
113
- crc_table[0][n] = c;
114
- }
115
-
116
-#ifdef BYFOUR
117
- /* generate crc for each value followed by one, two, and three zeros,
118
- and then the byte reversal of those as well as the first table */
119
- for (n = 0; n < 256; n++) {
120
- c = crc_table[0][n];
121
- crc_table[4][n] = ZSWAP32(c);
122
- for (k = 1; k < 4; k++) {
123
- c = crc_table[0][c & 0xff] ^ (c >> 8);
124
- crc_table[k][n] = c;
125
- crc_table[k + 4][n] = ZSWAP32(c);
126
- }
127
- }
128
-#endif /* BYFOUR */
129
-
130
- crc_table_empty = 0;
131
- }
132
- else { /* not first */
133
- /* wait for the other guy to finish (not efficient, but rare) */
134
- while (crc_table_empty)
135
- ;
136
- }
275
+ unsigned i, j, n;
276
+ z_crc_t p;
277
+
278
+ /* initialize the CRC of bytes tables */
279
+ for (i = 0; i < 256; i++) {
280
+ p = i;
281
+ for (j = 0; j < 8; j++)
282
+ p = p & 1 ? (p >> 1) ^ POLY : p >> 1;
283
+ crc_table[i] = p;
284
+#ifdef W
285
+ crc_big_table[i] = byte_swap(p);
286
+#endif
287
+ }
288
+
289
+ /* initialize the x^2^n mod p(x) table */
290
+ p = (z_crc_t)1 << 30; /* x^1 */
291
+ x2n_table[0] = p;
292
+ for (n = 1; n < 32; n++)
293
+ x2n_table[n] = p = multmodp(p, p);
294
+
295
+#ifdef W
296
+ /* initialize the braiding tables -- needs x2n_table[] */
297
+ braid(crc_braid_table, crc_braid_big_table, N, W);
298
+#endif
137299
138300
#ifdef MAKECRCH
139
- /* write out CRC tables to crc32.h */
140301
{
302
+ /*
303
+ The crc32.h header file contains tables for both 32-bit and 64-bit
304
+ z_word_t's, and so requires a 64-bit type be available. In that case,
305
+ z_word_t must be defined to be 64-bits. This code then also generates
306
+ and writes out the tables for the case that z_word_t is 32 bits.
307
+ */
308
+#if !defined(W) || W != 8
309
+# error Need a 64-bit integer type in order to generate crc32.h.
310
+#endif
141311
FILE *out;
312
+ int k, n;
313
+ z_crc_t ltl[8][256];
314
+ z_word_t big[8][256];
142315
143316
out = fopen("crc32.h", "w");
144317
if (out == NULL) return;
145
- fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
146
- fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
147
- fprintf(out, "local const z_crc_t FAR ");
148
- fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
149
- write_table(out, crc_table[0]);
150
-# ifdef BYFOUR
151
- fprintf(out, "#ifdef BYFOUR\n");
152
- for (k = 1; k < 8; k++) {
153
- fprintf(out, " },\n {\n");
154
- write_table(out, crc_table[k]);
155
- }
156
- fprintf(out, "#endif\n");
157
-# endif /* BYFOUR */
158
- fprintf(out, " }\n};\n");
318
+
319
+ /* write out little-endian CRC table to crc32.h */
320
+ fprintf(out,
321
+ "/* crc32.h -- tables for rapid CRC calculation\n"
322
+ " * Generated automatically by crc32.c\n */\n"
323
+ "\n"
324
+ "local const z_crc_t FAR crc_table[] = {\n"
325
+ " ");
326
+ write_table(out, crc_table, 256);
327
+ fprintf(out,
328
+ "};\n");
329
+
330
+ /* write out big-endian CRC table for 64-bit z_word_t to crc32.h */
331
+ fprintf(out,
332
+ "\n"
333
+ "#ifdef W\n"
334
+ "\n"
335
+ "#if W == 8\n"
336
+ "\n"
337
+ "local const z_word_t FAR crc_big_table[] = {\n"
338
+ " ");
339
+ write_table64(out, crc_big_table, 256);
340
+ fprintf(out,
341
+ "};\n");
342
+
343
+ /* write out big-endian CRC table for 32-bit z_word_t to crc32.h */
344
+ fprintf(out,
345
+ "\n"
346
+ "#else /* W == 4 */\n"
347
+ "\n"
348
+ "local const z_word_t FAR crc_big_table[] = {\n"
349
+ " ");
350
+ write_table32hi(out, crc_big_table, 256);
351
+ fprintf(out,
352
+ "};\n"
353
+ "\n"
354
+ "#endif\n");
355
+
356
+ /* write out braid tables for each value of N */
357
+ for (n = 1; n <= 6; n++) {
358
+ fprintf(out,
359
+ "\n"
360
+ "#if N == %d\n", n);
361
+
362
+ /* compute braid tables for this N and 64-bit word_t */
363
+ braid(ltl, big, n, 8);
364
+
365
+ /* write out braid tables for 64-bit z_word_t to crc32.h */
366
+ fprintf(out,
367
+ "\n"
368
+ "#if W == 8\n"
369
+ "\n"
370
+ "local const z_crc_t FAR crc_braid_table[][256] = {\n");
371
+ for (k = 0; k < 8; k++) {
372
+ fprintf(out, " {");
373
+ write_table(out, ltl[k], 256);
374
+ fprintf(out, "}%s", k < 7 ? ",\n" : "");
375
+ }
376
+ fprintf(out,
377
+ "};\n"
378
+ "\n"
379
+ "local const z_word_t FAR crc_braid_big_table[][256] = {\n");
380
+ for (k = 0; k < 8; k++) {
381
+ fprintf(out, " {");
382
+ write_table64(out, big[k], 256);
383
+ fprintf(out, "}%s", k < 7 ? ",\n" : "");
384
+ }
385
+ fprintf(out,
386
+ "};\n");
387
+
388
+ /* compute braid tables for this N and 32-bit word_t */
389
+ braid(ltl, big, n, 4);
390
+
391
+ /* write out braid tables for 32-bit z_word_t to crc32.h */
392
+ fprintf(out,
393
+ "\n"
394
+ "#else /* W == 4 */\n"
395
+ "\n"
396
+ "local const z_crc_t FAR crc_braid_table[][256] = {\n");
397
+ for (k = 0; k < 4; k++) {
398
+ fprintf(out, " {");
399
+ write_table(out, ltl[k], 256);
400
+ fprintf(out, "}%s", k < 3 ? ",\n" : "");
401
+ }
402
+ fprintf(out,
403
+ "};\n"
404
+ "\n"
405
+ "local const z_word_t FAR crc_braid_big_table[][256] = {\n");
406
+ for (k = 0; k < 4; k++) {
407
+ fprintf(out, " {");
408
+ write_table32hi(out, big[k], 256);
409
+ fprintf(out, "}%s", k < 3 ? ",\n" : "");
410
+ }
411
+ fprintf(out,
412
+ "};\n"
413
+ "\n"
414
+ "#endif\n"
415
+ "\n"
416
+ "#endif\n");
417
+ }
418
+ fprintf(out,
419
+ "\n"
420
+ "#endif\n");
421
+
422
+ /* write out zeros operator table to crc32.h */
423
+ fprintf(out,
424
+ "\n"
425
+ "local const z_crc_t FAR x2n_table[] = {\n"
426
+ " ");
427
+ write_table(out, x2n_table, 32);
428
+ fprintf(out,
429
+ "};\n");
159430
fclose(out);
160431
}
161432
#endif /* MAKECRCH */
162433
}
163434
164435
#ifdef MAKECRCH
165
-local void write_table(out, table)
436
+
437
+/*
438
+ Write the 32-bit values in table[0..k-1] to out, five per line in
439
+ hexadecimal separated by commas.
440
+ */
441
+local void write_table(out, table, k)
166442
FILE *out;
167443
const z_crc_t FAR *table;
444
+ int k;
168445
{
169446
int n;
170447
171
- for (n = 0; n < 256; n++)
172
- fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ",
448
+ for (n = 0; n < k; n++)
449
+ fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ",
173450
(unsigned long)(table[n]),
174
- n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
451
+ n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", "));
452
+}
453
+
454
+/*
455
+ Write the high 32-bits of each value in table[0..k-1] to out, five per line
456
+ in hexadecimal separated by commas.
457
+ */
458
+local void write_table32hi(out, table, k)
459
+FILE *out;
460
+const z_word_t FAR *table;
461
+int k;
462
+{
463
+ int n;
464
+
465
+ for (n = 0; n < k; n++)
466
+ fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ",
467
+ (unsigned long)(table[n] >> 32),
468
+ n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", "));
469
+}
470
+
471
+/*
472
+ Write the 64-bit values in table[0..k-1] to out, three per line in
473
+ hexadecimal separated by commas. This assumes that if there is a 64-bit
474
+ type, then there is also a long long integer type, and it is at least 64
475
+ bits. If not, then the type cast and format string can be adjusted
476
+ accordingly.
477
+ */
478
+local void write_table64(out, table, k)
479
+ FILE *out;
480
+ const z_word_t FAR *table;
481
+ int k;
482
+{
483
+ int n;
484
+
485
+ for (n = 0; n < k; n++)
486
+ fprintf(out, "%s0x%016llx%s", n == 0 || n % 3 ? "" : " ",
487
+ (unsigned long long)(table[n]),
488
+ n == k - 1 ? "" : (n % 3 == 2 ? ",\n" : ", "));
489
+}
490
+
491
+/* Actually do the deed. */
492
+int main()
493
+{
494
+ make_crc_table();
495
+ return 0;
175496
}
497
+
176498
#endif /* MAKECRCH */
499
+
500
+#ifdef W
501
+/*
502
+ Generate the little and big-endian braid tables for the given n and z_word_t
503
+ size w. Each array must have room for w blocks of 256 elements.
504
+ */
505
+local void braid(ltl, big, n, w)
506
+ z_crc_t ltl[][256];
507
+ z_word_t big[][256];
508
+ int n;
509
+ int w;
510
+{
511
+ int k;
512
+ z_crc_t i, p, q;
513
+ for (k = 0; k < w; k++) {
514
+ p = x2nmodp((n * w + 3 - k) << 3, 0);
515
+ ltl[k][0] = 0;
516
+ big[w - 1 - k][0] = 0;
517
+ for (i = 1; i < 256; i++) {
518
+ ltl[k][i] = q = multmodp(i << 24, p);
519
+ big[w - 1 - k][i] = byte_swap(q);
520
+ }
521
+ }
522
+}
523
+#endif
177524
178525
#else /* !DYNAMIC_CRC_TABLE */
179526
/* ========================================================================
180
- * Tables of CRC-32s of all single-byte values, made by make_crc_table().
527
+ * Tables for byte-wise and braided CRC-32 calculations, and a table of powers
528
+ * of x for combining CRC-32s, all made by make_crc_table().
181529
*/
182530
#include "crc32.h"
183531
#endif /* DYNAMIC_CRC_TABLE */
532
+
533
+/* ========================================================================
534
+ * Routines used for CRC calculation. Some are also required for the table
535
+ * generation above.
536
+ */
537
+
538
+/*
539
+ Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
540
+ reflected. For speed, this requires that a not be zero.
541
+ */
542
+local z_crc_t multmodp(a, b)
543
+ z_crc_t a;
544
+ z_crc_t b;
545
+{
546
+ z_crc_t m, p;
547
+
548
+ m = (z_crc_t)1 << 31;
549
+ p = 0;
550
+ for (;;) {
551
+ if (a & m) {
552
+ p ^= b;
553
+ if ((a & (m - 1)) == 0)
554
+ break;
555
+ }
556
+ m >>= 1;
557
+ b = b & 1 ? (b >> 1) ^ POLY : b >> 1;
558
+ }
559
+ return p;
560
+}
561
+
562
+/*
563
+ Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been
564
+ initialized.
565
+ */
566
+local z_crc_t x2nmodp(n, k)
567
+ z_off64_t n;
568
+ unsigned k;
569
+{
570
+ z_crc_t p;
571
+
572
+ p = (z_crc_t)1 << 31; /* x^0 == 1 */
573
+ while (n) {
574
+ if (n & 1)
575
+ p = multmodp(x2n_table[k & 31], p);
576
+ n >>= 1;
577
+ k++;
578
+ }
579
+ return p;
580
+}
184581
185582
/* =========================================================================
186
- * This function can be used by asm versions of crc32()
583
+ * This function can be used by asm versions of crc32(), and to force the
584
+ * generation of the CRC tables in a threaded application.
187585
*/
188586
const z_crc_t FAR * ZEXPORT get_crc_table()
189587
{
190588
#ifdef DYNAMIC_CRC_TABLE
191
- if (crc_table_empty)
192
- make_crc_table();
589
+ once(&made, make_crc_table);
193590
#endif /* DYNAMIC_CRC_TABLE */
194591
return (const z_crc_t FAR *)crc_table;
195592
}
196593
197
-/* ========================================================================= */
198
-#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
199
-#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
594
+/* =========================================================================
595
+ * Use ARM machine instructions if available. This will compute the CRC about
596
+ * ten times faster than the braided calculation. This code does not check for
597
+ * the presence of the CRC instruction at run time. __ARM_FEATURE_CRC32 will
598
+ * only be defined if the compilation specifies an ARM processor architecture
599
+ * that has the instructions. For example, compiling with -march=armv8.1-a or
600
+ * -march=armv8-a+crc, or -march=native if the compile machine has the crc32
601
+ * instructions.
602
+ */
603
+#ifdef ARMCRC32
604
+
605
+/*
606
+ Constants empirically determined to maximize speed. These values are from
607
+ measurements on a Cortex-A57. Your mileage may vary.
608
+ */
609
+#define Z_BATCH 3990 /* number of words in a batch */
610
+#define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */
611
+#define Z_BATCH_MIN 800 /* fewest words in a final batch */
612
+
613
+unsigned long ZEXPORT crc32_z(crc, buf, len)
614
+ unsigned long crc;
615
+ const unsigned char FAR *buf;
616
+ z_size_t len;
617
+{
618
+ z_crc_t val;
619
+ z_word_t crc1, crc2;
620
+ const z_word_t *word;
621
+ z_word_t val0, val1, val2;
622
+ z_size_t last, last2, i;
623
+ z_size_t num;
624
+
625
+ /* Return initial CRC, if requested. */
626
+ if (buf == Z_NULL) return 0;
627
+
628
+#ifdef DYNAMIC_CRC_TABLE
629
+ once(&made, make_crc_table);
630
+#endif /* DYNAMIC_CRC_TABLE */
631
+
632
+ /* Pre-condition the CRC */
633
+ crc ^= 0xffffffff;
634
+
635
+ /* Compute the CRC up to a word boundary. */
636
+ while (len && ((z_size_t)buf & 7) != 0) {
637
+ len--;
638
+ val = *buf++;
639
+ __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val));
640
+ }
641
+
642
+ /* Prepare to compute the CRC on full 64-bit words word[0..num-1]. */
643
+ word = (z_word_t const *)buf;
644
+ num = len >> 3;
645
+ len &= 7;
646
+
647
+ /* Do three interleaved CRCs to realize the throughput of one crc32x
648
+ instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
649
+ CRCs are combined into a single CRC after each set of batches. */
650
+ while (num >= 3 * Z_BATCH) {
651
+ crc1 = 0;
652
+ crc2 = 0;
653
+ for (i = 0; i < Z_BATCH; i++) {
654
+ val0 = word[i];
655
+ val1 = word[i + Z_BATCH];
656
+ val2 = word[i + 2 * Z_BATCH];
657
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0));
658
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1));
659
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2));
660
+ }
661
+ word += 3 * Z_BATCH;
662
+ num -= 3 * Z_BATCH;
663
+ crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc1;
664
+ crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc2;
665
+ }
666
+
667
+ /* Do one last smaller batch with the remaining words, if there are enough
668
+ to pay for the combination of CRCs. */
669
+ last = num / 3;
670
+ if (last >= Z_BATCH_MIN) {
671
+ last2 = last << 1;
672
+ crc1 = 0;
673
+ crc2 = 0;
674
+ for (i = 0; i < last; i++) {
675
+ val0 = word[i];
676
+ val1 = word[i + last];
677
+ val2 = word[i + last2];
678
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0));
679
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1));
680
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2));
681
+ }
682
+ word += 3 * last;
683
+ num -= 3 * last;
684
+ val = x2nmodp(last, 6);
685
+ crc = multmodp(val, crc) ^ crc1;
686
+ crc = multmodp(val, crc) ^ crc2;
687
+ }
688
+
689
+ /* Compute the CRC on any remaining words. */
690
+ for (i = 0; i < num; i++) {
691
+ val0 = word[i];
692
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0));
693
+ }
694
+ word += num;
695
+
696
+ /* Complete the CRC on any remaining bytes. */
697
+ buf = (const unsigned char FAR *)word;
698
+ while (len) {
699
+ len--;
700
+ val = *buf++;
701
+ __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val));
702
+ }
703
+
704
+ /* Return the CRC, post-conditioned. */
705
+ return crc ^ 0xffffffff;
706
+}
707
+
708
+#else
709
+
710
+#ifdef W
711
+
712
+/*
713
+ Return the CRC of the W bytes in the word_t data, taking the
714
+ least-significant byte of the word as the first byte of data, without any pre
715
+ or post conditioning. This is used to combine the CRCs of each braid.
716
+ */
717
+local z_crc_t crc_word(data)
718
+ z_word_t data;
719
+{
720
+ int k;
721
+ for (k = 0; k < W; k++)
722
+ data = (data >> 8) ^ crc_table[data & 0xff];
723
+ return (z_crc_t)data;
724
+}
725
+
726
+local z_word_t crc_word_big(data)
727
+ z_word_t data;
728
+{
729
+ int k;
730
+ for (k = 0; k < W; k++)
731
+ data = (data << 8) ^
732
+ crc_big_table[(data >> ((W - 1) << 3)) & 0xff];
733
+ return data;
734
+}
735
+
736
+#endif
200737
201738
/* ========================================================================= */
202739
unsigned long ZEXPORT crc32_z(crc, buf, len)
203740
unsigned long crc;
204741
const unsigned char FAR *buf;
205742
z_size_t len;
206743
{
207
- if (buf == Z_NULL) return 0UL;
744
+ /* Return initial CRC, if requested. */
745
+ if (buf == Z_NULL) return 0;
208746
209747
#ifdef DYNAMIC_CRC_TABLE
210
- if (crc_table_empty)
211
- make_crc_table();
748
+ once(&made, make_crc_table);
212749
#endif /* DYNAMIC_CRC_TABLE */
213750
214
-#ifdef BYFOUR
215
- if (sizeof(void *) == sizeof(ptrdiff_t)) {
216
- z_crc_t endian;
751
+ /* Pre-condition the CRC */
752
+ crc ^= 0xffffffff;
753
+
754
+#ifdef W
755
+
756
+ /* If provided enough bytes, do a braided CRC calculation. */
757
+ if (len >= N * W + W - 1) {
758
+ z_size_t blks;
759
+ z_word_t const *words;
760
+ unsigned endian;
761
+ int k;
762
+
763
+ /* Compute the CRC up to a z_word_t boundary. */
764
+ while (len && ((z_size_t)buf & (W - 1)) != 0) {
765
+ len--;
766
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
767
+ }
768
+
769
+ /* Compute the CRC on as many N z_word_t blocks as are available. */
770
+ blks = len / (N * W);
771
+ len -= blks * N * W;
772
+ words = (z_word_t const *)buf;
217773
774
+ /* Do endian check at execution time instead of compile time, since ARM
775
+ processors can change the endianess at execution time. If the
776
+ compiler knows what the endianess will be, it can optimize out the
777
+ check and the unused branch. */
218778
endian = 1;
219
- if (*((unsigned char *)(&endian)))
220
- return crc32_little(crc, buf, len);
221
- else
222
- return crc32_big(crc, buf, len);
223
- }
224
-#endif /* BYFOUR */
225
- crc = crc ^ 0xffffffffUL;
226
- while (len >= 8) {
227
- DO8;
779
+ if (*(unsigned char *)&endian) {
780
+ /* Little endian. */
781
+
782
+ z_crc_t crc0;
783
+ z_word_t word0;
784
+#if N > 1
785
+ z_crc_t crc1;
786
+ z_word_t word1;
787
+#if N > 2
788
+ z_crc_t crc2;
789
+ z_word_t word2;
790
+#if N > 3
791
+ z_crc_t crc3;
792
+ z_word_t word3;
793
+#if N > 4
794
+ z_crc_t crc4;
795
+ z_word_t word4;
796
+#if N > 5
797
+ z_crc_t crc5;
798
+ z_word_t word5;
799
+#endif
800
+#endif
801
+#endif
802
+#endif
803
+#endif
804
+
805
+ /* Initialize the CRC for each braid. */
806
+ crc0 = crc;
807
+#if N > 1
808
+ crc1 = 0;
809
+#if N > 2
810
+ crc2 = 0;
811
+#if N > 3
812
+ crc3 = 0;
813
+#if N > 4
814
+ crc4 = 0;
815
+#if N > 5
816
+ crc5 = 0;
817
+#endif
818
+#endif
819
+#endif
820
+#endif
821
+#endif
822
+
823
+ /*
824
+ Process the first blks-1 blocks, computing the CRCs on each braid
825
+ independently.
826
+ */
827
+ while (--blks) {
828
+ /* Load the word for each braid into registers. */
829
+ word0 = crc0 ^ words[0];
830
+#if N > 1
831
+ word1 = crc1 ^ words[1];
832
+#if N > 2
833
+ word2 = crc2 ^ words[2];
834
+#if N > 3
835
+ word3 = crc3 ^ words[3];
836
+#if N > 4
837
+ word4 = crc4 ^ words[4];
838
+#if N > 5
839
+ word5 = crc5 ^ words[5];
840
+#endif
841
+#endif
842
+#endif
843
+#endif
844
+#endif
845
+ words += N;
846
+
847
+ /* Compute and update the CRC for each word. The loop should
848
+ get unrolled. */
849
+ crc0 = crc_braid_table[0][word0 & 0xff];
850
+#if N > 1
851
+ crc1 = crc_braid_table[0][word1 & 0xff];
852
+#if N > 2
853
+ crc2 = crc_braid_table[0][word2 & 0xff];
854
+#if N > 3
855
+ crc3 = crc_braid_table[0][word3 & 0xff];
856
+#if N > 4
857
+ crc4 = crc_braid_table[0][word4 & 0xff];
858
+#if N > 5
859
+ crc5 = crc_braid_table[0][word5 & 0xff];
860
+#endif
861
+#endif
862
+#endif
863
+#endif
864
+#endif
865
+ for (k = 1; k < W; k++) {
866
+ crc0 ^= crc_braid_table[k][(word0 >> (k << 3)) & 0xff];
867
+#if N > 1
868
+ crc1 ^= crc_braid_table[k][(word1 >> (k << 3)) & 0xff];
869
+#if N > 2
870
+ crc2 ^= crc_braid_table[k][(word2 >> (k << 3)) & 0xff];
871
+#if N > 3
872
+ crc3 ^= crc_braid_table[k][(word3 >> (k << 3)) & 0xff];
873
+#if N > 4
874
+ crc4 ^= crc_braid_table[k][(word4 >> (k << 3)) & 0xff];
875
+#if N > 5
876
+ crc5 ^= crc_braid_table[k][(word5 >> (k << 3)) & 0xff];
877
+#endif
878
+#endif
879
+#endif
880
+#endif
881
+#endif
882
+ }
883
+ }
884
+
885
+ /*
886
+ Process the last block, combining the CRCs of the N braids at the
887
+ same time.
888
+ */
889
+ crc = crc_word(crc0 ^ words[0]);
890
+#if N > 1
891
+ crc = crc_word(crc1 ^ words[1] ^ crc);
892
+#if N > 2
893
+ crc = crc_word(crc2 ^ words[2] ^ crc);
894
+#if N > 3
895
+ crc = crc_word(crc3 ^ words[3] ^ crc);
896
+#if N > 4
897
+ crc = crc_word(crc4 ^ words[4] ^ crc);
898
+#if N > 5
899
+ crc = crc_word(crc5 ^ words[5] ^ crc);
900
+#endif
901
+#endif
902
+#endif
903
+#endif
904
+#endif
905
+ words += N;
906
+ }
907
+ else {
908
+ /* Big endian. */
909
+
910
+ z_word_t crc0, word0, comb;
911
+#if N > 1
912
+ z_word_t crc1, word1;
913
+#if N > 2
914
+ z_word_t crc2, word2;
915
+#if N > 3
916
+ z_word_t crc3, word3;
917
+#if N > 4
918
+ z_word_t crc4, word4;
919
+#if N > 5
920
+ z_word_t crc5, word5;
921
+#endif
922
+#endif
923
+#endif
924
+#endif
925
+#endif
926
+
927
+ /* Initialize the CRC for each braid. */
928
+ crc0 = byte_swap(crc);
929
+#if N > 1
930
+ crc1 = 0;
931
+#if N > 2
932
+ crc2 = 0;
933
+#if N > 3
934
+ crc3 = 0;
935
+#if N > 4
936
+ crc4 = 0;
937
+#if N > 5
938
+ crc5 = 0;
939
+#endif
940
+#endif
941
+#endif
942
+#endif
943
+#endif
944
+
945
+ /*
946
+ Process the first blks-1 blocks, computing the CRCs on each braid
947
+ independently.
948
+ */
949
+ while (--blks) {
950
+ /* Load the word for each braid into registers. */
951
+ word0 = crc0 ^ words[0];
952
+#if N > 1
953
+ word1 = crc1 ^ words[1];
954
+#if N > 2
955
+ word2 = crc2 ^ words[2];
956
+#if N > 3
957
+ word3 = crc3 ^ words[3];
958
+#if N > 4
959
+ word4 = crc4 ^ words[4];
960
+#if N > 5
961
+ word5 = crc5 ^ words[5];
962
+#endif
963
+#endif
964
+#endif
965
+#endif
966
+#endif
967
+ words += N;
968
+
969
+ /* Compute and update the CRC for each word. The loop should
970
+ get unrolled. */
971
+ crc0 = crc_braid_big_table[0][word0 & 0xff];
972
+#if N > 1
973
+ crc1 = crc_braid_big_table[0][word1 & 0xff];
974
+#if N > 2
975
+ crc2 = crc_braid_big_table[0][word2 & 0xff];
976
+#if N > 3
977
+ crc3 = crc_braid_big_table[0][word3 & 0xff];
978
+#if N > 4
979
+ crc4 = crc_braid_big_table[0][word4 & 0xff];
980
+#if N > 5
981
+ crc5 = crc_braid_big_table[0][word5 & 0xff];
982
+#endif
983
+#endif
984
+#endif
985
+#endif
986
+#endif
987
+ for (k = 1; k < W; k++) {
988
+ crc0 ^= crc_braid_big_table[k][(word0 >> (k << 3)) & 0xff];
989
+#if N > 1
990
+ crc1 ^= crc_braid_big_table[k][(word1 >> (k << 3)) & 0xff];
991
+#if N > 2
992
+ crc2 ^= crc_braid_big_table[k][(word2 >> (k << 3)) & 0xff];
993
+#if N > 3
994
+ crc3 ^= crc_braid_big_table[k][(word3 >> (k << 3)) & 0xff];
995
+#if N > 4
996
+ crc4 ^= crc_braid_big_table[k][(word4 >> (k << 3)) & 0xff];
997
+#if N > 5
998
+ crc5 ^= crc_braid_big_table[k][(word5 >> (k << 3)) & 0xff];
999
+#endif
1000
+#endif
1001
+#endif
1002
+#endif
1003
+#endif
1004
+ }
1005
+ }
1006
+
1007
+ /*
1008
+ Process the last block, combining the CRCs of the N braids at the
1009
+ same time.
1010
+ */
1011
+ comb = crc_word_big(crc0 ^ words[0]);
1012
+#if N > 1
1013
+ comb = crc_word_big(crc1 ^ words[1] ^ comb);
1014
+#if N > 2
1015
+ comb = crc_word_big(crc2 ^ words[2] ^ comb);
1016
+#if N > 3
1017
+ comb = crc_word_big(crc3 ^ words[3] ^ comb);
1018
+#if N > 4
1019
+ comb = crc_word_big(crc4 ^ words[4] ^ comb);
1020
+#if N > 5
1021
+ comb = crc_word_big(crc5 ^ words[5] ^ comb);
1022
+#endif
1023
+#endif
1024
+#endif
1025
+#endif
1026
+#endif
1027
+ words += N;
1028
+ crc = byte_swap(comb);
1029
+ }
1030
+
1031
+ /*
1032
+ Update the pointer to the remaining bytes to process.
1033
+ */
1034
+ buf = (unsigned char const *)words;
1035
+ }
1036
+
1037
+#endif /* W */
1038
+
1039
+ /* Complete the computation of the CRC on any remaining bytes. */
1040
+ while (len >= 8) {
2281041
len -= 8;
1042
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1043
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1044
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1045
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1046
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1047
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1048
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1049
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1050
+ }
1051
+ while (len) {
1052
+ len--;
1053
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
2291054
}
230
- if (len) do {
231
- DO1;
232
- } while (--len);
233
- return crc ^ 0xffffffffUL;
1055
+
1056
+ /* Return the CRC, post-conditioned. */
1057
+ return crc ^ 0xffffffff;
2341058
}
1059
+
1060
+#endif
2351061
2361062
/* ========================================================================= */
2371063
unsigned long ZEXPORT crc32(crc, buf, len)
2381064
unsigned long crc;
2391065
const unsigned char FAR *buf;
@@ -240,203 +1066,51 @@
2401066
uInt len;
2411067
{
2421068
return crc32_z(crc, buf, len);
2431069
}
2441070
245
-#ifdef BYFOUR
246
-
247
-/*
248
- This BYFOUR code accesses the passed unsigned char * buffer with a 32-bit
249
- integer pointer type. This violates the strict aliasing rule, where a
250
- compiler can assume, for optimization purposes, that two pointers to
251
- fundamentally different types won't ever point to the same memory. This can
252
- manifest as a problem only if one of the pointers is written to. This code
253
- only reads from those pointers. So long as this code remains isolated in
254
- this compilation unit, there won't be a problem. For this reason, this code
255
- should not be copied and pasted into a compilation unit in which other code
256
- writes to the buffer that is passed to these routines.
257
- */
258
-
259
-/* ========================================================================= */
260
-#define DOLIT4 c ^= *buf4++; \
261
- c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
262
- crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
263
-#define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
264
-
265
-/* ========================================================================= */
266
-local unsigned long crc32_little(crc, buf, len)
267
- unsigned long crc;
268
- const unsigned char FAR *buf;
269
- z_size_t len;
270
-{
271
- register z_crc_t c;
272
- register const z_crc_t FAR *buf4;
273
-
274
- c = (z_crc_t)crc;
275
- c = ~c;
276
- while (len && ((ptrdiff_t)buf & 3)) {
277
- c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
278
- len--;
279
- }
280
-
281
- buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
282
- while (len >= 32) {
283
- DOLIT32;
284
- len -= 32;
285
- }
286
- while (len >= 4) {
287
- DOLIT4;
288
- len -= 4;
289
- }
290
- buf = (const unsigned char FAR *)buf4;
291
-
292
- if (len) do {
293
- c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
294
- } while (--len);
295
- c = ~c;
296
- return (unsigned long)c;
297
-}
298
-
299
-/* ========================================================================= */
300
-#define DOBIG4 c ^= *buf4++; \
301
- c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
302
- crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
303
-#define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
304
-
305
-/* ========================================================================= */
306
-local unsigned long crc32_big(crc, buf, len)
307
- unsigned long crc;
308
- const unsigned char FAR *buf;
309
- z_size_t len;
310
-{
311
- register z_crc_t c;
312
- register const z_crc_t FAR *buf4;
313
-
314
- c = ZSWAP32((z_crc_t)crc);
315
- c = ~c;
316
- while (len && ((ptrdiff_t)buf & 3)) {
317
- c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
318
- len--;
319
- }
320
-
321
- buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
322
- while (len >= 32) {
323
- DOBIG32;
324
- len -= 32;
325
- }
326
- while (len >= 4) {
327
- DOBIG4;
328
- len -= 4;
329
- }
330
- buf = (const unsigned char FAR *)buf4;
331
-
332
- if (len) do {
333
- c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
334
- } while (--len);
335
- c = ~c;
336
- return (unsigned long)(ZSWAP32(c));
337
-}
338
-
339
-#endif /* BYFOUR */
340
-
341
-#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */
342
-
343
-/* ========================================================================= */
344
-local unsigned long gf2_matrix_times(mat, vec)
345
- unsigned long *mat;
346
- unsigned long vec;
347
-{
348
- unsigned long sum;
349
-
350
- sum = 0;
351
- while (vec) {
352
- if (vec & 1)
353
- sum ^= *mat;
354
- vec >>= 1;
355
- mat++;
356
- }
357
- return sum;
358
-}
359
-
360
-/* ========================================================================= */
361
-local void gf2_matrix_square(square, mat)
362
- unsigned long *square;
363
- unsigned long *mat;
364
-{
365
- int n;
366
-
367
- for (n = 0; n < GF2_DIM; n++)
368
- square[n] = gf2_matrix_times(mat, mat[n]);
369
-}
370
-
371
-/* ========================================================================= */
372
-local uLong crc32_combine_(crc1, crc2, len2)
1071
+/* ========================================================================= */
1072
+uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
3731073
uLong crc1;
3741074
uLong crc2;
3751075
z_off64_t len2;
3761076
{
377
- int n;
378
- unsigned long row;
379
- unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */
380
- unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */
381
-
382
- /* degenerate case (also disallow negative lengths) */
383
- if (len2 <= 0)
384
- return crc1;
385
-
386
- /* put operator for one zero bit in odd */
387
- odd[0] = 0xedb88320UL; /* CRC-32 polynomial */
388
- row = 1;
389
- for (n = 1; n < GF2_DIM; n++) {
390
- odd[n] = row;
391
- row <<= 1;
392
- }
393
-
394
- /* put operator for two zero bits in even */
395
- gf2_matrix_square(even, odd);
396
-
397
- /* put operator for four zero bits in odd */
398
- gf2_matrix_square(odd, even);
399
-
400
- /* apply len2 zeros to crc1 (first square will put the operator for one
401
- zero byte, eight zero bits, in even) */
402
- do {
403
- /* apply zeros operator for this bit of len2 */
404
- gf2_matrix_square(even, odd);
405
- if (len2 & 1)
406
- crc1 = gf2_matrix_times(even, crc1);
407
- len2 >>= 1;
408
-
409
- /* if no more bits set, then done */
410
- if (len2 == 0)
411
- break;
412
-
413
- /* another iteration of the loop with odd and even swapped */
414
- gf2_matrix_square(odd, even);
415
- if (len2 & 1)
416
- crc1 = gf2_matrix_times(odd, crc1);
417
- len2 >>= 1;
418
-
419
- /* if no more bits set, then done */
420
- } while (len2 != 0);
421
-
422
- /* return combined crc */
423
- crc1 ^= crc2;
424
- return crc1;
1077
+#ifdef DYNAMIC_CRC_TABLE
1078
+ once(&made, make_crc_table);
1079
+#endif /* DYNAMIC_CRC_TABLE */
1080
+ return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
4251081
}
4261082
4271083
/* ========================================================================= */
4281084
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
4291085
uLong crc1;
4301086
uLong crc2;
4311087
z_off_t len2;
4321088
{
433
- return crc32_combine_(crc1, crc2, len2);
1089
+ return crc32_combine64(crc1, crc2, len2);
4341090
}
4351091
436
-uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
437
- uLong crc1;
438
- uLong crc2;
1092
+/* ========================================================================= */
1093
+uLong ZEXPORT crc32_combine_gen64(len2)
4391094
z_off64_t len2;
4401095
{
441
- return crc32_combine_(crc1, crc2, len2);
1096
+#ifdef DYNAMIC_CRC_TABLE
1097
+ once(&made, make_crc_table);
1098
+#endif /* DYNAMIC_CRC_TABLE */
1099
+ return x2nmodp(len2, 3);
1100
+}
1101
+
1102
+/* ========================================================================= */
1103
+uLong ZEXPORT crc32_combine_gen(len2)
1104
+ z_off_t len2;
1105
+{
1106
+ return crc32_combine_gen64(len2);
1107
+}
1108
+
1109
+/* ========================================================================= */
1110
+uLong crc32_combine_op(crc1, crc2, op)
1111
+ uLong crc1;
1112
+ uLong crc2;
1113
+ uLong op;
1114
+{
1115
+ return multmodp(op, crc1) ^ crc2;
4421116
}
4431117
--- compat/zlib/crc32.c
+++ compat/zlib/crc32.c
@@ -1,239 +1,1065 @@
1 /* crc32.c -- compute the CRC-32 of a data stream
2 * Copyright (C) 1995-2006, 2010, 2011, 2012, 2016 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 *
5 * Thanks to Rodney Brown <[email protected]> for his contribution of faster
6 * CRC methods: exclusive-oring 32 bits of data at a time, and pre-computing
7 * tables for updating the shift register in one step with three exclusive-ors
8 * instead of four steps with four exclusive-ors. This results in about a
9 * factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
10 */
11
12 /* @(#) $Id$ */
13
14 /*
15 Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
16 protection on the static variables used to control the first-use generation
17 of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
18 first call get_crc_table() to initialize the tables before allowing more than
19 one thread to use crc32().
20
21 DYNAMIC_CRC_TABLE and MAKECRCH can be #defined to write out crc32.h.
 
22 */
23
24 #ifdef MAKECRCH
25 # include <stdio.h>
26 # ifndef DYNAMIC_CRC_TABLE
27 # define DYNAMIC_CRC_TABLE
28 # endif /* !DYNAMIC_CRC_TABLE */
29 #endif /* MAKECRCH */
30
31 #include "zutil.h" /* for STDC and FAR definitions */
32
33 /* Definitions for doing the crc four data bytes at a time. */
34 #if !defined(NOBYFOUR) && defined(Z_U4)
35 # define BYFOUR
36 #endif
37 #ifdef BYFOUR
38 local unsigned long crc32_little OF((unsigned long,
39 const unsigned char FAR *, z_size_t));
40 local unsigned long crc32_big OF((unsigned long,
41 const unsigned char FAR *, z_size_t));
42 # define TBLS 8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43 #else
44 # define TBLS 1
45 #endif /* BYFOUR */
46
47 /* Local functions for crc concatenation */
48 local unsigned long gf2_matrix_times OF((unsigned long *mat,
49 unsigned long vec));
50 local void gf2_matrix_square OF((unsigned long *square, unsigned long *mat));
51 local uLong crc32_combine_ OF((uLong crc1, uLong crc2, z_off64_t len2));
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
54 #ifdef DYNAMIC_CRC_TABLE
55
56 local volatile int crc_table_empty = 1;
57 local z_crc_t FAR crc_table[TBLS][256];
58 local void make_crc_table OF((void));
 
 
 
 
 
 
59 #ifdef MAKECRCH
60 local void write_table OF((FILE *, const z_crc_t FAR *));
 
 
61 #endif /* MAKECRCH */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62 /*
63 Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
64 x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
65
66 Polynomials over GF(2) are represented in binary, one bit per coefficient,
67 with the lowest powers in the most significant bit. Then adding polynomials
68 is just exclusive-or, and multiplying a polynomial by x is a right shift by
69 one. If we call the above polynomial p, and represent a byte as the
70 polynomial q, also with the lowest power in the most significant bit (so the
71 byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p,
72 where a mod b means the remainder after dividing a by b.
73
74 This calculation is done using the shift-register method of multiplying and
75 taking the remainder. The register is initialized to zero, and for each
76 incoming bit, x^32 is added mod p to the register if the bit is a one (where
77 x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by
78 x (which is shifting right by one and adding x^32 mod p if the bit shifted
79 out is a one). We start with the highest power (least significant bit) of
80 q and repeat for all eight bits of q.
81
82 The first table is simply the CRC of all possible eight bit values. This is
83 all the information needed to generate CRCs on data a byte at a time for all
84 combinations of CRC register values and incoming bytes. The remaining tables
85 allow for word-at-a-time CRC calculation for both big-endian and little-
86 endian machines, where a word is four bytes.
87 */
88 local void make_crc_table()
89 {
90 z_crc_t c;
91 int n, k;
92 z_crc_t poly; /* polynomial exclusive-or pattern */
93 /* terms of polynomial defining this crc (except x^32): */
94 static volatile int first = 1; /* flag to limit concurrent making */
95 static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
96
97 /* See if another task is already doing this (not thread-safe, but better
98 than nothing -- significantly reduces duration of vulnerability in
99 case the advice about DYNAMIC_CRC_TABLE is ignored) */
100 if (first) {
101 first = 0;
102
103 /* make exclusive-or pattern from polynomial (0xedb88320UL) */
104 poly = 0;
105 for (n = 0; n < (int)(sizeof(p)/sizeof(unsigned char)); n++)
106 poly |= (z_crc_t)1 << (31 - p[n]);
107
108 /* generate a crc for every 8-bit value */
109 for (n = 0; n < 256; n++) {
110 c = (z_crc_t)n;
111 for (k = 0; k < 8; k++)
112 c = c & 1 ? poly ^ (c >> 1) : c >> 1;
113 crc_table[0][n] = c;
114 }
115
116 #ifdef BYFOUR
117 /* generate crc for each value followed by one, two, and three zeros,
118 and then the byte reversal of those as well as the first table */
119 for (n = 0; n < 256; n++) {
120 c = crc_table[0][n];
121 crc_table[4][n] = ZSWAP32(c);
122 for (k = 1; k < 4; k++) {
123 c = crc_table[0][c & 0xff] ^ (c >> 8);
124 crc_table[k][n] = c;
125 crc_table[k + 4][n] = ZSWAP32(c);
126 }
127 }
128 #endif /* BYFOUR */
129
130 crc_table_empty = 0;
131 }
132 else { /* not first */
133 /* wait for the other guy to finish (not efficient, but rare) */
134 while (crc_table_empty)
135 ;
136 }
137
138 #ifdef MAKECRCH
139 /* write out CRC tables to crc32.h */
140 {
 
 
 
 
 
 
 
 
 
141 FILE *out;
 
 
 
142
143 out = fopen("crc32.h", "w");
144 if (out == NULL) return;
145 fprintf(out, "/* crc32.h -- tables for rapid CRC calculation\n");
146 fprintf(out, " * Generated automatically by crc32.c\n */\n\n");
147 fprintf(out, "local const z_crc_t FAR ");
148 fprintf(out, "crc_table[TBLS][256] =\n{\n {\n");
149 write_table(out, crc_table[0]);
150 # ifdef BYFOUR
151 fprintf(out, "#ifdef BYFOUR\n");
152 for (k = 1; k < 8; k++) {
153 fprintf(out, " },\n {\n");
154 write_table(out, crc_table[k]);
155 }
156 fprintf(out, "#endif\n");
157 # endif /* BYFOUR */
158 fprintf(out, " }\n};\n");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159 fclose(out);
160 }
161 #endif /* MAKECRCH */
162 }
163
164 #ifdef MAKECRCH
165 local void write_table(out, table)
 
 
 
 
 
166 FILE *out;
167 const z_crc_t FAR *table;
 
168 {
169 int n;
170
171 for (n = 0; n < 256; n++)
172 fprintf(out, "%s0x%08lxUL%s", n % 5 ? "" : " ",
173 (unsigned long)(table[n]),
174 n == 255 ? "\n" : (n % 5 == 4 ? ",\n" : ", "));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175 }
 
176 #endif /* MAKECRCH */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
178 #else /* !DYNAMIC_CRC_TABLE */
179 /* ========================================================================
180 * Tables of CRC-32s of all single-byte values, made by make_crc_table().
 
181 */
182 #include "crc32.h"
183 #endif /* DYNAMIC_CRC_TABLE */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
185 /* =========================================================================
186 * This function can be used by asm versions of crc32()
 
187 */
188 const z_crc_t FAR * ZEXPORT get_crc_table()
189 {
190 #ifdef DYNAMIC_CRC_TABLE
191 if (crc_table_empty)
192 make_crc_table();
193 #endif /* DYNAMIC_CRC_TABLE */
194 return (const z_crc_t FAR *)crc_table;
195 }
196
197 /* ========================================================================= */
198 #define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
199 #define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
201 /* ========================================================================= */
202 unsigned long ZEXPORT crc32_z(crc, buf, len)
203 unsigned long crc;
204 const unsigned char FAR *buf;
205 z_size_t len;
206 {
207 if (buf == Z_NULL) return 0UL;
 
208
209 #ifdef DYNAMIC_CRC_TABLE
210 if (crc_table_empty)
211 make_crc_table();
212 #endif /* DYNAMIC_CRC_TABLE */
213
214 #ifdef BYFOUR
215 if (sizeof(void *) == sizeof(ptrdiff_t)) {
216 z_crc_t endian;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
 
 
 
 
218 endian = 1;
219 if (*((unsigned char *)(&endian)))
220 return crc32_little(crc, buf, len);
221 else
222 return crc32_big(crc, buf, len);
223 }
224 #endif /* BYFOUR */
225 crc = crc ^ 0xffffffffUL;
226 while (len >= 8) {
227 DO8;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228 len -= 8;
 
 
 
 
 
 
 
 
 
 
 
 
229 }
230 if (len) do {
231 DO1;
232 } while (--len);
233 return crc ^ 0xffffffffUL;
234 }
 
 
235
236 /* ========================================================================= */
237 unsigned long ZEXPORT crc32(crc, buf, len)
238 unsigned long crc;
239 const unsigned char FAR *buf;
@@ -240,203 +1066,51 @@
240 uInt len;
241 {
242 return crc32_z(crc, buf, len);
243 }
244
245 #ifdef BYFOUR
246
247 /*
248 This BYFOUR code accesses the passed unsigned char * buffer with a 32-bit
249 integer pointer type. This violates the strict aliasing rule, where a
250 compiler can assume, for optimization purposes, that two pointers to
251 fundamentally different types won't ever point to the same memory. This can
252 manifest as a problem only if one of the pointers is written to. This code
253 only reads from those pointers. So long as this code remains isolated in
254 this compilation unit, there won't be a problem. For this reason, this code
255 should not be copied and pasted into a compilation unit in which other code
256 writes to the buffer that is passed to these routines.
257 */
258
259 /* ========================================================================= */
260 #define DOLIT4 c ^= *buf4++; \
261 c = crc_table[3][c & 0xff] ^ crc_table[2][(c >> 8) & 0xff] ^ \
262 crc_table[1][(c >> 16) & 0xff] ^ crc_table[0][c >> 24]
263 #define DOLIT32 DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4; DOLIT4
264
265 /* ========================================================================= */
266 local unsigned long crc32_little(crc, buf, len)
267 unsigned long crc;
268 const unsigned char FAR *buf;
269 z_size_t len;
270 {
271 register z_crc_t c;
272 register const z_crc_t FAR *buf4;
273
274 c = (z_crc_t)crc;
275 c = ~c;
276 while (len && ((ptrdiff_t)buf & 3)) {
277 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
278 len--;
279 }
280
281 buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
282 while (len >= 32) {
283 DOLIT32;
284 len -= 32;
285 }
286 while (len >= 4) {
287 DOLIT4;
288 len -= 4;
289 }
290 buf = (const unsigned char FAR *)buf4;
291
292 if (len) do {
293 c = crc_table[0][(c ^ *buf++) & 0xff] ^ (c >> 8);
294 } while (--len);
295 c = ~c;
296 return (unsigned long)c;
297 }
298
299 /* ========================================================================= */
300 #define DOBIG4 c ^= *buf4++; \
301 c = crc_table[4][c & 0xff] ^ crc_table[5][(c >> 8) & 0xff] ^ \
302 crc_table[6][(c >> 16) & 0xff] ^ crc_table[7][c >> 24]
303 #define DOBIG32 DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4; DOBIG4
304
305 /* ========================================================================= */
306 local unsigned long crc32_big(crc, buf, len)
307 unsigned long crc;
308 const unsigned char FAR *buf;
309 z_size_t len;
310 {
311 register z_crc_t c;
312 register const z_crc_t FAR *buf4;
313
314 c = ZSWAP32((z_crc_t)crc);
315 c = ~c;
316 while (len && ((ptrdiff_t)buf & 3)) {
317 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
318 len--;
319 }
320
321 buf4 = (const z_crc_t FAR *)(const void FAR *)buf;
322 while (len >= 32) {
323 DOBIG32;
324 len -= 32;
325 }
326 while (len >= 4) {
327 DOBIG4;
328 len -= 4;
329 }
330 buf = (const unsigned char FAR *)buf4;
331
332 if (len) do {
333 c = crc_table[4][(c >> 24) ^ *buf++] ^ (c << 8);
334 } while (--len);
335 c = ~c;
336 return (unsigned long)(ZSWAP32(c));
337 }
338
339 #endif /* BYFOUR */
340
341 #define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */
342
343 /* ========================================================================= */
344 local unsigned long gf2_matrix_times(mat, vec)
345 unsigned long *mat;
346 unsigned long vec;
347 {
348 unsigned long sum;
349
350 sum = 0;
351 while (vec) {
352 if (vec & 1)
353 sum ^= *mat;
354 vec >>= 1;
355 mat++;
356 }
357 return sum;
358 }
359
360 /* ========================================================================= */
361 local void gf2_matrix_square(square, mat)
362 unsigned long *square;
363 unsigned long *mat;
364 {
365 int n;
366
367 for (n = 0; n < GF2_DIM; n++)
368 square[n] = gf2_matrix_times(mat, mat[n]);
369 }
370
371 /* ========================================================================= */
372 local uLong crc32_combine_(crc1, crc2, len2)
373 uLong crc1;
374 uLong crc2;
375 z_off64_t len2;
376 {
377 int n;
378 unsigned long row;
379 unsigned long even[GF2_DIM]; /* even-power-of-two zeros operator */
380 unsigned long odd[GF2_DIM]; /* odd-power-of-two zeros operator */
381
382 /* degenerate case (also disallow negative lengths) */
383 if (len2 <= 0)
384 return crc1;
385
386 /* put operator for one zero bit in odd */
387 odd[0] = 0xedb88320UL; /* CRC-32 polynomial */
388 row = 1;
389 for (n = 1; n < GF2_DIM; n++) {
390 odd[n] = row;
391 row <<= 1;
392 }
393
394 /* put operator for two zero bits in even */
395 gf2_matrix_square(even, odd);
396
397 /* put operator for four zero bits in odd */
398 gf2_matrix_square(odd, even);
399
400 /* apply len2 zeros to crc1 (first square will put the operator for one
401 zero byte, eight zero bits, in even) */
402 do {
403 /* apply zeros operator for this bit of len2 */
404 gf2_matrix_square(even, odd);
405 if (len2 & 1)
406 crc1 = gf2_matrix_times(even, crc1);
407 len2 >>= 1;
408
409 /* if no more bits set, then done */
410 if (len2 == 0)
411 break;
412
413 /* another iteration of the loop with odd and even swapped */
414 gf2_matrix_square(odd, even);
415 if (len2 & 1)
416 crc1 = gf2_matrix_times(odd, crc1);
417 len2 >>= 1;
418
419 /* if no more bits set, then done */
420 } while (len2 != 0);
421
422 /* return combined crc */
423 crc1 ^= crc2;
424 return crc1;
425 }
426
427 /* ========================================================================= */
428 uLong ZEXPORT crc32_combine(crc1, crc2, len2)
429 uLong crc1;
430 uLong crc2;
431 z_off_t len2;
432 {
433 return crc32_combine_(crc1, crc2, len2);
434 }
435
436 uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
437 uLong crc1;
438 uLong crc2;
439 z_off64_t len2;
440 {
441 return crc32_combine_(crc1, crc2, len2);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442 }
443
--- compat/zlib/crc32.c
+++ compat/zlib/crc32.c
@@ -1,239 +1,1065 @@
1 /* crc32.c -- compute the CRC-32 of a data stream
2 * Copyright (C) 1995-2022 Mark Adler
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 *
5 * This interleaved implementation of a CRC makes use of pipelined multiple
6 * arithmetic-logic units, commonly found in modern CPU cores. It is due to
7 * Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution.
 
 
8 */
9
10 /* @(#) $Id$ */
11
12 /*
13 Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
14 protection on the static variables used to control the first-use generation
15 of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
16 first call get_crc_table() to initialize the tables before allowing more than
17 one thread to use crc32().
18
19 MAKECRCH can be #defined to write out crc32.h. A main() routine is also
20 produced, so that this one source file can be compiled to an executable.
21 */
22
23 #ifdef MAKECRCH
24 # include <stdio.h>
25 # ifndef DYNAMIC_CRC_TABLE
26 # define DYNAMIC_CRC_TABLE
27 # endif /* !DYNAMIC_CRC_TABLE */
28 #endif /* MAKECRCH */
29
30 #include "zutil.h" /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */
31
32 /*
33 A CRC of a message is computed on N braids of words in the message, where
34 each word consists of W bytes (4 or 8). If N is 3, for example, then three
35 running sparse CRCs are calculated respectively on each braid, at these
36 indices in the array of words: 0, 3, 6, ..., 1, 4, 7, ..., and 2, 5, 8, ...
37 This is done starting at a word boundary, and continues until as many blocks
38 of N * W bytes as are available have been processed. The results are combined
39 into a single CRC at the end. For this code, N must be in the range 1..6 and
40 W must be 4 or 8. The upper limit on N can be increased if desired by adding
41 more #if blocks, extending the patterns apparent in the code. In addition,
42 crc32.h would need to be regenerated, if the maximum N value is increased.
43
44 N and W are chosen empirically by benchmarking the execution time on a given
45 processor. The choices for N and W below were based on testing on Intel Kaby
46 Lake i7, AMD Ryzen 7, ARM Cortex-A57, Sparc64-VII, PowerPC POWER9, and MIPS64
47 Octeon II processors. The Intel, AMD, and ARM processors were all fastest
48 with N=5, W=8. The Sparc, PowerPC, and MIPS64 were all fastest at N=5, W=4.
49 They were all tested with either gcc or clang, all using the -O3 optimization
50 level. Your mileage may vary.
51 */
52
53 /* Define N */
54 #ifdef Z_TESTN
55 # define N Z_TESTN
56 #else
57 # define N 5
58 #endif
59 #if N < 1 || N > 6
60 # error N must be in 1..6
61 #endif
62
63 /*
64 z_crc_t must be at least 32 bits. z_word_t must be at least as long as
65 z_crc_t. It is assumed here that z_word_t is either 32 bits or 64 bits, and
66 that bytes are eight bits.
67 */
68
69 /*
70 Define W and the associated z_word_t type. If W is not defined, then a
71 braided calculation is not used, and the associated tables and code are not
72 compiled.
73 */
74 #ifdef Z_TESTW
75 # if Z_TESTW-1 != -1
76 # define W Z_TESTW
77 # endif
78 #else
79 # ifdef MAKECRCH
80 # define W 8 /* required for MAKECRCH */
81 # else
82 # if defined(__x86_64__) || defined(__aarch64__)
83 # define W 8
84 # else
85 # define W 4
86 # endif
87 # endif
88 #endif
89 #ifdef W
90 # if W == 8 && defined(Z_U8)
91 typedef Z_U8 z_word_t;
92 # elif defined(Z_U4)
93 # undef W
94 # define W 4
95 typedef Z_U4 z_word_t;
96 # else
97 # undef W
98 # endif
99 #endif
100
101 /* Local functions. */
102 local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
103 local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
104
105 /* If available, use the ARM processor CRC32 instruction. */
106 #if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
107 # define ARMCRC32
108 #endif
109
110 #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
111 /*
112 Swap the bytes in a z_word_t to convert between little and big endian. Any
113 self-respecting compiler will optimize this to a single machine byte-swap
114 instruction, if one is available. This assumes that word_t is either 32 bits
115 or 64 bits.
116 */
117 local z_word_t byte_swap(word)
118 z_word_t word;
119 {
120 # if W == 8
121 return
122 (word & 0xff00000000000000) >> 56 |
123 (word & 0xff000000000000) >> 40 |
124 (word & 0xff0000000000) >> 24 |
125 (word & 0xff00000000) >> 8 |
126 (word & 0xff000000) << 8 |
127 (word & 0xff0000) << 24 |
128 (word & 0xff00) << 40 |
129 (word & 0xff) << 56;
130 # else /* W == 4 */
131 return
132 (word & 0xff000000) >> 24 |
133 (word & 0xff0000) >> 8 |
134 (word & 0xff00) << 8 |
135 (word & 0xff) << 24;
136 # endif
137 }
138 #endif
139
140 /* CRC polynomial. */
141 #define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */
142
143 #ifdef DYNAMIC_CRC_TABLE
144
145 local z_crc_t FAR crc_table[256];
146 local z_crc_t FAR x2n_table[32];
147 local void make_crc_table OF((void));
148 #ifdef W
149 local z_word_t FAR crc_big_table[256];
150 local z_crc_t FAR crc_braid_table[W][256];
151 local z_word_t FAR crc_braid_big_table[W][256];
152 local void braid OF((z_crc_t [][256], z_word_t [][256], int, int));
153 #endif
154 #ifdef MAKECRCH
155 local void write_table OF((FILE *, const z_crc_t FAR *, int));
156 local void write_table32hi OF((FILE *, const z_word_t FAR *, int));
157 local void write_table64 OF((FILE *, const z_word_t FAR *, int));
158 #endif /* MAKECRCH */
159
160 /*
161 Define a once() function depending on the availability of atomics. If this is
162 compiled with DYNAMIC_CRC_TABLE defined, and if CRCs will be computed in
163 multiple threads, and if atomics are not available, then get_crc_table() must
164 be called to initialize the tables and must return before any threads are
165 allowed to compute or combine CRCs.
166 */
167
168 /* Definition of once functionality. */
169 typedef struct once_s once_t;
170 local void once OF((once_t *, void (*)(void)));
171
172 /* Check for the availability of atomics. */
173 #if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \
174 !defined(__STDC_NO_ATOMICS__)
175
176 #include <stdatomic.h>
177
178 /* Structure for once(), which must be initialized with ONCE_INIT. */
179 struct once_s {
180 atomic_flag begun;
181 atomic_int done;
182 };
183 #define ONCE_INIT {ATOMIC_FLAG_INIT, 0}
184
185 /*
186 Run the provided init() function exactly once, even if multiple threads
187 invoke once() at the same time. The state must be a once_t initialized with
188 ONCE_INIT.
189 */
190 local void once(state, init)
191 once_t *state;
192 void (*init)(void);
193 {
194 if (!atomic_load(&state->done)) {
195 if (atomic_flag_test_and_set(&state->begun))
196 while (!atomic_load(&state->done))
197 ;
198 else {
199 init();
200 atomic_store(&state->done, 1);
201 }
202 }
203 }
204
205 #else /* no atomics */
206
207 /* Structure for once(), which must be initialized with ONCE_INIT. */
208 struct once_s {
209 volatile int begun;
210 volatile int done;
211 };
212 #define ONCE_INIT {0, 0}
213
214 /* Test and set. Alas, not atomic, but tries to minimize the period of
215 vulnerability. */
216 local int test_and_set OF((int volatile *));
217 local int test_and_set(flag)
218 int volatile *flag;
219 {
220 int was;
221
222 was = *flag;
223 *flag = 1;
224 return was;
225 }
226
227 /* Run the provided init() function once. This is not thread-safe. */
228 local void once(state, init)
229 once_t *state;
230 void (*init)(void);
231 {
232 if (!state->done) {
233 if (test_and_set(&state->begun))
234 while (!state->done)
235 ;
236 else {
237 init();
238 state->done = 1;
239 }
240 }
241 }
242
243 #endif
244
245 /* State for once(). */
246 local once_t made = ONCE_INIT;
247
248 /*
249 Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
250 x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
251
252 Polynomials over GF(2) are represented in binary, one bit per coefficient,
253 with the lowest powers in the most significant bit. Then adding polynomials
254 is just exclusive-or, and multiplying a polynomial by x is a right shift by
255 one. If we call the above polynomial p, and represent a byte as the
256 polynomial q, also with the lowest power in the most significant bit (so the
257 byte 0xb1 is the polynomial x^7+x^3+x^2+1), then the CRC is (q*x^32) mod p,
258 where a mod b means the remainder after dividing a by b.
259
260 This calculation is done using the shift-register method of multiplying and
261 taking the remainder. The register is initialized to zero, and for each
262 incoming bit, x^32 is added mod p to the register if the bit is a one (where
263 x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by x
264 (which is shifting right by one and adding x^32 mod p if the bit shifted out
265 is a one). We start with the highest power (least significant bit) of q and
266 repeat for all eight bits of q.
267
268 The table is simply the CRC of all possible eight bit values. This is all the
269 information needed to generate CRCs on data a byte at a time for all
270 combinations of CRC register values and incoming bytes.
271 */
272
 
273 local void make_crc_table()
274 {
275 unsigned i, j, n;
276 z_crc_t p;
277
278 /* initialize the CRC of bytes tables */
279 for (i = 0; i < 256; i++) {
280 p = i;
281 for (j = 0; j < 8; j++)
282 p = p & 1 ? (p >> 1) ^ POLY : p >> 1;
283 crc_table[i] = p;
284 #ifdef W
285 crc_big_table[i] = byte_swap(p);
286 #endif
287 }
288
289 /* initialize the x^2^n mod p(x) table */
290 p = (z_crc_t)1 << 30; /* x^1 */
291 x2n_table[0] = p;
292 for (n = 1; n < 32; n++)
293 x2n_table[n] = p = multmodp(p, p);
294
295 #ifdef W
296 /* initialize the braiding tables -- needs x2n_table[] */
297 braid(crc_braid_table, crc_braid_big_table, N, W);
298 #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
300 #ifdef MAKECRCH
 
301 {
302 /*
303 The crc32.h header file contains tables for both 32-bit and 64-bit
304 z_word_t's, and so requires a 64-bit type be available. In that case,
305 z_word_t must be defined to be 64-bits. This code then also generates
306 and writes out the tables for the case that z_word_t is 32 bits.
307 */
308 #if !defined(W) || W != 8
309 # error Need a 64-bit integer type in order to generate crc32.h.
310 #endif
311 FILE *out;
312 int k, n;
313 z_crc_t ltl[8][256];
314 z_word_t big[8][256];
315
316 out = fopen("crc32.h", "w");
317 if (out == NULL) return;
318
319 /* write out little-endian CRC table to crc32.h */
320 fprintf(out,
321 "/* crc32.h -- tables for rapid CRC calculation\n"
322 " * Generated automatically by crc32.c\n */\n"
323 "\n"
324 "local const z_crc_t FAR crc_table[] = {\n"
325 " ");
326 write_table(out, crc_table, 256);
327 fprintf(out,
328 "};\n");
329
330 /* write out big-endian CRC table for 64-bit z_word_t to crc32.h */
331 fprintf(out,
332 "\n"
333 "#ifdef W\n"
334 "\n"
335 "#if W == 8\n"
336 "\n"
337 "local const z_word_t FAR crc_big_table[] = {\n"
338 " ");
339 write_table64(out, crc_big_table, 256);
340 fprintf(out,
341 "};\n");
342
343 /* write out big-endian CRC table for 32-bit z_word_t to crc32.h */
344 fprintf(out,
345 "\n"
346 "#else /* W == 4 */\n"
347 "\n"
348 "local const z_word_t FAR crc_big_table[] = {\n"
349 " ");
350 write_table32hi(out, crc_big_table, 256);
351 fprintf(out,
352 "};\n"
353 "\n"
354 "#endif\n");
355
356 /* write out braid tables for each value of N */
357 for (n = 1; n <= 6; n++) {
358 fprintf(out,
359 "\n"
360 "#if N == %d\n", n);
361
362 /* compute braid tables for this N and 64-bit word_t */
363 braid(ltl, big, n, 8);
364
365 /* write out braid tables for 64-bit z_word_t to crc32.h */
366 fprintf(out,
367 "\n"
368 "#if W == 8\n"
369 "\n"
370 "local const z_crc_t FAR crc_braid_table[][256] = {\n");
371 for (k = 0; k < 8; k++) {
372 fprintf(out, " {");
373 write_table(out, ltl[k], 256);
374 fprintf(out, "}%s", k < 7 ? ",\n" : "");
375 }
376 fprintf(out,
377 "};\n"
378 "\n"
379 "local const z_word_t FAR crc_braid_big_table[][256] = {\n");
380 for (k = 0; k < 8; k++) {
381 fprintf(out, " {");
382 write_table64(out, big[k], 256);
383 fprintf(out, "}%s", k < 7 ? ",\n" : "");
384 }
385 fprintf(out,
386 "};\n");
387
388 /* compute braid tables for this N and 32-bit word_t */
389 braid(ltl, big, n, 4);
390
391 /* write out braid tables for 32-bit z_word_t to crc32.h */
392 fprintf(out,
393 "\n"
394 "#else /* W == 4 */\n"
395 "\n"
396 "local const z_crc_t FAR crc_braid_table[][256] = {\n");
397 for (k = 0; k < 4; k++) {
398 fprintf(out, " {");
399 write_table(out, ltl[k], 256);
400 fprintf(out, "}%s", k < 3 ? ",\n" : "");
401 }
402 fprintf(out,
403 "};\n"
404 "\n"
405 "local const z_word_t FAR crc_braid_big_table[][256] = {\n");
406 for (k = 0; k < 4; k++) {
407 fprintf(out, " {");
408 write_table32hi(out, big[k], 256);
409 fprintf(out, "}%s", k < 3 ? ",\n" : "");
410 }
411 fprintf(out,
412 "};\n"
413 "\n"
414 "#endif\n"
415 "\n"
416 "#endif\n");
417 }
418 fprintf(out,
419 "\n"
420 "#endif\n");
421
422 /* write out zeros operator table to crc32.h */
423 fprintf(out,
424 "\n"
425 "local const z_crc_t FAR x2n_table[] = {\n"
426 " ");
427 write_table(out, x2n_table, 32);
428 fprintf(out,
429 "};\n");
430 fclose(out);
431 }
432 #endif /* MAKECRCH */
433 }
434
435 #ifdef MAKECRCH
436
437 /*
438 Write the 32-bit values in table[0..k-1] to out, five per line in
439 hexadecimal separated by commas.
440 */
441 local void write_table(out, table, k)
442 FILE *out;
443 const z_crc_t FAR *table;
444 int k;
445 {
446 int n;
447
448 for (n = 0; n < k; n++)
449 fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ",
450 (unsigned long)(table[n]),
451 n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", "));
452 }
453
454 /*
455 Write the high 32-bits of each value in table[0..k-1] to out, five per line
456 in hexadecimal separated by commas.
457 */
458 local void write_table32hi(out, table, k)
459 FILE *out;
460 const z_word_t FAR *table;
461 int k;
462 {
463 int n;
464
465 for (n = 0; n < k; n++)
466 fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ",
467 (unsigned long)(table[n] >> 32),
468 n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", "));
469 }
470
471 /*
472 Write the 64-bit values in table[0..k-1] to out, three per line in
473 hexadecimal separated by commas. This assumes that if there is a 64-bit
474 type, then there is also a long long integer type, and it is at least 64
475 bits. If not, then the type cast and format string can be adjusted
476 accordingly.
477 */
478 local void write_table64(out, table, k)
479 FILE *out;
480 const z_word_t FAR *table;
481 int k;
482 {
483 int n;
484
485 for (n = 0; n < k; n++)
486 fprintf(out, "%s0x%016llx%s", n == 0 || n % 3 ? "" : " ",
487 (unsigned long long)(table[n]),
488 n == k - 1 ? "" : (n % 3 == 2 ? ",\n" : ", "));
489 }
490
491 /* Actually do the deed. */
492 int main()
493 {
494 make_crc_table();
495 return 0;
496 }
497
498 #endif /* MAKECRCH */
499
500 #ifdef W
501 /*
502 Generate the little and big-endian braid tables for the given n and z_word_t
503 size w. Each array must have room for w blocks of 256 elements.
504 */
505 local void braid(ltl, big, n, w)
506 z_crc_t ltl[][256];
507 z_word_t big[][256];
508 int n;
509 int w;
510 {
511 int k;
512 z_crc_t i, p, q;
513 for (k = 0; k < w; k++) {
514 p = x2nmodp((n * w + 3 - k) << 3, 0);
515 ltl[k][0] = 0;
516 big[w - 1 - k][0] = 0;
517 for (i = 1; i < 256; i++) {
518 ltl[k][i] = q = multmodp(i << 24, p);
519 big[w - 1 - k][i] = byte_swap(q);
520 }
521 }
522 }
523 #endif
524
525 #else /* !DYNAMIC_CRC_TABLE */
526 /* ========================================================================
527 * Tables for byte-wise and braided CRC-32 calculations, and a table of powers
528 * of x for combining CRC-32s, all made by make_crc_table().
529 */
530 #include "crc32.h"
531 #endif /* DYNAMIC_CRC_TABLE */
532
533 /* ========================================================================
534 * Routines used for CRC calculation. Some are also required for the table
535 * generation above.
536 */
537
538 /*
539 Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
540 reflected. For speed, this requires that a not be zero.
541 */
542 local z_crc_t multmodp(a, b)
543 z_crc_t a;
544 z_crc_t b;
545 {
546 z_crc_t m, p;
547
548 m = (z_crc_t)1 << 31;
549 p = 0;
550 for (;;) {
551 if (a & m) {
552 p ^= b;
553 if ((a & (m - 1)) == 0)
554 break;
555 }
556 m >>= 1;
557 b = b & 1 ? (b >> 1) ^ POLY : b >> 1;
558 }
559 return p;
560 }
561
562 /*
563 Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been
564 initialized.
565 */
566 local z_crc_t x2nmodp(n, k)
567 z_off64_t n;
568 unsigned k;
569 {
570 z_crc_t p;
571
572 p = (z_crc_t)1 << 31; /* x^0 == 1 */
573 while (n) {
574 if (n & 1)
575 p = multmodp(x2n_table[k & 31], p);
576 n >>= 1;
577 k++;
578 }
579 return p;
580 }
581
582 /* =========================================================================
583 * This function can be used by asm versions of crc32(), and to force the
584 * generation of the CRC tables in a threaded application.
585 */
586 const z_crc_t FAR * ZEXPORT get_crc_table()
587 {
588 #ifdef DYNAMIC_CRC_TABLE
589 once(&made, make_crc_table);
 
590 #endif /* DYNAMIC_CRC_TABLE */
591 return (const z_crc_t FAR *)crc_table;
592 }
593
594 /* =========================================================================
595 * Use ARM machine instructions if available. This will compute the CRC about
596 * ten times faster than the braided calculation. This code does not check for
597 * the presence of the CRC instruction at run time. __ARM_FEATURE_CRC32 will
598 * only be defined if the compilation specifies an ARM processor architecture
599 * that has the instructions. For example, compiling with -march=armv8.1-a or
600 * -march=armv8-a+crc, or -march=native if the compile machine has the crc32
601 * instructions.
602 */
603 #ifdef ARMCRC32
604
605 /*
606 Constants empirically determined to maximize speed. These values are from
607 measurements on a Cortex-A57. Your mileage may vary.
608 */
609 #define Z_BATCH 3990 /* number of words in a batch */
610 #define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */
611 #define Z_BATCH_MIN 800 /* fewest words in a final batch */
612
613 unsigned long ZEXPORT crc32_z(crc, buf, len)
614 unsigned long crc;
615 const unsigned char FAR *buf;
616 z_size_t len;
617 {
618 z_crc_t val;
619 z_word_t crc1, crc2;
620 const z_word_t *word;
621 z_word_t val0, val1, val2;
622 z_size_t last, last2, i;
623 z_size_t num;
624
625 /* Return initial CRC, if requested. */
626 if (buf == Z_NULL) return 0;
627
628 #ifdef DYNAMIC_CRC_TABLE
629 once(&made, make_crc_table);
630 #endif /* DYNAMIC_CRC_TABLE */
631
632 /* Pre-condition the CRC */
633 crc ^= 0xffffffff;
634
635 /* Compute the CRC up to a word boundary. */
636 while (len && ((z_size_t)buf & 7) != 0) {
637 len--;
638 val = *buf++;
639 __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val));
640 }
641
642 /* Prepare to compute the CRC on full 64-bit words word[0..num-1]. */
643 word = (z_word_t const *)buf;
644 num = len >> 3;
645 len &= 7;
646
647 /* Do three interleaved CRCs to realize the throughput of one crc32x
648 instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
649 CRCs are combined into a single CRC after each set of batches. */
650 while (num >= 3 * Z_BATCH) {
651 crc1 = 0;
652 crc2 = 0;
653 for (i = 0; i < Z_BATCH; i++) {
654 val0 = word[i];
655 val1 = word[i + Z_BATCH];
656 val2 = word[i + 2 * Z_BATCH];
657 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0));
658 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1));
659 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2));
660 }
661 word += 3 * Z_BATCH;
662 num -= 3 * Z_BATCH;
663 crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc1;
664 crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc2;
665 }
666
667 /* Do one last smaller batch with the remaining words, if there are enough
668 to pay for the combination of CRCs. */
669 last = num / 3;
670 if (last >= Z_BATCH_MIN) {
671 last2 = last << 1;
672 crc1 = 0;
673 crc2 = 0;
674 for (i = 0; i < last; i++) {
675 val0 = word[i];
676 val1 = word[i + last];
677 val2 = word[i + last2];
678 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0));
679 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1));
680 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2));
681 }
682 word += 3 * last;
683 num -= 3 * last;
684 val = x2nmodp(last, 6);
685 crc = multmodp(val, crc) ^ crc1;
686 crc = multmodp(val, crc) ^ crc2;
687 }
688
689 /* Compute the CRC on any remaining words. */
690 for (i = 0; i < num; i++) {
691 val0 = word[i];
692 __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0));
693 }
694 word += num;
695
696 /* Complete the CRC on any remaining bytes. */
697 buf = (const unsigned char FAR *)word;
698 while (len) {
699 len--;
700 val = *buf++;
701 __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val));
702 }
703
704 /* Return the CRC, post-conditioned. */
705 return crc ^ 0xffffffff;
706 }
707
708 #else
709
710 #ifdef W
711
712 /*
713 Return the CRC of the W bytes in the word_t data, taking the
714 least-significant byte of the word as the first byte of data, without any pre
715 or post conditioning. This is used to combine the CRCs of each braid.
716 */
717 local z_crc_t crc_word(data)
718 z_word_t data;
719 {
720 int k;
721 for (k = 0; k < W; k++)
722 data = (data >> 8) ^ crc_table[data & 0xff];
723 return (z_crc_t)data;
724 }
725
726 local z_word_t crc_word_big(data)
727 z_word_t data;
728 {
729 int k;
730 for (k = 0; k < W; k++)
731 data = (data << 8) ^
732 crc_big_table[(data >> ((W - 1) << 3)) & 0xff];
733 return data;
734 }
735
736 #endif
737
738 /* ========================================================================= */
739 unsigned long ZEXPORT crc32_z(crc, buf, len)
740 unsigned long crc;
741 const unsigned char FAR *buf;
742 z_size_t len;
743 {
744 /* Return initial CRC, if requested. */
745 if (buf == Z_NULL) return 0;
746
747 #ifdef DYNAMIC_CRC_TABLE
748 once(&made, make_crc_table);
 
749 #endif /* DYNAMIC_CRC_TABLE */
750
751 /* Pre-condition the CRC */
752 crc ^= 0xffffffff;
753
754 #ifdef W
755
756 /* If provided enough bytes, do a braided CRC calculation. */
757 if (len >= N * W + W - 1) {
758 z_size_t blks;
759 z_word_t const *words;
760 unsigned endian;
761 int k;
762
763 /* Compute the CRC up to a z_word_t boundary. */
764 while (len && ((z_size_t)buf & (W - 1)) != 0) {
765 len--;
766 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
767 }
768
769 /* Compute the CRC on as many N z_word_t blocks as are available. */
770 blks = len / (N * W);
771 len -= blks * N * W;
772 words = (z_word_t const *)buf;
773
774 /* Do endian check at execution time instead of compile time, since ARM
775 processors can change the endianess at execution time. If the
776 compiler knows what the endianess will be, it can optimize out the
777 check and the unused branch. */
778 endian = 1;
779 if (*(unsigned char *)&endian) {
780 /* Little endian. */
781
782 z_crc_t crc0;
783 z_word_t word0;
784 #if N > 1
785 z_crc_t crc1;
786 z_word_t word1;
787 #if N > 2
788 z_crc_t crc2;
789 z_word_t word2;
790 #if N > 3
791 z_crc_t crc3;
792 z_word_t word3;
793 #if N > 4
794 z_crc_t crc4;
795 z_word_t word4;
796 #if N > 5
797 z_crc_t crc5;
798 z_word_t word5;
799 #endif
800 #endif
801 #endif
802 #endif
803 #endif
804
805 /* Initialize the CRC for each braid. */
806 crc0 = crc;
807 #if N > 1
808 crc1 = 0;
809 #if N > 2
810 crc2 = 0;
811 #if N > 3
812 crc3 = 0;
813 #if N > 4
814 crc4 = 0;
815 #if N > 5
816 crc5 = 0;
817 #endif
818 #endif
819 #endif
820 #endif
821 #endif
822
823 /*
824 Process the first blks-1 blocks, computing the CRCs on each braid
825 independently.
826 */
827 while (--blks) {
828 /* Load the word for each braid into registers. */
829 word0 = crc0 ^ words[0];
830 #if N > 1
831 word1 = crc1 ^ words[1];
832 #if N > 2
833 word2 = crc2 ^ words[2];
834 #if N > 3
835 word3 = crc3 ^ words[3];
836 #if N > 4
837 word4 = crc4 ^ words[4];
838 #if N > 5
839 word5 = crc5 ^ words[5];
840 #endif
841 #endif
842 #endif
843 #endif
844 #endif
845 words += N;
846
847 /* Compute and update the CRC for each word. The loop should
848 get unrolled. */
849 crc0 = crc_braid_table[0][word0 & 0xff];
850 #if N > 1
851 crc1 = crc_braid_table[0][word1 & 0xff];
852 #if N > 2
853 crc2 = crc_braid_table[0][word2 & 0xff];
854 #if N > 3
855 crc3 = crc_braid_table[0][word3 & 0xff];
856 #if N > 4
857 crc4 = crc_braid_table[0][word4 & 0xff];
858 #if N > 5
859 crc5 = crc_braid_table[0][word5 & 0xff];
860 #endif
861 #endif
862 #endif
863 #endif
864 #endif
865 for (k = 1; k < W; k++) {
866 crc0 ^= crc_braid_table[k][(word0 >> (k << 3)) & 0xff];
867 #if N > 1
868 crc1 ^= crc_braid_table[k][(word1 >> (k << 3)) & 0xff];
869 #if N > 2
870 crc2 ^= crc_braid_table[k][(word2 >> (k << 3)) & 0xff];
871 #if N > 3
872 crc3 ^= crc_braid_table[k][(word3 >> (k << 3)) & 0xff];
873 #if N > 4
874 crc4 ^= crc_braid_table[k][(word4 >> (k << 3)) & 0xff];
875 #if N > 5
876 crc5 ^= crc_braid_table[k][(word5 >> (k << 3)) & 0xff];
877 #endif
878 #endif
879 #endif
880 #endif
881 #endif
882 }
883 }
884
885 /*
886 Process the last block, combining the CRCs of the N braids at the
887 same time.
888 */
889 crc = crc_word(crc0 ^ words[0]);
890 #if N > 1
891 crc = crc_word(crc1 ^ words[1] ^ crc);
892 #if N > 2
893 crc = crc_word(crc2 ^ words[2] ^ crc);
894 #if N > 3
895 crc = crc_word(crc3 ^ words[3] ^ crc);
896 #if N > 4
897 crc = crc_word(crc4 ^ words[4] ^ crc);
898 #if N > 5
899 crc = crc_word(crc5 ^ words[5] ^ crc);
900 #endif
901 #endif
902 #endif
903 #endif
904 #endif
905 words += N;
906 }
907 else {
908 /* Big endian. */
909
910 z_word_t crc0, word0, comb;
911 #if N > 1
912 z_word_t crc1, word1;
913 #if N > 2
914 z_word_t crc2, word2;
915 #if N > 3
916 z_word_t crc3, word3;
917 #if N > 4
918 z_word_t crc4, word4;
919 #if N > 5
920 z_word_t crc5, word5;
921 #endif
922 #endif
923 #endif
924 #endif
925 #endif
926
927 /* Initialize the CRC for each braid. */
928 crc0 = byte_swap(crc);
929 #if N > 1
930 crc1 = 0;
931 #if N > 2
932 crc2 = 0;
933 #if N > 3
934 crc3 = 0;
935 #if N > 4
936 crc4 = 0;
937 #if N > 5
938 crc5 = 0;
939 #endif
940 #endif
941 #endif
942 #endif
943 #endif
944
945 /*
946 Process the first blks-1 blocks, computing the CRCs on each braid
947 independently.
948 */
949 while (--blks) {
950 /* Load the word for each braid into registers. */
951 word0 = crc0 ^ words[0];
952 #if N > 1
953 word1 = crc1 ^ words[1];
954 #if N > 2
955 word2 = crc2 ^ words[2];
956 #if N > 3
957 word3 = crc3 ^ words[3];
958 #if N > 4
959 word4 = crc4 ^ words[4];
960 #if N > 5
961 word5 = crc5 ^ words[5];
962 #endif
963 #endif
964 #endif
965 #endif
966 #endif
967 words += N;
968
969 /* Compute and update the CRC for each word. The loop should
970 get unrolled. */
971 crc0 = crc_braid_big_table[0][word0 & 0xff];
972 #if N > 1
973 crc1 = crc_braid_big_table[0][word1 & 0xff];
974 #if N > 2
975 crc2 = crc_braid_big_table[0][word2 & 0xff];
976 #if N > 3
977 crc3 = crc_braid_big_table[0][word3 & 0xff];
978 #if N > 4
979 crc4 = crc_braid_big_table[0][word4 & 0xff];
980 #if N > 5
981 crc5 = crc_braid_big_table[0][word5 & 0xff];
982 #endif
983 #endif
984 #endif
985 #endif
986 #endif
987 for (k = 1; k < W; k++) {
988 crc0 ^= crc_braid_big_table[k][(word0 >> (k << 3)) & 0xff];
989 #if N > 1
990 crc1 ^= crc_braid_big_table[k][(word1 >> (k << 3)) & 0xff];
991 #if N > 2
992 crc2 ^= crc_braid_big_table[k][(word2 >> (k << 3)) & 0xff];
993 #if N > 3
994 crc3 ^= crc_braid_big_table[k][(word3 >> (k << 3)) & 0xff];
995 #if N > 4
996 crc4 ^= crc_braid_big_table[k][(word4 >> (k << 3)) & 0xff];
997 #if N > 5
998 crc5 ^= crc_braid_big_table[k][(word5 >> (k << 3)) & 0xff];
999 #endif
1000 #endif
1001 #endif
1002 #endif
1003 #endif
1004 }
1005 }
1006
1007 /*
1008 Process the last block, combining the CRCs of the N braids at the
1009 same time.
1010 */
1011 comb = crc_word_big(crc0 ^ words[0]);
1012 #if N > 1
1013 comb = crc_word_big(crc1 ^ words[1] ^ comb);
1014 #if N > 2
1015 comb = crc_word_big(crc2 ^ words[2] ^ comb);
1016 #if N > 3
1017 comb = crc_word_big(crc3 ^ words[3] ^ comb);
1018 #if N > 4
1019 comb = crc_word_big(crc4 ^ words[4] ^ comb);
1020 #if N > 5
1021 comb = crc_word_big(crc5 ^ words[5] ^ comb);
1022 #endif
1023 #endif
1024 #endif
1025 #endif
1026 #endif
1027 words += N;
1028 crc = byte_swap(comb);
1029 }
1030
1031 /*
1032 Update the pointer to the remaining bytes to process.
1033 */
1034 buf = (unsigned char const *)words;
1035 }
1036
1037 #endif /* W */
1038
1039 /* Complete the computation of the CRC on any remaining bytes. */
1040 while (len >= 8) {
1041 len -= 8;
1042 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1043 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1044 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1045 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1046 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1047 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1048 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1049 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1050 }
1051 while (len) {
1052 len--;
1053 crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
1054 }
1055
1056 /* Return the CRC, post-conditioned. */
1057 return crc ^ 0xffffffff;
 
1058 }
1059
1060 #endif
1061
1062 /* ========================================================================= */
1063 unsigned long ZEXPORT crc32(crc, buf, len)
1064 unsigned long crc;
1065 const unsigned char FAR *buf;
@@ -240,203 +1066,51 @@
1066 uInt len;
1067 {
1068 return crc32_z(crc, buf, len);
1069 }
1070
1071 /* ========================================================================= */
1072 uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1073 uLong crc1;
1074 uLong crc2;
1075 z_off64_t len2;
1076 {
1077 #ifdef DYNAMIC_CRC_TABLE
1078 once(&made, make_crc_table);
1079 #endif /* DYNAMIC_CRC_TABLE */
1080 return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1081 }
1082
1083 /* ========================================================================= */
1084 uLong ZEXPORT crc32_combine(crc1, crc2, len2)
1085 uLong crc1;
1086 uLong crc2;
1087 z_off_t len2;
1088 {
1089 return crc32_combine64(crc1, crc2, len2);
1090 }
1091
1092 /* ========================================================================= */
1093 uLong ZEXPORT crc32_combine_gen64(len2)
 
1094 z_off64_t len2;
1095 {
1096 #ifdef DYNAMIC_CRC_TABLE
1097 once(&made, make_crc_table);
1098 #endif /* DYNAMIC_CRC_TABLE */
1099 return x2nmodp(len2, 3);
1100 }
1101
1102 /* ========================================================================= */
1103 uLong ZEXPORT crc32_combine_gen(len2)
1104 z_off_t len2;
1105 {
1106 return crc32_combine_gen64(len2);
1107 }
1108
1109 /* ========================================================================= */
1110 uLong crc32_combine_op(crc1, crc2, op)
1111 uLong crc1;
1112 uLong crc2;
1113 uLong op;
1114 {
1115 return multmodp(op, crc1) ^ crc2;
1116 }
1117
+9441 -436
--- compat/zlib/crc32.h
+++ compat/zlib/crc32.h
@@ -1,441 +1,9446 @@
11
/* crc32.h -- tables for rapid CRC calculation
22
* Generated automatically by crc32.c
33
*/
44
5
-local const z_crc_t FAR crc_table[TBLS][256] =
6
-{
7
- {
8
- 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL,
9
- 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL,
10
- 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL,
11
- 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL,
12
- 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL,
13
- 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL,
14
- 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL,
15
- 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL,
16
- 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL,
17
- 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL,
18
- 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL,
19
- 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL,
20
- 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL,
21
- 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL,
22
- 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL,
23
- 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL,
24
- 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL,
25
- 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL,
26
- 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL,
27
- 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL,
28
- 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL,
29
- 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL,
30
- 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL,
31
- 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL,
32
- 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL,
33
- 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL,
34
- 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL,
35
- 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL,
36
- 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL,
37
- 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL,
38
- 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL,
39
- 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL,
40
- 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL,
41
- 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL,
42
- 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL,
43
- 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL,
44
- 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL,
45
- 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL,
46
- 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL,
47
- 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL,
48
- 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL,
49
- 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL,
50
- 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL,
51
- 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL,
52
- 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL,
53
- 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL,
54
- 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL,
55
- 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL,
56
- 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL,
57
- 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL,
58
- 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL,
59
- 0x2d02ef8dUL
60
-#ifdef BYFOUR
61
- },
62
- {
63
- 0x00000000UL, 0x191b3141UL, 0x32366282UL, 0x2b2d53c3UL, 0x646cc504UL,
64
- 0x7d77f445UL, 0x565aa786UL, 0x4f4196c7UL, 0xc8d98a08UL, 0xd1c2bb49UL,
65
- 0xfaefe88aUL, 0xe3f4d9cbUL, 0xacb54f0cUL, 0xb5ae7e4dUL, 0x9e832d8eUL,
66
- 0x87981ccfUL, 0x4ac21251UL, 0x53d92310UL, 0x78f470d3UL, 0x61ef4192UL,
67
- 0x2eaed755UL, 0x37b5e614UL, 0x1c98b5d7UL, 0x05838496UL, 0x821b9859UL,
68
- 0x9b00a918UL, 0xb02dfadbUL, 0xa936cb9aUL, 0xe6775d5dUL, 0xff6c6c1cUL,
69
- 0xd4413fdfUL, 0xcd5a0e9eUL, 0x958424a2UL, 0x8c9f15e3UL, 0xa7b24620UL,
70
- 0xbea97761UL, 0xf1e8e1a6UL, 0xe8f3d0e7UL, 0xc3de8324UL, 0xdac5b265UL,
71
- 0x5d5daeaaUL, 0x44469febUL, 0x6f6bcc28UL, 0x7670fd69UL, 0x39316baeUL,
72
- 0x202a5aefUL, 0x0b07092cUL, 0x121c386dUL, 0xdf4636f3UL, 0xc65d07b2UL,
73
- 0xed705471UL, 0xf46b6530UL, 0xbb2af3f7UL, 0xa231c2b6UL, 0x891c9175UL,
74
- 0x9007a034UL, 0x179fbcfbUL, 0x0e848dbaUL, 0x25a9de79UL, 0x3cb2ef38UL,
75
- 0x73f379ffUL, 0x6ae848beUL, 0x41c51b7dUL, 0x58de2a3cUL, 0xf0794f05UL,
76
- 0xe9627e44UL, 0xc24f2d87UL, 0xdb541cc6UL, 0x94158a01UL, 0x8d0ebb40UL,
77
- 0xa623e883UL, 0xbf38d9c2UL, 0x38a0c50dUL, 0x21bbf44cUL, 0x0a96a78fUL,
78
- 0x138d96ceUL, 0x5ccc0009UL, 0x45d73148UL, 0x6efa628bUL, 0x77e153caUL,
79
- 0xbabb5d54UL, 0xa3a06c15UL, 0x888d3fd6UL, 0x91960e97UL, 0xded79850UL,
80
- 0xc7cca911UL, 0xece1fad2UL, 0xf5facb93UL, 0x7262d75cUL, 0x6b79e61dUL,
81
- 0x4054b5deUL, 0x594f849fUL, 0x160e1258UL, 0x0f152319UL, 0x243870daUL,
82
- 0x3d23419bUL, 0x65fd6ba7UL, 0x7ce65ae6UL, 0x57cb0925UL, 0x4ed03864UL,
83
- 0x0191aea3UL, 0x188a9fe2UL, 0x33a7cc21UL, 0x2abcfd60UL, 0xad24e1afUL,
84
- 0xb43fd0eeUL, 0x9f12832dUL, 0x8609b26cUL, 0xc94824abUL, 0xd05315eaUL,
85
- 0xfb7e4629UL, 0xe2657768UL, 0x2f3f79f6UL, 0x362448b7UL, 0x1d091b74UL,
86
- 0x04122a35UL, 0x4b53bcf2UL, 0x52488db3UL, 0x7965de70UL, 0x607eef31UL,
87
- 0xe7e6f3feUL, 0xfefdc2bfUL, 0xd5d0917cUL, 0xcccba03dUL, 0x838a36faUL,
88
- 0x9a9107bbUL, 0xb1bc5478UL, 0xa8a76539UL, 0x3b83984bUL, 0x2298a90aUL,
89
- 0x09b5fac9UL, 0x10aecb88UL, 0x5fef5d4fUL, 0x46f46c0eUL, 0x6dd93fcdUL,
90
- 0x74c20e8cUL, 0xf35a1243UL, 0xea412302UL, 0xc16c70c1UL, 0xd8774180UL,
91
- 0x9736d747UL, 0x8e2de606UL, 0xa500b5c5UL, 0xbc1b8484UL, 0x71418a1aUL,
92
- 0x685abb5bUL, 0x4377e898UL, 0x5a6cd9d9UL, 0x152d4f1eUL, 0x0c367e5fUL,
93
- 0x271b2d9cUL, 0x3e001cddUL, 0xb9980012UL, 0xa0833153UL, 0x8bae6290UL,
94
- 0x92b553d1UL, 0xddf4c516UL, 0xc4eff457UL, 0xefc2a794UL, 0xf6d996d5UL,
95
- 0xae07bce9UL, 0xb71c8da8UL, 0x9c31de6bUL, 0x852aef2aUL, 0xca6b79edUL,
96
- 0xd37048acUL, 0xf85d1b6fUL, 0xe1462a2eUL, 0x66de36e1UL, 0x7fc507a0UL,
97
- 0x54e85463UL, 0x4df36522UL, 0x02b2f3e5UL, 0x1ba9c2a4UL, 0x30849167UL,
98
- 0x299fa026UL, 0xe4c5aeb8UL, 0xfdde9ff9UL, 0xd6f3cc3aUL, 0xcfe8fd7bUL,
99
- 0x80a96bbcUL, 0x99b25afdUL, 0xb29f093eUL, 0xab84387fUL, 0x2c1c24b0UL,
100
- 0x350715f1UL, 0x1e2a4632UL, 0x07317773UL, 0x4870e1b4UL, 0x516bd0f5UL,
101
- 0x7a468336UL, 0x635db277UL, 0xcbfad74eUL, 0xd2e1e60fUL, 0xf9ccb5ccUL,
102
- 0xe0d7848dUL, 0xaf96124aUL, 0xb68d230bUL, 0x9da070c8UL, 0x84bb4189UL,
103
- 0x03235d46UL, 0x1a386c07UL, 0x31153fc4UL, 0x280e0e85UL, 0x674f9842UL,
104
- 0x7e54a903UL, 0x5579fac0UL, 0x4c62cb81UL, 0x8138c51fUL, 0x9823f45eUL,
105
- 0xb30ea79dUL, 0xaa1596dcUL, 0xe554001bUL, 0xfc4f315aUL, 0xd7626299UL,
106
- 0xce7953d8UL, 0x49e14f17UL, 0x50fa7e56UL, 0x7bd72d95UL, 0x62cc1cd4UL,
107
- 0x2d8d8a13UL, 0x3496bb52UL, 0x1fbbe891UL, 0x06a0d9d0UL, 0x5e7ef3ecUL,
108
- 0x4765c2adUL, 0x6c48916eUL, 0x7553a02fUL, 0x3a1236e8UL, 0x230907a9UL,
109
- 0x0824546aUL, 0x113f652bUL, 0x96a779e4UL, 0x8fbc48a5UL, 0xa4911b66UL,
110
- 0xbd8a2a27UL, 0xf2cbbce0UL, 0xebd08da1UL, 0xc0fdde62UL, 0xd9e6ef23UL,
111
- 0x14bce1bdUL, 0x0da7d0fcUL, 0x268a833fUL, 0x3f91b27eUL, 0x70d024b9UL,
112
- 0x69cb15f8UL, 0x42e6463bUL, 0x5bfd777aUL, 0xdc656bb5UL, 0xc57e5af4UL,
113
- 0xee530937UL, 0xf7483876UL, 0xb809aeb1UL, 0xa1129ff0UL, 0x8a3fcc33UL,
114
- 0x9324fd72UL
115
- },
116
- {
117
- 0x00000000UL, 0x01c26a37UL, 0x0384d46eUL, 0x0246be59UL, 0x0709a8dcUL,
118
- 0x06cbc2ebUL, 0x048d7cb2UL, 0x054f1685UL, 0x0e1351b8UL, 0x0fd13b8fUL,
119
- 0x0d9785d6UL, 0x0c55efe1UL, 0x091af964UL, 0x08d89353UL, 0x0a9e2d0aUL,
120
- 0x0b5c473dUL, 0x1c26a370UL, 0x1de4c947UL, 0x1fa2771eUL, 0x1e601d29UL,
121
- 0x1b2f0bacUL, 0x1aed619bUL, 0x18abdfc2UL, 0x1969b5f5UL, 0x1235f2c8UL,
122
- 0x13f798ffUL, 0x11b126a6UL, 0x10734c91UL, 0x153c5a14UL, 0x14fe3023UL,
123
- 0x16b88e7aUL, 0x177ae44dUL, 0x384d46e0UL, 0x398f2cd7UL, 0x3bc9928eUL,
124
- 0x3a0bf8b9UL, 0x3f44ee3cUL, 0x3e86840bUL, 0x3cc03a52UL, 0x3d025065UL,
125
- 0x365e1758UL, 0x379c7d6fUL, 0x35dac336UL, 0x3418a901UL, 0x3157bf84UL,
126
- 0x3095d5b3UL, 0x32d36beaUL, 0x331101ddUL, 0x246be590UL, 0x25a98fa7UL,
127
- 0x27ef31feUL, 0x262d5bc9UL, 0x23624d4cUL, 0x22a0277bUL, 0x20e69922UL,
128
- 0x2124f315UL, 0x2a78b428UL, 0x2bbade1fUL, 0x29fc6046UL, 0x283e0a71UL,
129
- 0x2d711cf4UL, 0x2cb376c3UL, 0x2ef5c89aUL, 0x2f37a2adUL, 0x709a8dc0UL,
130
- 0x7158e7f7UL, 0x731e59aeUL, 0x72dc3399UL, 0x7793251cUL, 0x76514f2bUL,
131
- 0x7417f172UL, 0x75d59b45UL, 0x7e89dc78UL, 0x7f4bb64fUL, 0x7d0d0816UL,
132
- 0x7ccf6221UL, 0x798074a4UL, 0x78421e93UL, 0x7a04a0caUL, 0x7bc6cafdUL,
133
- 0x6cbc2eb0UL, 0x6d7e4487UL, 0x6f38fadeUL, 0x6efa90e9UL, 0x6bb5866cUL,
134
- 0x6a77ec5bUL, 0x68315202UL, 0x69f33835UL, 0x62af7f08UL, 0x636d153fUL,
135
- 0x612bab66UL, 0x60e9c151UL, 0x65a6d7d4UL, 0x6464bde3UL, 0x662203baUL,
136
- 0x67e0698dUL, 0x48d7cb20UL, 0x4915a117UL, 0x4b531f4eUL, 0x4a917579UL,
137
- 0x4fde63fcUL, 0x4e1c09cbUL, 0x4c5ab792UL, 0x4d98dda5UL, 0x46c49a98UL,
138
- 0x4706f0afUL, 0x45404ef6UL, 0x448224c1UL, 0x41cd3244UL, 0x400f5873UL,
139
- 0x4249e62aUL, 0x438b8c1dUL, 0x54f16850UL, 0x55330267UL, 0x5775bc3eUL,
140
- 0x56b7d609UL, 0x53f8c08cUL, 0x523aaabbUL, 0x507c14e2UL, 0x51be7ed5UL,
141
- 0x5ae239e8UL, 0x5b2053dfUL, 0x5966ed86UL, 0x58a487b1UL, 0x5deb9134UL,
142
- 0x5c29fb03UL, 0x5e6f455aUL, 0x5fad2f6dUL, 0xe1351b80UL, 0xe0f771b7UL,
143
- 0xe2b1cfeeUL, 0xe373a5d9UL, 0xe63cb35cUL, 0xe7fed96bUL, 0xe5b86732UL,
144
- 0xe47a0d05UL, 0xef264a38UL, 0xeee4200fUL, 0xeca29e56UL, 0xed60f461UL,
145
- 0xe82fe2e4UL, 0xe9ed88d3UL, 0xebab368aUL, 0xea695cbdUL, 0xfd13b8f0UL,
146
- 0xfcd1d2c7UL, 0xfe976c9eUL, 0xff5506a9UL, 0xfa1a102cUL, 0xfbd87a1bUL,
147
- 0xf99ec442UL, 0xf85cae75UL, 0xf300e948UL, 0xf2c2837fUL, 0xf0843d26UL,
148
- 0xf1465711UL, 0xf4094194UL, 0xf5cb2ba3UL, 0xf78d95faUL, 0xf64fffcdUL,
149
- 0xd9785d60UL, 0xd8ba3757UL, 0xdafc890eUL, 0xdb3ee339UL, 0xde71f5bcUL,
150
- 0xdfb39f8bUL, 0xddf521d2UL, 0xdc374be5UL, 0xd76b0cd8UL, 0xd6a966efUL,
151
- 0xd4efd8b6UL, 0xd52db281UL, 0xd062a404UL, 0xd1a0ce33UL, 0xd3e6706aUL,
152
- 0xd2241a5dUL, 0xc55efe10UL, 0xc49c9427UL, 0xc6da2a7eUL, 0xc7184049UL,
153
- 0xc25756ccUL, 0xc3953cfbUL, 0xc1d382a2UL, 0xc011e895UL, 0xcb4dafa8UL,
154
- 0xca8fc59fUL, 0xc8c97bc6UL, 0xc90b11f1UL, 0xcc440774UL, 0xcd866d43UL,
155
- 0xcfc0d31aUL, 0xce02b92dUL, 0x91af9640UL, 0x906dfc77UL, 0x922b422eUL,
156
- 0x93e92819UL, 0x96a63e9cUL, 0x976454abUL, 0x9522eaf2UL, 0x94e080c5UL,
157
- 0x9fbcc7f8UL, 0x9e7eadcfUL, 0x9c381396UL, 0x9dfa79a1UL, 0x98b56f24UL,
158
- 0x99770513UL, 0x9b31bb4aUL, 0x9af3d17dUL, 0x8d893530UL, 0x8c4b5f07UL,
159
- 0x8e0de15eUL, 0x8fcf8b69UL, 0x8a809decUL, 0x8b42f7dbUL, 0x89044982UL,
160
- 0x88c623b5UL, 0x839a6488UL, 0x82580ebfUL, 0x801eb0e6UL, 0x81dcdad1UL,
161
- 0x8493cc54UL, 0x8551a663UL, 0x8717183aUL, 0x86d5720dUL, 0xa9e2d0a0UL,
162
- 0xa820ba97UL, 0xaa6604ceUL, 0xaba46ef9UL, 0xaeeb787cUL, 0xaf29124bUL,
163
- 0xad6fac12UL, 0xacadc625UL, 0xa7f18118UL, 0xa633eb2fUL, 0xa4755576UL,
164
- 0xa5b73f41UL, 0xa0f829c4UL, 0xa13a43f3UL, 0xa37cfdaaUL, 0xa2be979dUL,
165
- 0xb5c473d0UL, 0xb40619e7UL, 0xb640a7beUL, 0xb782cd89UL, 0xb2cddb0cUL,
166
- 0xb30fb13bUL, 0xb1490f62UL, 0xb08b6555UL, 0xbbd72268UL, 0xba15485fUL,
167
- 0xb853f606UL, 0xb9919c31UL, 0xbcde8ab4UL, 0xbd1ce083UL, 0xbf5a5edaUL,
168
- 0xbe9834edUL
169
- },
170
- {
171
- 0x00000000UL, 0xb8bc6765UL, 0xaa09c88bUL, 0x12b5afeeUL, 0x8f629757UL,
172
- 0x37def032UL, 0x256b5fdcUL, 0x9dd738b9UL, 0xc5b428efUL, 0x7d084f8aUL,
173
- 0x6fbde064UL, 0xd7018701UL, 0x4ad6bfb8UL, 0xf26ad8ddUL, 0xe0df7733UL,
174
- 0x58631056UL, 0x5019579fUL, 0xe8a530faUL, 0xfa109f14UL, 0x42acf871UL,
175
- 0xdf7bc0c8UL, 0x67c7a7adUL, 0x75720843UL, 0xcdce6f26UL, 0x95ad7f70UL,
176
- 0x2d111815UL, 0x3fa4b7fbUL, 0x8718d09eUL, 0x1acfe827UL, 0xa2738f42UL,
177
- 0xb0c620acUL, 0x087a47c9UL, 0xa032af3eUL, 0x188ec85bUL, 0x0a3b67b5UL,
178
- 0xb28700d0UL, 0x2f503869UL, 0x97ec5f0cUL, 0x8559f0e2UL, 0x3de59787UL,
179
- 0x658687d1UL, 0xdd3ae0b4UL, 0xcf8f4f5aUL, 0x7733283fUL, 0xeae41086UL,
180
- 0x525877e3UL, 0x40edd80dUL, 0xf851bf68UL, 0xf02bf8a1UL, 0x48979fc4UL,
181
- 0x5a22302aUL, 0xe29e574fUL, 0x7f496ff6UL, 0xc7f50893UL, 0xd540a77dUL,
182
- 0x6dfcc018UL, 0x359fd04eUL, 0x8d23b72bUL, 0x9f9618c5UL, 0x272a7fa0UL,
183
- 0xbafd4719UL, 0x0241207cUL, 0x10f48f92UL, 0xa848e8f7UL, 0x9b14583dUL,
184
- 0x23a83f58UL, 0x311d90b6UL, 0x89a1f7d3UL, 0x1476cf6aUL, 0xaccaa80fUL,
185
- 0xbe7f07e1UL, 0x06c36084UL, 0x5ea070d2UL, 0xe61c17b7UL, 0xf4a9b859UL,
186
- 0x4c15df3cUL, 0xd1c2e785UL, 0x697e80e0UL, 0x7bcb2f0eUL, 0xc377486bUL,
187
- 0xcb0d0fa2UL, 0x73b168c7UL, 0x6104c729UL, 0xd9b8a04cUL, 0x446f98f5UL,
188
- 0xfcd3ff90UL, 0xee66507eUL, 0x56da371bUL, 0x0eb9274dUL, 0xb6054028UL,
189
- 0xa4b0efc6UL, 0x1c0c88a3UL, 0x81dbb01aUL, 0x3967d77fUL, 0x2bd27891UL,
190
- 0x936e1ff4UL, 0x3b26f703UL, 0x839a9066UL, 0x912f3f88UL, 0x299358edUL,
191
- 0xb4446054UL, 0x0cf80731UL, 0x1e4da8dfUL, 0xa6f1cfbaUL, 0xfe92dfecUL,
192
- 0x462eb889UL, 0x549b1767UL, 0xec277002UL, 0x71f048bbUL, 0xc94c2fdeUL,
193
- 0xdbf98030UL, 0x6345e755UL, 0x6b3fa09cUL, 0xd383c7f9UL, 0xc1366817UL,
194
- 0x798a0f72UL, 0xe45d37cbUL, 0x5ce150aeUL, 0x4e54ff40UL, 0xf6e89825UL,
195
- 0xae8b8873UL, 0x1637ef16UL, 0x048240f8UL, 0xbc3e279dUL, 0x21e91f24UL,
196
- 0x99557841UL, 0x8be0d7afUL, 0x335cb0caUL, 0xed59b63bUL, 0x55e5d15eUL,
197
- 0x47507eb0UL, 0xffec19d5UL, 0x623b216cUL, 0xda874609UL, 0xc832e9e7UL,
198
- 0x708e8e82UL, 0x28ed9ed4UL, 0x9051f9b1UL, 0x82e4565fUL, 0x3a58313aUL,
199
- 0xa78f0983UL, 0x1f336ee6UL, 0x0d86c108UL, 0xb53aa66dUL, 0xbd40e1a4UL,
200
- 0x05fc86c1UL, 0x1749292fUL, 0xaff54e4aUL, 0x322276f3UL, 0x8a9e1196UL,
201
- 0x982bbe78UL, 0x2097d91dUL, 0x78f4c94bUL, 0xc048ae2eUL, 0xd2fd01c0UL,
202
- 0x6a4166a5UL, 0xf7965e1cUL, 0x4f2a3979UL, 0x5d9f9697UL, 0xe523f1f2UL,
203
- 0x4d6b1905UL, 0xf5d77e60UL, 0xe762d18eUL, 0x5fdeb6ebUL, 0xc2098e52UL,
204
- 0x7ab5e937UL, 0x680046d9UL, 0xd0bc21bcUL, 0x88df31eaUL, 0x3063568fUL,
205
- 0x22d6f961UL, 0x9a6a9e04UL, 0x07bda6bdUL, 0xbf01c1d8UL, 0xadb46e36UL,
206
- 0x15080953UL, 0x1d724e9aUL, 0xa5ce29ffUL, 0xb77b8611UL, 0x0fc7e174UL,
207
- 0x9210d9cdUL, 0x2aacbea8UL, 0x38191146UL, 0x80a57623UL, 0xd8c66675UL,
208
- 0x607a0110UL, 0x72cfaefeUL, 0xca73c99bUL, 0x57a4f122UL, 0xef189647UL,
209
- 0xfdad39a9UL, 0x45115eccUL, 0x764dee06UL, 0xcef18963UL, 0xdc44268dUL,
210
- 0x64f841e8UL, 0xf92f7951UL, 0x41931e34UL, 0x5326b1daUL, 0xeb9ad6bfUL,
211
- 0xb3f9c6e9UL, 0x0b45a18cUL, 0x19f00e62UL, 0xa14c6907UL, 0x3c9b51beUL,
212
- 0x842736dbUL, 0x96929935UL, 0x2e2efe50UL, 0x2654b999UL, 0x9ee8defcUL,
213
- 0x8c5d7112UL, 0x34e11677UL, 0xa9362eceUL, 0x118a49abUL, 0x033fe645UL,
214
- 0xbb838120UL, 0xe3e09176UL, 0x5b5cf613UL, 0x49e959fdUL, 0xf1553e98UL,
215
- 0x6c820621UL, 0xd43e6144UL, 0xc68bceaaUL, 0x7e37a9cfUL, 0xd67f4138UL,
216
- 0x6ec3265dUL, 0x7c7689b3UL, 0xc4caeed6UL, 0x591dd66fUL, 0xe1a1b10aUL,
217
- 0xf3141ee4UL, 0x4ba87981UL, 0x13cb69d7UL, 0xab770eb2UL, 0xb9c2a15cUL,
218
- 0x017ec639UL, 0x9ca9fe80UL, 0x241599e5UL, 0x36a0360bUL, 0x8e1c516eUL,
219
- 0x866616a7UL, 0x3eda71c2UL, 0x2c6fde2cUL, 0x94d3b949UL, 0x090481f0UL,
220
- 0xb1b8e695UL, 0xa30d497bUL, 0x1bb12e1eUL, 0x43d23e48UL, 0xfb6e592dUL,
221
- 0xe9dbf6c3UL, 0x516791a6UL, 0xccb0a91fUL, 0x740cce7aUL, 0x66b96194UL,
222
- 0xde0506f1UL
223
- },
224
- {
225
- 0x00000000UL, 0x96300777UL, 0x2c610eeeUL, 0xba510999UL, 0x19c46d07UL,
226
- 0x8ff46a70UL, 0x35a563e9UL, 0xa395649eUL, 0x3288db0eUL, 0xa4b8dc79UL,
227
- 0x1ee9d5e0UL, 0x88d9d297UL, 0x2b4cb609UL, 0xbd7cb17eUL, 0x072db8e7UL,
228
- 0x911dbf90UL, 0x6410b71dUL, 0xf220b06aUL, 0x4871b9f3UL, 0xde41be84UL,
229
- 0x7dd4da1aUL, 0xebe4dd6dUL, 0x51b5d4f4UL, 0xc785d383UL, 0x56986c13UL,
230
- 0xc0a86b64UL, 0x7af962fdUL, 0xecc9658aUL, 0x4f5c0114UL, 0xd96c0663UL,
231
- 0x633d0ffaUL, 0xf50d088dUL, 0xc8206e3bUL, 0x5e10694cUL, 0xe44160d5UL,
232
- 0x727167a2UL, 0xd1e4033cUL, 0x47d4044bUL, 0xfd850dd2UL, 0x6bb50aa5UL,
233
- 0xfaa8b535UL, 0x6c98b242UL, 0xd6c9bbdbUL, 0x40f9bcacUL, 0xe36cd832UL,
234
- 0x755cdf45UL, 0xcf0dd6dcUL, 0x593dd1abUL, 0xac30d926UL, 0x3a00de51UL,
235
- 0x8051d7c8UL, 0x1661d0bfUL, 0xb5f4b421UL, 0x23c4b356UL, 0x9995bacfUL,
236
- 0x0fa5bdb8UL, 0x9eb80228UL, 0x0888055fUL, 0xb2d90cc6UL, 0x24e90bb1UL,
237
- 0x877c6f2fUL, 0x114c6858UL, 0xab1d61c1UL, 0x3d2d66b6UL, 0x9041dc76UL,
238
- 0x0671db01UL, 0xbc20d298UL, 0x2a10d5efUL, 0x8985b171UL, 0x1fb5b606UL,
239
- 0xa5e4bf9fUL, 0x33d4b8e8UL, 0xa2c90778UL, 0x34f9000fUL, 0x8ea80996UL,
240
- 0x18980ee1UL, 0xbb0d6a7fUL, 0x2d3d6d08UL, 0x976c6491UL, 0x015c63e6UL,
241
- 0xf4516b6bUL, 0x62616c1cUL, 0xd8306585UL, 0x4e0062f2UL, 0xed95066cUL,
242
- 0x7ba5011bUL, 0xc1f40882UL, 0x57c40ff5UL, 0xc6d9b065UL, 0x50e9b712UL,
243
- 0xeab8be8bUL, 0x7c88b9fcUL, 0xdf1ddd62UL, 0x492dda15UL, 0xf37cd38cUL,
244
- 0x654cd4fbUL, 0x5861b24dUL, 0xce51b53aUL, 0x7400bca3UL, 0xe230bbd4UL,
245
- 0x41a5df4aUL, 0xd795d83dUL, 0x6dc4d1a4UL, 0xfbf4d6d3UL, 0x6ae96943UL,
246
- 0xfcd96e34UL, 0x468867adUL, 0xd0b860daUL, 0x732d0444UL, 0xe51d0333UL,
247
- 0x5f4c0aaaUL, 0xc97c0dddUL, 0x3c710550UL, 0xaa410227UL, 0x10100bbeUL,
248
- 0x86200cc9UL, 0x25b56857UL, 0xb3856f20UL, 0x09d466b9UL, 0x9fe461ceUL,
249
- 0x0ef9de5eUL, 0x98c9d929UL, 0x2298d0b0UL, 0xb4a8d7c7UL, 0x173db359UL,
250
- 0x810db42eUL, 0x3b5cbdb7UL, 0xad6cbac0UL, 0x2083b8edUL, 0xb6b3bf9aUL,
251
- 0x0ce2b603UL, 0x9ad2b174UL, 0x3947d5eaUL, 0xaf77d29dUL, 0x1526db04UL,
252
- 0x8316dc73UL, 0x120b63e3UL, 0x843b6494UL, 0x3e6a6d0dUL, 0xa85a6a7aUL,
253
- 0x0bcf0ee4UL, 0x9dff0993UL, 0x27ae000aUL, 0xb19e077dUL, 0x44930ff0UL,
254
- 0xd2a30887UL, 0x68f2011eUL, 0xfec20669UL, 0x5d5762f7UL, 0xcb676580UL,
255
- 0x71366c19UL, 0xe7066b6eUL, 0x761bd4feUL, 0xe02bd389UL, 0x5a7ada10UL,
256
- 0xcc4add67UL, 0x6fdfb9f9UL, 0xf9efbe8eUL, 0x43beb717UL, 0xd58eb060UL,
257
- 0xe8a3d6d6UL, 0x7e93d1a1UL, 0xc4c2d838UL, 0x52f2df4fUL, 0xf167bbd1UL,
258
- 0x6757bca6UL, 0xdd06b53fUL, 0x4b36b248UL, 0xda2b0dd8UL, 0x4c1b0aafUL,
259
- 0xf64a0336UL, 0x607a0441UL, 0xc3ef60dfUL, 0x55df67a8UL, 0xef8e6e31UL,
260
- 0x79be6946UL, 0x8cb361cbUL, 0x1a8366bcUL, 0xa0d26f25UL, 0x36e26852UL,
261
- 0x95770cccUL, 0x03470bbbUL, 0xb9160222UL, 0x2f260555UL, 0xbe3bbac5UL,
262
- 0x280bbdb2UL, 0x925ab42bUL, 0x046ab35cUL, 0xa7ffd7c2UL, 0x31cfd0b5UL,
263
- 0x8b9ed92cUL, 0x1daede5bUL, 0xb0c2649bUL, 0x26f263ecUL, 0x9ca36a75UL,
264
- 0x0a936d02UL, 0xa906099cUL, 0x3f360eebUL, 0x85670772UL, 0x13570005UL,
265
- 0x824abf95UL, 0x147ab8e2UL, 0xae2bb17bUL, 0x381bb60cUL, 0x9b8ed292UL,
266
- 0x0dbed5e5UL, 0xb7efdc7cUL, 0x21dfdb0bUL, 0xd4d2d386UL, 0x42e2d4f1UL,
267
- 0xf8b3dd68UL, 0x6e83da1fUL, 0xcd16be81UL, 0x5b26b9f6UL, 0xe177b06fUL,
268
- 0x7747b718UL, 0xe65a0888UL, 0x706a0fffUL, 0xca3b0666UL, 0x5c0b0111UL,
269
- 0xff9e658fUL, 0x69ae62f8UL, 0xd3ff6b61UL, 0x45cf6c16UL, 0x78e20aa0UL,
270
- 0xeed20dd7UL, 0x5483044eUL, 0xc2b30339UL, 0x612667a7UL, 0xf71660d0UL,
271
- 0x4d476949UL, 0xdb776e3eUL, 0x4a6ad1aeUL, 0xdc5ad6d9UL, 0x660bdf40UL,
272
- 0xf03bd837UL, 0x53aebca9UL, 0xc59ebbdeUL, 0x7fcfb247UL, 0xe9ffb530UL,
273
- 0x1cf2bdbdUL, 0x8ac2bacaUL, 0x3093b353UL, 0xa6a3b424UL, 0x0536d0baUL,
274
- 0x9306d7cdUL, 0x2957de54UL, 0xbf67d923UL, 0x2e7a66b3UL, 0xb84a61c4UL,
275
- 0x021b685dUL, 0x942b6f2aUL, 0x37be0bb4UL, 0xa18e0cc3UL, 0x1bdf055aUL,
276
- 0x8def022dUL
277
- },
278
- {
279
- 0x00000000UL, 0x41311b19UL, 0x82623632UL, 0xc3532d2bUL, 0x04c56c64UL,
280
- 0x45f4777dUL, 0x86a75a56UL, 0xc796414fUL, 0x088ad9c8UL, 0x49bbc2d1UL,
281
- 0x8ae8effaUL, 0xcbd9f4e3UL, 0x0c4fb5acUL, 0x4d7eaeb5UL, 0x8e2d839eUL,
282
- 0xcf1c9887UL, 0x5112c24aUL, 0x1023d953UL, 0xd370f478UL, 0x9241ef61UL,
283
- 0x55d7ae2eUL, 0x14e6b537UL, 0xd7b5981cUL, 0x96848305UL, 0x59981b82UL,
284
- 0x18a9009bUL, 0xdbfa2db0UL, 0x9acb36a9UL, 0x5d5d77e6UL, 0x1c6c6cffUL,
285
- 0xdf3f41d4UL, 0x9e0e5acdUL, 0xa2248495UL, 0xe3159f8cUL, 0x2046b2a7UL,
286
- 0x6177a9beUL, 0xa6e1e8f1UL, 0xe7d0f3e8UL, 0x2483dec3UL, 0x65b2c5daUL,
287
- 0xaaae5d5dUL, 0xeb9f4644UL, 0x28cc6b6fUL, 0x69fd7076UL, 0xae6b3139UL,
288
- 0xef5a2a20UL, 0x2c09070bUL, 0x6d381c12UL, 0xf33646dfUL, 0xb2075dc6UL,
289
- 0x715470edUL, 0x30656bf4UL, 0xf7f32abbUL, 0xb6c231a2UL, 0x75911c89UL,
290
- 0x34a00790UL, 0xfbbc9f17UL, 0xba8d840eUL, 0x79dea925UL, 0x38efb23cUL,
291
- 0xff79f373UL, 0xbe48e86aUL, 0x7d1bc541UL, 0x3c2ade58UL, 0x054f79f0UL,
292
- 0x447e62e9UL, 0x872d4fc2UL, 0xc61c54dbUL, 0x018a1594UL, 0x40bb0e8dUL,
293
- 0x83e823a6UL, 0xc2d938bfUL, 0x0dc5a038UL, 0x4cf4bb21UL, 0x8fa7960aUL,
294
- 0xce968d13UL, 0x0900cc5cUL, 0x4831d745UL, 0x8b62fa6eUL, 0xca53e177UL,
295
- 0x545dbbbaUL, 0x156ca0a3UL, 0xd63f8d88UL, 0x970e9691UL, 0x5098d7deUL,
296
- 0x11a9ccc7UL, 0xd2fae1ecUL, 0x93cbfaf5UL, 0x5cd76272UL, 0x1de6796bUL,
297
- 0xdeb55440UL, 0x9f844f59UL, 0x58120e16UL, 0x1923150fUL, 0xda703824UL,
298
- 0x9b41233dUL, 0xa76bfd65UL, 0xe65ae67cUL, 0x2509cb57UL, 0x6438d04eUL,
299
- 0xa3ae9101UL, 0xe29f8a18UL, 0x21cca733UL, 0x60fdbc2aUL, 0xafe124adUL,
300
- 0xeed03fb4UL, 0x2d83129fUL, 0x6cb20986UL, 0xab2448c9UL, 0xea1553d0UL,
301
- 0x29467efbUL, 0x687765e2UL, 0xf6793f2fUL, 0xb7482436UL, 0x741b091dUL,
302
- 0x352a1204UL, 0xf2bc534bUL, 0xb38d4852UL, 0x70de6579UL, 0x31ef7e60UL,
303
- 0xfef3e6e7UL, 0xbfc2fdfeUL, 0x7c91d0d5UL, 0x3da0cbccUL, 0xfa368a83UL,
304
- 0xbb07919aUL, 0x7854bcb1UL, 0x3965a7a8UL, 0x4b98833bUL, 0x0aa99822UL,
305
- 0xc9fab509UL, 0x88cbae10UL, 0x4f5def5fUL, 0x0e6cf446UL, 0xcd3fd96dUL,
306
- 0x8c0ec274UL, 0x43125af3UL, 0x022341eaUL, 0xc1706cc1UL, 0x804177d8UL,
307
- 0x47d73697UL, 0x06e62d8eUL, 0xc5b500a5UL, 0x84841bbcUL, 0x1a8a4171UL,
308
- 0x5bbb5a68UL, 0x98e87743UL, 0xd9d96c5aUL, 0x1e4f2d15UL, 0x5f7e360cUL,
309
- 0x9c2d1b27UL, 0xdd1c003eUL, 0x120098b9UL, 0x533183a0UL, 0x9062ae8bUL,
310
- 0xd153b592UL, 0x16c5f4ddUL, 0x57f4efc4UL, 0x94a7c2efUL, 0xd596d9f6UL,
311
- 0xe9bc07aeUL, 0xa88d1cb7UL, 0x6bde319cUL, 0x2aef2a85UL, 0xed796bcaUL,
312
- 0xac4870d3UL, 0x6f1b5df8UL, 0x2e2a46e1UL, 0xe136de66UL, 0xa007c57fUL,
313
- 0x6354e854UL, 0x2265f34dUL, 0xe5f3b202UL, 0xa4c2a91bUL, 0x67918430UL,
314
- 0x26a09f29UL, 0xb8aec5e4UL, 0xf99fdefdUL, 0x3accf3d6UL, 0x7bfde8cfUL,
315
- 0xbc6ba980UL, 0xfd5ab299UL, 0x3e099fb2UL, 0x7f3884abUL, 0xb0241c2cUL,
316
- 0xf1150735UL, 0x32462a1eUL, 0x73773107UL, 0xb4e17048UL, 0xf5d06b51UL,
317
- 0x3683467aUL, 0x77b25d63UL, 0x4ed7facbUL, 0x0fe6e1d2UL, 0xccb5ccf9UL,
318
- 0x8d84d7e0UL, 0x4a1296afUL, 0x0b238db6UL, 0xc870a09dUL, 0x8941bb84UL,
319
- 0x465d2303UL, 0x076c381aUL, 0xc43f1531UL, 0x850e0e28UL, 0x42984f67UL,
320
- 0x03a9547eUL, 0xc0fa7955UL, 0x81cb624cUL, 0x1fc53881UL, 0x5ef42398UL,
321
- 0x9da70eb3UL, 0xdc9615aaUL, 0x1b0054e5UL, 0x5a314ffcUL, 0x996262d7UL,
322
- 0xd85379ceUL, 0x174fe149UL, 0x567efa50UL, 0x952dd77bUL, 0xd41ccc62UL,
323
- 0x138a8d2dUL, 0x52bb9634UL, 0x91e8bb1fUL, 0xd0d9a006UL, 0xecf37e5eUL,
324
- 0xadc26547UL, 0x6e91486cUL, 0x2fa05375UL, 0xe836123aUL, 0xa9070923UL,
325
- 0x6a542408UL, 0x2b653f11UL, 0xe479a796UL, 0xa548bc8fUL, 0x661b91a4UL,
326
- 0x272a8abdUL, 0xe0bccbf2UL, 0xa18dd0ebUL, 0x62defdc0UL, 0x23efe6d9UL,
327
- 0xbde1bc14UL, 0xfcd0a70dUL, 0x3f838a26UL, 0x7eb2913fUL, 0xb924d070UL,
328
- 0xf815cb69UL, 0x3b46e642UL, 0x7a77fd5bUL, 0xb56b65dcUL, 0xf45a7ec5UL,
329
- 0x370953eeUL, 0x763848f7UL, 0xb1ae09b8UL, 0xf09f12a1UL, 0x33cc3f8aUL,
330
- 0x72fd2493UL
331
- },
332
- {
333
- 0x00000000UL, 0x376ac201UL, 0x6ed48403UL, 0x59be4602UL, 0xdca80907UL,
334
- 0xebc2cb06UL, 0xb27c8d04UL, 0x85164f05UL, 0xb851130eUL, 0x8f3bd10fUL,
335
- 0xd685970dUL, 0xe1ef550cUL, 0x64f91a09UL, 0x5393d808UL, 0x0a2d9e0aUL,
336
- 0x3d475c0bUL, 0x70a3261cUL, 0x47c9e41dUL, 0x1e77a21fUL, 0x291d601eUL,
337
- 0xac0b2f1bUL, 0x9b61ed1aUL, 0xc2dfab18UL, 0xf5b56919UL, 0xc8f23512UL,
338
- 0xff98f713UL, 0xa626b111UL, 0x914c7310UL, 0x145a3c15UL, 0x2330fe14UL,
339
- 0x7a8eb816UL, 0x4de47a17UL, 0xe0464d38UL, 0xd72c8f39UL, 0x8e92c93bUL,
340
- 0xb9f80b3aUL, 0x3cee443fUL, 0x0b84863eUL, 0x523ac03cUL, 0x6550023dUL,
341
- 0x58175e36UL, 0x6f7d9c37UL, 0x36c3da35UL, 0x01a91834UL, 0x84bf5731UL,
342
- 0xb3d59530UL, 0xea6bd332UL, 0xdd011133UL, 0x90e56b24UL, 0xa78fa925UL,
343
- 0xfe31ef27UL, 0xc95b2d26UL, 0x4c4d6223UL, 0x7b27a022UL, 0x2299e620UL,
344