From: Junio C Hamano Date: Thu, 29 Jan 2009 08:32:52 +0000 (-0800) Subject: Sync with 1.6.1.2 X-Git-Tag: v1.6.2-rc0~63 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8c95d3c31b5493ea229808669c811ad9102143fe?ds=inline;hp=-c Sync with 1.6.1.2 Signed-off-by: Junio C Hamano --- 8c95d3c31b5493ea229808669c811ad9102143fe diff --combined sha1_file.c index 360f7e5a02,ce5ea12c44..8868b800cb --- a/sha1_file.c +++ b/sha1_file.c @@@ -1196,8 -1196,8 +1196,8 @@@ static int unpack_sha1_header(z_stream stream->avail_out = bufsiz; if (legacy_loose_object(map)) { - inflateInit(stream); - return inflate(stream, 0); + git_inflate_init(stream); + return git_inflate(stream, 0); } @@@ -1217,7 -1217,7 +1217,7 @@@ /* Set up the stream for the rest.. */ stream->next_in = map; stream->avail_in = mapsize; - inflateInit(stream); + git_inflate_init(stream); /* And generate the fake traditional header */ stream->total_out = 1 + snprintf(buffer, bufsiz, "%s %lu", @@@ -1254,11 -1254,11 +1254,11 @@@ static void *unpack_sha1_rest(z_stream stream->next_out = buf + bytes; stream->avail_out = size - bytes; while (status == Z_OK) - status = inflate(stream, Z_FINISH); + status = git_inflate(stream, Z_FINISH); } buf[size] = 0; if (status == Z_STREAM_END && !stream->avail_in) { - inflateEnd(stream); + git_inflate_end(stream); return buf; } @@@ -1348,15 -1348,15 +1348,15 @@@ unsigned long get_size_from_delta(struc stream.next_out = delta_head; stream.avail_out = sizeof(delta_head); - inflateInit(&stream); + git_inflate_init(&stream); do { in = use_pack(p, w_curs, curpos, &stream.avail_in); stream.next_in = in; - st = inflate(&stream, Z_FINISH); + st = git_inflate(&stream, Z_FINISH); curpos += stream.next_in - in; } while ((st == Z_OK || st == Z_BUF_ERROR) && stream.total_out < sizeof(delta_head)); - inflateEnd(&stream); + git_inflate_end(&stream); if ((st != Z_STREAM_END) && stream.total_out != sizeof(delta_head)) { error("delta data unpack-initial failed"); return 0; @@@ -1585,14 -1585,14 +1585,14 @@@ static void *unpack_compressed_entry(st stream.next_out = buffer; stream.avail_out = size; - inflateInit(&stream); + git_inflate_init(&stream); do { in = use_pack(p, w_curs, curpos, &stream.avail_in); stream.next_in = in; - st = inflate(&stream, Z_FINISH); + st = git_inflate(&stream, Z_FINISH); curpos += stream.next_in - in; } while (st == Z_OK || st == Z_BUF_ERROR); - inflateEnd(&stream); + git_inflate_end(&stream); if ((st != Z_STREAM_END) || stream.total_out != size) { free(buffer); return NULL; @@@ -1700,9 -1700,6 +1700,9 @@@ static void add_delta_base_cache(struc delta_base_cache_lru.prev = &ent->lru; } +static void *read_object(const unsigned char *sha1, enum object_type *type, + unsigned long *size); + static void *unpack_delta_entry(struct packed_git *p, struct pack_window **w_curs, off_t curpos, @@@ -2020,7 -2017,7 +2020,7 @@@ static int sha1_loose_object_info(cons status = error("unable to parse %s header", sha1_to_hex(sha1)); else if (sizep) *sizep = size; - inflateEnd(&stream); + git_inflate_end(&stream); munmap(map, mapsize); return status; } @@@ -2133,8 -2130,8 +2133,8 @@@ int pretend_sha1_file(void *buf, unsign return 0; } -void *read_object(const unsigned char *sha1, enum object_type *type, - unsigned long *size) +static void *read_object(const unsigned char *sha1, enum object_type *type, + unsigned long *size) { unsigned long mapsize; void *map, *buf; @@@ -2340,7 -2337,8 +2340,8 @@@ static int create_tmpfile(char *buffer static int write_loose_object(const unsigned char *sha1, char *hdr, int hdrlen, void *buf, unsigned long len, time_t mtime) { - int fd, size, ret; + int fd, ret; + size_t size; unsigned char *compressed; z_stream stream; char *filename;