diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-11-19 16:24:41 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-19 16:24:41 +0900 |
commit | f5f0f68d61301c3ffb2f8da84f627547e8f9a94c (patch) | |
tree | 2c4e826363e1febaaf1c7fd6187e8fa714561c5d /builtin/index-pack.c | |
parent | Merge branch 'tb/xcurl-off-t' (diff) | |
parent | Upcast size_t variables to uintmax_t when printing (diff) | |
download | tgif-f5f0f68d61301c3ffb2f8da84f627547e8f9a94c.tar.xz |
Merge branch 'tb/print-size-t-with-uintmax-format'
Code preparation to replace ulong vars with size_t vars where
appropriate.
* tb/print-size-t-with-uintmax-format:
Upcast size_t variables to uintmax_t when printing
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r-- | builtin/index-pack.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c index 682042579b..ac1f4ea9a7 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -424,7 +424,8 @@ static void *unpack_entry_data(off_t offset, unsigned long size, int hdrlen; if (!is_delta_type(type)) { - hdrlen = xsnprintf(hdr, sizeof(hdr), "%s %lu", type_name(type), size) + 1; + hdrlen = xsnprintf(hdr, sizeof(hdr), "%s %"PRIuMAX, + type_name(type),(uintmax_t)size) + 1; the_hash_algo->init_fn(&c); the_hash_algo->update_fn(&c, hdr, hdrlen); } else @@ -1597,10 +1598,10 @@ static void show_pack_info(int stat_only) chain_histogram[obj_stat[i].delta_depth - 1]++; if (stat_only) continue; - printf("%s %-6s %lu %lu %"PRIuMAX, + printf("%s %-6s %"PRIuMAX" %"PRIuMAX" %"PRIuMAX, oid_to_hex(&obj->idx.oid), - type_name(obj->real_type), obj->size, - (unsigned long)(obj[1].idx.offset - obj->idx.offset), + type_name(obj->real_type), (uintmax_t)obj->size, + (uintmax_t)(obj[1].idx.offset - obj->idx.offset), (uintmax_t)obj->idx.offset); if (is_delta_type(obj->type)) { struct object_entry *bobj = &objects[obj_stat[i].base_object_no]; |