git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix warning from pack-objects.c
@ 2006-02-23 22:42 Luck, Tony
  2006-02-23 22:51 ` Andreas Ericsson
  0 siblings, 1 reply; 2+ messages in thread
From: Luck, Tony @ 2006-02-23 22:42 UTC (permalink / raw)
  To: git

When compiling on ia64 I get this warning (from gcc 3.4.3):

gcc -o pack-objects.o -c -g -O2 -Wall -DSHA1_HEADER='<openssl/sha.h>'  pack-objects.c
pack-objects.c: In function `pack_revindex_ix':
pack-objects.c:94: warning: cast from pointer to integer of different size

A double cast (first to long, then to int) shuts gcc up, but is there
a better way?

Signed-off-by: Tony Luck <tony.luck@intel.com>

---

diff --git a/pack-objects.c b/pack-objects.c
index 8f352aa..c985fab 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -91,7 +91,7 @@ static int reused_delta = 0;
 
 static int pack_revindex_ix(struct packed_git *p)
 {
-	unsigned int ui = (unsigned int) p;
+	unsigned int ui = (unsigned int)(long)p;
 	int i;
 
 	ui = ui ^ (ui >> 16); /* defeat structure alignment */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-23 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-23 22:42 [PATCH] fix warning from pack-objects.c Luck, Tony
2006-02-23 22:51 ` Andreas Ericsson

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).