* [PATCH 1/4] Prefer %d over %i in printf format strings.
@ 2007-01-27 6:51 Shawn O. Pearce
0 siblings, 0 replies; only message in thread
From: Shawn O. Pearce @ 2007-01-27 6:51 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
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 <spearce@spearce.org>
---
builtin-describe.c | 2 +-
receive-pack.c | 2 +-
sha1_file.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin-describe.c b/builtin-describe.c
index 4921eee..f8afb9c 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -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));
diff --git a/receive-pack.c b/receive-pack.c
index 7d26326..19bc685 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -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");
diff --git a/sha1_file.c b/sha1_file.c
index 498665e..335b4b4 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -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;
--
1.5.0.rc2.g8a816
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-01-27 6:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-27 6:51 [PATCH 1/4] Prefer %d over %i in printf format strings Shawn O. Pearce
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.