Skip to content

Commit

Permalink
zlib 0.92
Browse files Browse the repository at this point in the history
  • Loading branch information
madler committed Sep 10, 2011
1 parent 1c71d8b commit bdde4e0
Show file tree
Hide file tree
Showing 25 changed files with 892 additions and 918 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
ChangeLog file for zlib

Changes in 0.92 (3 May 95)
- don't assume that char is signed (problem on SGI)
- Clear bit buffer when starting a stored block
- no memcpy on Pyramid
- suppressed inftest.c
- optimized fill_window, put longest_match inline for gcc
- optimized inflate on stored blocks.
- untabify all sources to simplify patches

Changes in 0.91 (2 May 95)
- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
- Document the memory requirements in zconf.h
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

CC=cc
CFLAGS=-O
#use -O3 for gcc to take advantage of inlining
#CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
#CFLAGS=-g -DDEBUG
LDFLAGS=-L. -lgz
Expand All @@ -15,9 +16,9 @@ prefix=/usr/local
OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o

TEST_OBJS = example.o minigzip.o inftest.o
TEST_OBJS = example.o minigzip.o

all: example minigzip inftest
all: example minigzip

test: all
./example
Expand All @@ -41,11 +42,8 @@ example: example.o libgz.a
minigzip: minigzip.o libgz.a
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)

inftest: inftest.o libgz.a
$(CC) $(CFLAGS) -o $@ inftest.o $(LDFLAGS)

clean:
rm -f *.o example minigzip inftest libgz.a foo.gz
rm -f *.o example minigzip libgz.a foo.gz

zip:
zip -ul9 zlib README ChangeLog Makefile Makefile.??? Makefile.?? *.[ch]
Expand All @@ -66,7 +64,6 @@ infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
inflate.o: zutil.h zlib.h zconf.h infblock.h
inftest.o: zutil.h zlib.h zconf.h
inftrees.o: zutil.h zlib.h zconf.h inftrees.h
infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
minigzip.o: zlib.h zconf.h
Expand Down
9 changes: 6 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
zlib 0.91 is a beta version of a general purpose compression library.
zlib 0.92 is a beta version of a general purpose compression library.

The data format used by the zlib library is described in the
files zlib-3.1.doc, deflate-1.1.doc and gzip-4.1.doc, available
Expand All @@ -14,12 +14,15 @@ To install the zlib library (libgz.a) in /usr/local/lib, type: make install
To install in a different directory, use for example: make install prefix=$HOME
This will install in $HOME/lib instead of /usr/local/lib.

The changes made in version 0.91 are documented in the file ChangeLog.
The changes made in version 0.92 are documented in the file ChangeLog.
The main changes since 0.9 are:
- don't assume that char is signed (problem on SGI)
- Default MEM_LEVEL is 8 (not 9 for Unix) as documented in zlib.h
- Document the memory requirements in zconf.h
- added "make install"
- added support for DJGPP
- added support for DJGPP and Pyramid
- fix an inflate bug for stored blocks.
- various speedups

On MSDOS, this version works in both large and small model. However
small model compression works only for small values of MAX_MEM_LEVEL
Expand Down
24 changes: 12 additions & 12 deletions adler32.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* $Id: adler32.c,v 1.5 1995/04/14 14:49:51 jloup Exp $ */
/* $Id: adler32.c,v 1.6 1995/05/03 17:27:08 jloup Exp $ */

#include "zutil.h"

Expand All @@ -30,17 +30,17 @@ uLong adler32(adler, buf, len)
if (buf == Z_NULL) return 1L;

while (len > 0) {
k = len < NMAX ? len : NMAX;
len -= k;
while (k >= 16) {
DO16(buf);
k -= 16;
}
if (k != 0) do {
DO1(buf);
} while (--k);
s1 %= BASE;
s2 %= BASE;
k = len < NMAX ? len : NMAX;
len -= k;
while (k >= 16) {
DO16(buf);
k -= 16;
}
if (k != 0) do {
DO1(buf);
} while (--k);
s1 %= BASE;
s2 %= BASE;
}
return (s2 << 16) | s1;
}
6 changes: 3 additions & 3 deletions compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* $Id: compress.c,v 1.5 1995/04/29 17:18:43 jloup Exp $ */
/* $Id: compress.c,v 1.6 1995/05/03 17:27:08 jloup Exp $ */

#include "zlib.h"

Expand Down Expand Up @@ -45,8 +45,8 @@ int compress (dest, destLen, source, sourceLen)

err = deflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
deflateEnd(&stream);
return err == Z_OK ? Z_BUF_ERROR : err;
deflateEnd(&stream);
return err == Z_OK ? Z_BUF_ERROR : err;
}
*destLen = stream.total_out;

Expand Down
Loading

0 comments on commit bdde4e0

Please sign in to comment.