diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:11:37 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:11:37 -0700 |
commit | 56bcb184fac036a45cb8937238d51778d0a796aa (patch) | |
tree | 7b127418b30e135f8ce27ec136038b5090540820 /compress.c | |
parent | 25e5325501edade156e897f95afdaa2be78ad9a3 (diff) | |
download | zlib-56bcb184fac036a45cb8937238d51778d0a796aa.tar.gz zlib-56bcb184fac036a45cb8937238d51778d0a796aa.tar.bz2 zlib-56bcb184fac036a45cb8937238d51778d0a796aa.zip |
zlib 0.99v0.99
Diffstat (limited to 'compress.c')
-rw-r--r-- | compress.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* compress.c -- compress a memory buffer | 1 | /* compress.c -- compress a memory buffer |
2 | * Copyright (C) 1995 Jean-loup Gailly. | 2 | * Copyright (C) 1995-1996 Jean-loup Gailly. |
3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -22,13 +22,13 @@ | |||
22 | int compress (dest, destLen, source, sourceLen) | 22 | int compress (dest, destLen, source, sourceLen) |
23 | Bytef *dest; | 23 | Bytef *dest; |
24 | uLongf *destLen; | 24 | uLongf *destLen; |
25 | Bytef *source; | 25 | const Bytef *source; |
26 | uLong sourceLen; | 26 | uLong sourceLen; |
27 | { | 27 | { |
28 | z_stream stream; | 28 | z_stream stream; |
29 | int err; | 29 | int err; |
30 | 30 | ||
31 | stream.next_in = source; | 31 | stream.next_in = (Bytef*)source; |
32 | stream.avail_in = (uInt)sourceLen; | 32 | stream.avail_in = (uInt)sourceLen; |
33 | /* Check for source > 64K on 16-bit machine: */ | 33 | /* Check for source > 64K on 16-bit machine: */ |
34 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; | 34 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; |
@@ -39,6 +39,7 @@ int compress (dest, destLen, source, sourceLen) | |||
39 | 39 | ||
40 | stream.zalloc = (alloc_func)0; | 40 | stream.zalloc = (alloc_func)0; |
41 | stream.zfree = (free_func)0; | 41 | stream.zfree = (free_func)0; |
42 | stream.opaque = (voidpf)0; | ||
42 | 43 | ||
43 | err = deflateInit(&stream, Z_DEFAULT_COMPRESSION); | 44 | err = deflateInit(&stream, Z_DEFAULT_COMPRESSION); |
44 | if (err != Z_OK) return err; | 45 | if (err != Z_OK) return err; |