Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Bögershausen <tboegi@web.de>2018-11-11 10:05:04 +0300
committerJunio C Hamano <gitster@pobox.com>2018-11-12 10:43:52 +0300
commitca473cef9140f55d68d6758fe226ef47c216669c (patch)
tree62b470517f2f74c50c9204431d2a8d5354d7a4e8 /builtin/fast-export.c
parent8858448bb49332d353febc078ce4a3abcc962efe (diff)
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 'builtin/fast-export.c')
-rw-r--r--builtin/fast-export.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 456797c12a4..5790f0d554b 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -253,7 +253,7 @@ static void export_blob(const struct object_id *oid)
mark_next_object(object);
- printf("blob\nmark :%"PRIu32"\ndata %lu\n", last_idnum, size);
+ printf("blob\nmark :%"PRIu32"\ndata %"PRIuMAX"\n", last_idnum, (uintmax_t)size);
if (size && fwrite(buf, size, 1, stdout) != 1)
die_errno("could not write blob '%s'", oid_to_hex(oid));
printf("\n");