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>
This commit is contained in:

committed by
Junio C Hamano

parent
8858448bb4
commit
ca473cef91
@ -878,7 +878,7 @@ static void grab_common_values(struct atom_value *val, int deref, struct expand_
|
||||
v->s = xstrdup(type_name(oi->type));
|
||||
else if (!strcmp(name, "objectsize")) {
|
||||
v->value = oi->size;
|
||||
v->s = xstrfmt("%lu", oi->size);
|
||||
v->s = xstrfmt("%"PRIuMAX , (uintmax_t)oi->size);
|
||||
}
|
||||
else if (deref)
|
||||
grab_objectname(name, &oi->oid, v, &used_atom[i]);
|
||||
|
Reference in New Issue
Block a user