aboutsummaryrefslogtreecommitdiff
path: root/builtin/pack-objects.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-08-16 11:23:26 -0700
committerJunio C Hamano <gitster@pobox.com>2011-08-16 11:23:26 -0700
commita35d78c0f483a65ea96c4f0c9a825bf28a386273 (patch)
treea20407fc5fbce3b190a364d10c47d807433ec9a5 /builtin/pack-objects.c
parent184cb4d6899a2644b07c11bef71df869a851f525 (diff)
parente01503b523e79748ac91d876f506811c597d03cb (diff)
downloadgit-a35d78c0f483a65ea96c4f0c9a825bf28a386273.tar.gz
git-a35d78c0f483a65ea96c4f0c9a825bf28a386273.tar.xz
Merge branch 'jc/zlib-wrap' into maint
* 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
Diffstat (limited to 'builtin/pack-objects.c')
-rw-r--r--builtin/pack-objects.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index f402a843b..c6e2d8766 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -126,13 +126,13 @@ static void *get_delta(struct object_entry *entry)
static unsigned long do_compress(void **pptr, unsigned long size)
{
- z_stream stream;
+ git_zstream stream;
void *in, *out;
unsigned long maxsize;
memset(&stream, 0, sizeof(stream));
- deflateInit(&stream, pack_compression_level);
- maxsize = deflateBound(&stream, size);
+ git_deflate_init(&stream, pack_compression_level);
+ maxsize = git_deflate_bound(&stream, size);
in = *pptr;
out = xmalloc(maxsize);
@@ -142,9 +142,9 @@ static unsigned long do_compress(void **pptr, unsigned long size)
stream.avail_in = size;
stream.next_out = out;
stream.avail_out = maxsize;
- while (deflate(&stream, Z_FINISH) == Z_OK)
+ while (git_deflate(&stream, Z_FINISH) == Z_OK)
; /* nothing */
- deflateEnd(&stream);
+ git_deflate_end(&stream);
free(in);
return stream.total_out;
@@ -160,7 +160,7 @@ static int check_pack_inflate(struct packed_git *p,
off_t len,
unsigned long expect)
{
- z_stream stream;
+ git_zstream stream;
unsigned char fakebuf[4096], *in;
int st;
@@ -187,12 +187,12 @@ static void copy_pack_data(struct sha1file *f,
off_t len)
{
unsigned char *in;
- unsigned int avail;
+ unsigned long avail;
while (len) {
in = use_pack(p, w_curs, offset, &avail);
if (avail > len)
- avail = (unsigned int)len;
+ avail = (unsigned long)len;
sha1write(f, in, avail);
offset += avail;
len -= avail;
@@ -994,7 +994,7 @@ static void check_object(struct object_entry *entry)
const unsigned char *base_ref = NULL;
struct object_entry *base_entry;
unsigned long used, used_0;
- unsigned int avail;
+ unsigned long avail;
off_t ofs;
unsigned char *buf, c;