From: "Shawn O. Pearce" <spearce@spearce•org>
To: Junio C Hamano <junkio@cox•net>
Cc: git@vger•kernel.org
Subject: [PATCH 1/4] Prefer %d over %i in printf format strings.
Date: Sat, 27 Jan 2007 01:51:56 -0500 [thread overview]
Message-ID: <20070127065156.GA10380@spearce.org> (raw)
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
reply other threads:[~2007-01-27 6:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070127065156.GA10380@spearce.org \
--to=spearce@spearce$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
--cc=junkio@cox$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox