Prefer %d over %i in printf format strings.
PATCH 1/4 Prefer %d over %i in printf format strings.
The git project seems to prefer using %d when formatting signed integer values. These handful of locations were noticed by Junio as not conforming. At least one of them was my fault, perhaps the others were too. :-)
Signed-off-by Shawn O. Pearce <[email protected]>
--- builtin-describe.c | 2 +- receive-pack.c | 2 +- sha1_file.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
builtin-describe.c +1 -1
@@ -182,7 +182,7 @@ static void describe(const char *arg, int last_one)fprintf (stderr,"traversed %lu commits\n" , seen_commits);if (gave_up_on) {fprintf (stderr, -"more than %i tags found; listed %i most recent\n" +"more than %d tags found; listed %d most recent\n" "gave up search at %s\n" , max_candidates, max_candidates,sha1_to_hex (gave_up_on->object.sha1));
receive-pack.c +1 -1
@@ -317,7 +317,7 @@ static const char *unpack(void)char keep_arg[256 ];char packname[46 ]; - s =sprintf (keep_arg,"--keep=receive-pack %i on " ,getpid ()); + s =sprintf (keep_arg,"--keep=receive-pack %d on " ,getpid ());if (gethostname (keep_arg + s,sizeof (keep_arg) - s))strcpy (keep_arg + s,"localhost" );
sha1_file.c +1 -1
@@ -1326,7 +1326,7 @@ void *unpack_entry(struct packed_git *p, unsigned long offset, retval =unpack_compressed_entry (p, &w_curs, offset, size);break ;default : -die ("unknown object type %i in %s" , kind, p->pack_name); +die ("unknown object type %d in %s" , kind, p->pack_name); }unuse_pack (&w_curs);return retval;
Signature · 1 line
1.5.0.rc2.g8a816