Skip to content

Commit

Permalink
fix warning from pack-objects.c
Browse files Browse the repository at this point in the history
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?

[jc: Andreas Ericsson suggests to use ulong instead. ]

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Luck, Tony authored and Junio C Hamano committed Feb 25, 2006
1 parent f0b0af1 commit 8fcf1ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int reused_delta = 0;

static int pack_revindex_ix(struct packed_git *p)
{
unsigned int ui = (unsigned int) p;
unsigned long ui = (unsigned long)(long)p;
int i;

ui = ui ^ (ui >> 16); /* defeat structure alignment */
Expand Down

0 comments on commit 8fcf1ad

Please sign in to comment.