git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: git <git@vger.kernel.org>
Subject: [PATCH] Warning in apply.c
Date: Sun, 03 Jul 2005 22:50:00 -0400	[thread overview]
Message-ID: <1120445400.1265.23.camel@dv> (raw)

Hello!

gcc 4.0.0 reports one warning while compiling git on x86_64:

gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o git-apply apply.c libgit.a -lz -lcrypto
apply.c: In function 'show_rename_copy':
apply.c:1147: warning: field precision should have type 'int', but argument 3 has type 'long int'

The fix is to cast pointer difference to int.

Signed-off-by: Pavel Roskin <proski@gnu.org>

diff --git a/apply.c b/apply.c
--- a/apply.c
+++ b/apply.c
@@ -1143,7 +1143,7 @@ static void show_rename_copy(struct patc
 	 */
 	if (old != p->old_name)
 		printf(" %s %.*s{%s => %s} (%d%%)\n", renamecopy,
-		       old - p->old_name, p->old_name,
+		       (int)(old - p->old_name), p->old_name,
 		       old, new, p->score);
 	else
 		printf(" %s %s => %s (%d%%)\n", renamecopy,


-- 
Regards,
Pavel Roskin

                 reply	other threads:[~2005-07-04  2:50 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=1120445400.1265.23.camel@dv \
    --to=proski@gnu.org \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).