X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=archive-zip.c;h=72d55a58ac60019f9f6175d4c86af47348630762;hb=740a8fc2249cf7d8b39ab50a25bbf86554158ae7;hp=cf285044e3576d0127c3215cb1253443d67517dc;hpb=6e13921b4f7adcc7316a76c0c4955b85b1589a65;p=git.git diff --git a/archive-zip.c b/archive-zip.c index cf285044e..72d55a58a 100644 --- a/archive-zip.c +++ b/archive-zip.c @@ -90,14 +90,14 @@ static void copy_le32(unsigned char *dest, unsigned int n) static void *zlib_deflate(void *data, unsigned long size, int compression_level, unsigned long *compressed_size) { - z_stream stream; + git_zstream stream; unsigned long maxsize; void *buffer; int result; memset(&stream, 0, sizeof(stream)); - deflateInit(&stream, compression_level); - maxsize = deflateBound(&stream, size); + git_deflate_init(&stream, compression_level); + maxsize = git_deflate_bound(&stream, size); buffer = xmalloc(maxsize); stream.next_in = data; @@ -106,7 +106,7 @@ static void *zlib_deflate(void *data, unsigned long size, stream.avail_out = maxsize; do { - result = deflate(&stream, Z_FINISH); + result = git_deflate(&stream, Z_FINISH); } while (result == Z_OK); if (result != Z_STREAM_END) { @@ -114,7 +114,7 @@ static void *zlib_deflate(void *data, unsigned long size, return NULL; } - deflateEnd(&stream); + git_deflate_end(&stream); *compressed_size = stream.total_out; return buffer;