]> git.lizzy.rs Git - zlib.git/commitdiff
zlib 1.1.1 v1.1.1
authorMark Adler <madler@alumni.caltech.edu>
Sat, 10 Sep 2011 06:20:07 +0000 (23:20 -0700)
committerMark Adler <madler@alumni.caltech.edu>
Sat, 10 Sep 2011 06:20:07 +0000 (23:20 -0700)
14 files changed:
ChangeLog
INDEX
Makefile
Makefile.in
README
deflate.c
deflate.h
inftrees.c
msdos/Makefile.w32 [new file with mode: 0644]
msdos/zlib.def
msdos/zlib.rc
trees.c
zlib.3
zlib.h

index 8160d28e80aefba38c4a1ecd55180b85290f6c3d..95d3c3b8b2e00e9a5d20c6980c85a760ebf73520 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,15 @@
 
                ChangeLog file for zlib
 
-Changes in 1.1 (24 Feb 98)
+Changes in 1.1.1 (27 Feb 98)
+- fix macros _tr_tally_* in deflate.h for debug mode  (Glenn Randers-Pehrson)
+- remove block truncation heuristic which had very marginal effect for zlib
+  (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
+  compression ratio on some files. This also allows inlining _tr_tally for
+  matches in deflate_slow.
+- added msdos/Makefile.w32 for WIN32 Microsoft Visual C++ (Bob Frazier)
+
+Changes in 1.1.0 (24 Feb 98)
 - do not return STREAM_END prematurely in inflate (John Bowler)
 - revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
 - compile with -DFASTEST to get compression code optimized for speed only
diff --git a/INDEX b/INDEX
index 85d51a4155d64cfd2f31d4b9ebb186440e1447e4..c436af62ef69d1c1f894c095115df6deae5e4703 100644 (file)
--- a/INDEX
+++ b/INDEX
@@ -13,6 +13,7 @@ descrip.mms           makefile for Vax/VMS
 zlib.3                 mini man page for zlib (volunteers to write full
                        man pages from zlib.h welcome. write to jloup@gzip.org)
 
+msdos/Makefile.w32      makefile for Microsoft Visual C++ 32-bit
 msdos/Makefile.b32     makefile for Borland C++   32-bit
 msdos/Makefile.bor     makefile for Borland C/C++ 16-bit
 msdos/Makefile.dj2     makefile for DJGPP 2.x
index 257f394afb29fdd6e2e66cc6076791fa9bf95dd7..772bc31f565fc46a83cc4e4d81867dae4db15f5d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ CFLAGS=-O
 LDFLAGS=-L. -lz
 LDSHARED=$(CC)
 
-VER=1.1.0
+VER=1.1.1
 LIBS=libz.a
 SHAREDLIB=libz.so
 
index 257f394afb29fdd6e2e66cc6076791fa9bf95dd7..772bc31f565fc46a83cc4e4d81867dae4db15f5d 100644 (file)
@@ -23,7 +23,7 @@ CFLAGS=-O
 LDFLAGS=-L. -lz
 LDSHARED=$(CC)
 
-VER=1.1.0
+VER=1.1.1
 LIBS=libz.a
 SHAREDLIB=libz.so
 
diff --git a/README b/README
index 5aacb5354d78b2252ae839df20e20169ad4c4873..acaea4fc8eae7e98c40636c375ca138b1de09f8f 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-zlib 1.1.0 is a general purpose data compression library.  All the code
+zlib 1.1.1 is a general purpose data compression library.  All the code
 is thread safe.  The data format used by the zlib library
 is described by RFCs (Request for Comments) 1950 to 1952 in the files 
 ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
@@ -25,15 +25,14 @@ Mark Nelson wrote an article about zlib for the Jan. 1997 issue of
 Dr. Dobb's Journal; a copy of the article is available in
 http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm
 
-The changes made in version 1.1.0 are documented in the file ChangeLog.
-The main changes since 1.0.9 are:
+The changes made in version 1.1.1 are documented in the file ChangeLog.
+The main changes since 1.1.0 are:
 
-- do not return STREAM_END prematurely in inflate (John Bowler)
-- revert to the zlib 1.0.8 inflate to avoid the gcc 2.8.0 bug (Jeremy Buhler)
-- compile with -DFASTEST to get compression code optimized for speed only
-- in minigzip, try mmap'ing the input file first (Miguel Albrecht)
-- increase size of I/O buffers in minigzip.c and gzio.c (not a big gain
-  on Sun but significant on HP)
+- fix macros _tr_tally_* in deflate.h for debug mode  (Glenn Randers-Pehrson)
+- remove block truncation heuristic which had very marginal effect for zlib
+  (smaller lit_bufsize than in gzip 1.2.4) and degraded a little the
+  compression ratio on some files. This also allows inlining _tr_tally for
+  matches in deflate_slow.
 
 
 Unsupported third party contributions are provided in directory "contrib".
index dc60299d5273e9add0797de76d91e97d1264c9fc..4961b6b2b5d41cb0c0ffbb15f933830dbfc9056f 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -52,7 +52,7 @@
 #include "deflate.h"
 
 const char deflate_copyright[] =
-   " deflate 1.1.0 Copyright 1995-1998 Jean-loup Gailly ";
+   " deflate 1.1.1 Copyright 1995-1998 Jean-loup Gailly ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -1294,8 +1294,8 @@ local block_state deflate_slow(s, flush)
 
             check_match(s, s->strstart-1, s->prev_match, s->prev_length);
 
-            bflush = _tr_tally(s, s->strstart -1 - s->prev_match,
-                              s->prev_length - MIN_MATCH);
+            _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+                          s->prev_length - MIN_MATCH, bflush);
 
             /* Insert in hash table all strings up to the end of the match.
              * strstart-1 and strstart are already inserted. If there is not
@@ -1322,7 +1322,7 @@ local block_state deflate_slow(s, flush)
              */
             Tracevv((stderr,"%c", s->window[s->strstart-1]));
            _tr_tally_lit(s, s->window[s->strstart-1], bflush);
-            if (bflush) {
+           if (bflush) {
                 FLUSH_BLOCK_ONLY(s, 0);
             }
             s->strstart++;
index 34f5126c9a8b6b823991cc20738ebba09ac87293..04830164dd65702fdffa907c424ff34637f05870 100644 (file)
--- a/deflate.h
+++ b/deflate.h
@@ -310,9 +310,9 @@ void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len,
     flush = (s->last_lit == s->lit_bufsize-1); \
   }
 #else
-# define _tr_tally_lit(s, c, flush) _tr_tally(s, 0, c, flush)
+# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
 # define _tr_tally_dist(s, distance, length, flush) \
-              _tr_tally(s, distance, length, flush) 
+              flush = _tr_tally(s, distance, length) 
 #endif
 
 #endif
index 205ddc5c1ae2ad60a598975933ed8e018bcabec6..9f85187f0af202b5a915c2499c48bd98e5614d4e 100644 (file)
@@ -7,7 +7,7 @@
 #include "inftrees.h"
 
 const char inflate_copyright[] =
-   " inflate 1.1.0 Copyright 1995-1998 Mark Adler ";
+   " inflate 1.1.1 Copyright 1995-1998 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
diff --git a/msdos/Makefile.w32 b/msdos/Makefile.w32
new file mode 100644 (file)
index 0000000..d513c81
--- /dev/null
@@ -0,0 +1,97 @@
+# Makefile for zlib
+# Microsoft 32-bit Visual C++ 4.0 or later (may work on earlier versions)
+
+# To use, do "nmake /f makefile.w32"
+
+# If you wish to reduce the memory requirements (default 256K for big
+# objects plus a few K), you can add to CFLAGS below: 
+#   -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
+# See zconf.h for details about the memory requirements.
+
+# ------------- Microsoft Visual C++ 4.0 and later -------------
+MODEL=
+CFLAGS=-Ox -GA3s -nologo -W3
+CC=cl
+LD=link
+LDFLAGS=
+O=.obj
+
+# variables
+OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
+  trees$(O)
+OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
+  trees$(O)
+OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
+  infutil$(O) inffast$(O)
+OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
+  infutil$(O)+inffast$(O)
+
+all:  zlib.lib example.exe minigzip.exe
+
+adler32.obj: adler32.c zutil.h zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+compress.obj: compress.c zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+crc32.obj: crc32.c zutil.h zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+gzio.obj: gzio.c zutil.h zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
+   infcodes.h infutil.h
+  $(CC) -c $(CFLAGS) $*.c
+
+infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
+   infcodes.h inffast.h
+  $(CC) -c $(CFLAGS) $*.c
+
+inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
+  $(CC) -c $(CFLAGS) $*.c
+
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+  $(CC) -c $(CFLAGS) $*.c
+
+infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
+  $(CC) -c $(CFLAGS) $*.c
+
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
+  $(CC) -c $(CFLAGS) $*.c
+
+trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+uncompr.obj: uncompr.c zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+zutil.obj: zutil.c zutil.h zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+example.obj: example.c zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+minigzip.obj: minigzip.c zlib.h zconf.h
+  $(CC) -c $(CFLAGS) $*.c
+
+zlib.lib: $(OBJ1) $(OBJ2)
+  if exist zlib.lib del zlib.lib
+  lib /OUT:zlib.lib $(OBJ1) $(OBJ2)
+
+example.exe: example.obj zlib.lib
+  $(LD) $(LDFLAGS) example.obj zlib.lib /OUT:example.exe /SUBSYSTEM:CONSOLE
+
+minigzip.exe: minigzip.obj zlib.lib
+  $(LD) $(LDFLAGS) minigzip.obj zlib.lib /OUT:minigzip.exe /SUBSYSTEM:CONSOLE
+
+test: example.exe minigzip.exe
+  example
+  echo hello world | minigzip | minigzip -d 
+
+#clean:
+#  del *.obj
+#  del *.exe
index 2372ab1fb77541a2fb9273918d6052ccfe97c433..e4edaad11d53e9146a58930565998630880ec8b8 100644 (file)
@@ -8,7 +8,7 @@ SUBSYSTEM       WINDOWS
 
 STUB           'WINSTUB.EXE'
 
