From: Jonathan Nieder Date: Wed, 16 Mar 2011 05:14:22 +0000 (-0500) Subject: mktag: avoid %td in format string X-Git-Tag: v1.7.5-rc0~30^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/31d713d069f6586c3b18aa721ccd668fa994219c?hp=31d713d069f6586c3b18aa721ccd668fa994219c mktag: avoid %td in format string Since v1.7.0-rc0~34 (make "mktag" a built-in, 2010-01-22), git mktag uses the C99-style %td format to print ptrdiff_t values. It falls back to %d when NO_C99_FORMAT is set, on the assumption that pre-C99 systems probably are using 32-bit pointers. But many modern systems are 64-bit and * sometimes one wants to test the NO_C99_FORMAT fallbacks using a modern development platform; * some platforms (I'm looking at you, msvc) have not gotten with the program and are still C89-only. These ptrdiff_t values are offsets from the beginning of a buffer, so a size_t or uintmax_t would work about as well. Use the latter so we can take advantage of the PRIuMAX fallback in git-compat-util.h, even on C99-challenged systems with 64-bit pointers. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano ---