summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Koegler <martin.koegler@chello.at>2017-08-16 22:16:26 +0200
committerJunio C Hamano <gitster@pobox.com>2017-08-16 21:04:56 -0700
commitaa775ea03e67cd3ceada396d043506d704e38a3e (patch)
tree67393044d15083a62d3b81ae7dbe3be6c8a6672b
parent7dc9837b97b0c8fb2499ae3b2ab83edbe36157ea (diff)
downloadgit-aa775ea03e67cd3ceada396d043506d704e38a3e.tar.gz
Convert unpack-objects to size_t
Signed-off-by: Martin Koegler <martin.koegler@chello.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/unpack-objects.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 001dd4ba74..0d8b6b3814 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -31,7 +31,7 @@ static struct fsck_options fsck_options = FSCK_OPTIONS_STRICT;
*/
struct obj_buffer {
char *buffer;
- unsigned long size;
+ size_t size;
};
static struct decoration obj_decorate;
@@ -41,7 +41,7 @@ static struct obj_buffer *lookup_object_buffer(struct object *base)
return lookup_decoration(&obj_decorate, base);
}
-static void add_object_buffer(struct object *object, char *buffer, unsigned long size)
+static void add_object_buffer(struct object *object, char *buffer, size_t size)
{
struct obj_buffer *obj;
obj = xcalloc(1, sizeof(struct obj_buffer));
@@ -93,7 +93,7 @@ static void use(int bytes)
die(_("pack exceeds maximum allowed size"));
}
-static void *get_data(unsigned long size)
+static void *get_data(size_t size)
{
git_zstream stream;
void *buf = xmallocz(size);
@@ -130,7 +130,7 @@ struct delta_info {
struct object_id base_oid;
unsigned nr;
off_t base_offset;
- unsigned long size;
+ size_t size;
void *delta;
struct delta_info *next;
};
@@ -139,7 +139,7 @@ static struct delta_info *delta_list;
static void add_delta_to_list(unsigned nr, const struct object_id *base_oid,
off_t base_offset,
- void *delta, unsigned long size)
+ void *delta, size_t size)
{
struct delta_info *info = xmalloc(sizeof(*info));
@@ -226,7 +226,7 @@ static void write_rest(void)
}
static void added_object(unsigned nr, enum object_type type,
- void *data, unsigned long size);
+ void *data, size_t size);
/*
* Write out nr-th object from the list, now we know the contents
@@ -234,7 +234,7 @@ static void added_object(unsigned nr, enum object_type type,
* to be checked at the end.
*/
static void write_object(unsigned nr, enum object_type type,
- void *buf, unsigned long size)
+ void *buf, size_t size)
{
if (!strict) {
if (write_sha1_file(buf, size, typename(type), obj_list[nr].oid.hash) < 0)
@@ -291,7 +291,7 @@ static void resolve_delta(unsigned nr, enum object_type type,
* resolve all the deltified objects that are based on it.
*/
static void added_object(unsigned nr, enum object_type type,
- void *data, unsigned long size)
+ void *data, size_t size)
{
struct delta_info **p = &delta_list;
struct delta_info *info;
@@ -310,7 +310,7 @@ static void added_object(unsigned nr, enum object_type type,
}
}
-static void unpack_non_delta_entry(enum object_type type, unsigned long size,
+static void unpack_non_delta_entry(enum object_type type, size_t size,
unsigned nr)
{
void *buf = get_data(size);
@@ -436,7 +436,7 @@ static void unpack_one(unsigned nr)
{
unsigned shift;
unsigned char *pack;
- unsigned long size, c;
+ size_t size, c;
enum object_type type;
obj_list[nr].offset = consumed_bytes;