-VERSION                1.1
+VERSION                1.11
 
 CODE            EXECUTE READ
 
index 76e0ec2f49d9c196819ac10083175336c21552d6..298472097eb85294e9e0c1206a3057178afb74f6 100644 (file)
@@ -2,8 +2,8 @@
 
 #define IDR_VERSION1  1
 IDR_VERSION1   VERSIONINFO     MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION   1,1,0,0
-  PRODUCTVERSION 1,1,0,0
+  FILEVERSION   1,1,1,0
+  PRODUCTVERSION 1,1,1,0
   FILEFLAGSMASK        VS_FFI_FILEFLAGSMASK
   FILEFLAGS    0
   FILEOS       VOS_DOS_WINDOWS32
@@ -17,7 +17,7 @@ BEGIN
 
     BEGIN
       VALUE "FileDescription", "zlib data compression library\0"
-      VALUE "FileVersion",     "1.1.0\0"
+      VALUE "FileVersion",     "1.1.1\0"
       VALUE "InternalName",    "zlib\0"
       VALUE "OriginalFilename",        "zlib.dll\0"
       VALUE "ProductName",     "ZLib.DLL\0"
diff --git a/trees.c b/trees.c
index e09e94cc72b02fb2e199cbc8f8980f19783be450..ef31043764b6ff857991283a57a989945126cbf1 100644 (file)
--- a/trees.c
+++ b/trees.c
@@ -1042,8 +1042,9 @@ int _tr_tally (s, dist, lc)
         s->dyn_dtree[d_code(dist)].Freq++;
     }
 
+#ifdef TRUNCATE_BLOCK
     /* Try to guess if it is profitable to stop the current block here */
-    if (s->level > 2 && (s->last_lit & 0xfff) == 0) {
+    if ((s->last_lit & 0x1fff) == 0 && s->level > 2) {
         /* Compute an upper bound for the compressed length */
         ulg out_length = (ulg)s->last_lit*8L;
         ulg in_length = (ulg)((long)s->strstart - s->block_start);
@@ -1058,6 +1059,7 @@ int _tr_tally (s, dist, lc)
                100L - out_length*100L/in_length));
         if (s->matches < s->last_lit/2 && out_length < in_length/2) return 1;
     }
+#endif
     return (s->last_lit == s->lit_bufsize-1);
     /* We avoid equality with lit_bufsize because of wraparound at 64K
      * on 16 bit machines and because stored blocks are restricted to
diff --git a/zlib.3 b/zlib.3
index ccde8f2085166d9b28b52a233bdde5d7109b5828..8519184d4fb8614b8b7558766cde71a9dcea00c0 100644 (file)
--- a/zlib.3
+++ b/zlib.3
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "24 February 1998"
+.TH ZLIB 3 "27 February 1998"
 .SH NAME
 zlib \- compression/decompression library
 .SH SYNOPSIS
@@ -81,7 +81,7 @@ These documents are also available in other formats from:
 .IP
 ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
 .SH AUTHORS
-Version 1.1.0
+Version 1.1.1
 Copyright (C) 1995-1998 Jean-loup Gailly (jloup@gzip.org)
 and Mark Adler (madler@alumni.caltech.edu).
 .LP
diff --git a/zlib.h b/zlib.h
index 135c2bd8bc6e231709f5513333cd63b68700f1d2..06f988c1f0585aede75f69cd3ff476d76f98b77d 100644 (file)
--- a/zlib.h
+++ b/zlib.h
@@ -1,5 +1,5 @@
 /* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.1.0, Feb 24th, 1998
+  version 1.1.1, Feb 27th, 1998
 
   Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler
 
@@ -37,7 +37,7 @@ extern "C" {
 
 #include "zconf.h"
 
-#define ZLIB_VERSION "1.1.0"
+#define ZLIB_VERSION "1.1.1"
 
 /* 
      The 'zlib' compression library provides in-memory compression and