diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-07-19 09:33:03 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-07-19 09:33:04 -0700 |
commit | eb4f4076aa89d38221ee513a5f28f22124029c90 (patch) | |
tree | 8617f31f2dada1ec300dff9427f92ba00ea95500 /builtin/index-pack.c | |
parent | d37b2991b1edea76c01ec05cc383005b55c96e36 (diff) | |
parent | e01503b523e79748ac91d876f506811c597d03cb (diff) | |
download | git-eb4f4076aa89d38221ee513a5f28f22124029c90.tar.gz |
Merge branch 'jc/zlib-wrap'
* jc/zlib-wrap:
zlib: allow feeding more than 4GB in one go
zlib: zlib can only process 4GB at a time
zlib: wrap deflateBound() too
zlib: wrap deflate side of the API
zlib: wrap inflateInit2 used to accept only for gzip format
zlib: wrap remaining calls to direct inflate/inflateEnd
zlib wrapper: refactor error message formatter
Conflicts:
sha1_file.c
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r-- | builtin/index-pack.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c index e40451ffb4..81cdc28b30 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -265,7 +265,7 @@ static void unlink_base_data(struct base_data *c) static void *unpack_entry_data(unsigned long offset, unsigned long size) { int status; - z_stream stream; + git_zstream stream; void *buf = xmalloc(size); memset(&stream, 0, sizeof(stream)); @@ -355,7 +355,7 @@ static void *get_data_from_pack(struct object_entry *obj) off_t from = obj[0].idx.offset + obj[0].hdr_size; unsigned long len = obj[1].idx.offset - from; unsigned char *data, *inbuf; - z_stream stream; + git_zstream stream; int status; data = xmalloc(obj->size); @@ -666,26 +666,26 @@ static void parse_pack_objects(unsigned char *sha1) static int write_compressed(struct sha1file *f, void *in, unsigned int size) { - z_stream stream; + git_zstream stream; int status; unsigned char outbuf[4096]; memset(&stream, 0, sizeof(stream)); - deflateInit(&stream, zlib_compression_level); + git_deflate_init(&stream, zlib_compression_level); stream.next_in = in; stream.avail_in = size; do { stream.next_out = outbuf; stream.avail_out = sizeof(outbuf); - status = deflate(&stream, Z_FINISH); + status = git_deflate(&stream, Z_FINISH); sha1write(f, outbuf, sizeof(outbuf) - stream.avail_out); } while (status == Z_OK); if (status != Z_STREAM_END) die("unable to deflate appended object (%d)", status); size = stream.total_out; - deflateEnd(&stream); + git_deflate_end(&stream); return size; } |