summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2018-11-11 07:05:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-12 07:43:52 (GMT)
commitca473cef9140f55d68d6758fe226ef47c216669c (patch)
tree62b470517f2f74c50c9204431d2a8d5354d7a4e8 /fast-import.c
parent8858448bb49332d353febc078ce4a3abcc962efe (diff)
downloadgit-ca473cef9140f55d68d6758fe226ef47c216669c.zip
git-ca473cef9140f55d68d6758fe226ef47c216669c.tar.gz
git-ca473cef9140f55d68d6758fe226ef47c216669c.tar.bz2
Upcast size_t variables to uintmax_t when printing
When printing variables which contain a size, today "unsigned long" is used at many places. In order to be able to change the type from "unsigned long" into size_t some day in the future, we need to have a way to print 64 bit variables on a system that has "unsigned long" defined to be 32 bit, like Win64. Upcast all those variables into uintmax_t before they are printed. This is to prepare for a bigger change, when "unsigned long" will be converted into size_t for variables which may be > 4Gib. Signed-off-by: Torsten Bögershausen <tboegi@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fast-import.c b/fast-import.c
index 95600c7..6988668 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -2955,8 +2955,8 @@ static void cat_blob(struct object_entry *oe, struct object_id *oid)
die("Object %s is a %s but a blob was expected.",
oid_to_hex(oid), type_name(type));
strbuf_reset(&line);
- strbuf_addf(&line, "%s %s %lu\n", oid_to_hex(oid),
- type_name(type), size);
+ strbuf_addf(&line, "%s %s %"PRIuMAX"\n", oid_to_hex(oid),
+ type_name(type), (uintmax_t)size);
cat_blob_write(line.buf, line.len);
strbuf_release(&line);
cat_blob_write(buf, size);