diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 327447debc87ef..1e9c33f9e81a84 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -481,7 +481,7 @@ static void *unpack_raw_entry(struct object_entry *obj, unsigned char *p; size_t size, c; off_t base_offset; - unsigned shift; + size_t shift; void *data; obj->idx.offset = consumed_bytes; @@ -1598,10 +1598,10 @@ static void read_idx_option(struct pack_idx_option *opts, const char *pack_name) static void show_pack_info(int stat_only) { int i, baseobjects = nr_objects - nr_ref_deltas - nr_ofs_deltas; - unsigned long *chain_histogram = NULL; + size_t *chain_histogram = NULL; if (deepest_delta) - chain_histogram = xcalloc(deepest_delta, sizeof(unsigned long)); + chain_histogram = xcalloc(deepest_delta, sizeof(size_t)); for (i = 0; i < nr_objects; i++) { struct object_entry *obj = &objects[i]; @@ -1631,11 +1631,11 @@ static void show_pack_info(int stat_only) for (i = 0; i < deepest_delta; i++) { if (!chain_histogram[i]) continue; - printf_ln(Q_("chain length = %d: %lu object", - "chain length = %d: %lu objects", + printf_ln(Q_("chain length = %d: %"PRIuMAX" object", + "chain length = %d: %"PRIuMAX" objects", chain_histogram[i]), i + 1, - chain_histogram[i]); + (uintmax_t)chain_histogram[i]); } } diff --git a/csum-file.c b/csum-file.c index 3df9bfcaa0aafb..ab777dc2102195 100644 --- a/csum-file.c +++ b/csum-file.c @@ -11,7 +11,7 @@ #include "progress.h" #include "csum-file.h" -static void flush(struct hashfile *f, const void *buf, unsigned int count) +static void flush(struct hashfile *f, const void *buf, size_t count) { if (0 <= f->check_fd && count) { unsigned char check_buffer[8192]; @@ -44,7 +44,7 @@ static void flush(struct hashfile *f, const void *buf, unsigned int count) void hashflush(struct hashfile *f) { - unsigned offset = f->offset; + size_t offset = f->offset; if (offset) { the_hash_algo->update_fn(&f->ctx, f->buffer, offset); @@ -86,12 +86,12 @@ int finalize_hashfile(struct hashfile *f, unsigned char *result, unsigned int fl return fd; } -void hashwrite(struct hashfile *f, const void *buf, unsigned int count) +void hashwrite(struct hashfile *f, const void *buf, size_t count) { while (count) { - unsigned offset = f->offset; - unsigned left = sizeof(f->buffer) - offset; - unsigned nr = count > left ? left : count; + size_t offset = f->offset; + size_t left = sizeof(f->buffer) - offset; + size_t nr = count > left ? left : count; const void *data; if (f->do_crc) diff --git a/csum-file.h b/csum-file.h index a98b1eee53f403..23f07faf49b661 100644 --- a/csum-file.h +++ b/csum-file.h @@ -9,7 +9,7 @@ struct progress; struct hashfile { int fd; int check_fd; - unsigned int offset; + size_t offset; git_hash_ctx ctx; off_t total; struct progress *tp; @@ -37,7 +37,7 @@ struct hashfile *hashfd(int fd, const char *name); struct hashfile *hashfd_check(const char *name); struct hashfile *hashfd_throughput(int fd, const char *name, struct progress *tp); int finalize_hashfile(struct hashfile *, unsigned char *, unsigned int); -void hashwrite(struct hashfile *, const void *, unsigned int); +void hashwrite(struct hashfile *, const void *, size_t); void hashflush(struct hashfile *f); void crc32_begin(struct hashfile *); uint32_t crc32_end(struct hashfile *);