All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Warning in apply.c
@ 2005-07-04  2:50 Pavel Roskin
  0 siblings, 0 replies; only message in thread
From: Pavel Roskin @ 2005-07-04  2:50 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-07-04  2:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-04  2:50 [PATCH] Warning in apply.c Pavel Roskin

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.