summaryrefslogtreecommitdiff
path: root/pack-revindex.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2015-10-26 13:15:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-10-26 20:24:03 (GMT)
commit56a1a3ab449df33268776a8b72a301d3ee67ad8d (patch)
tree151de5a2bd3b18e97da16590f03c660a5cb5103e /pack-revindex.c
parent8f7744235844c44e780e026868beef29693c062e (diff)
downloadgit-56a1a3ab449df33268776a8b72a301d3ee67ad8d.zip
git-56a1a3ab449df33268776a8b72a301d3ee67ad8d.tar.gz
git-56a1a3ab449df33268776a8b72a301d3ee67ad8d.tar.bz2
Silence GCC's "cast of pointer to integer of a different size" warning
When calculating hashes from pointers, it actually makes sense to cut off the most significant bits. In that case, said warning does not make a whole lot of sense. So let's just work around it by casting the pointer first to intptr_t and then casting up/down to the final integral type. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-revindex.c')
-rw-r--r--pack-revindex.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pack-revindex.c b/pack-revindex.c
index 5c8376e..e542ea7 100644
--- a/pack-revindex.c
+++ b/pack-revindex.c
@@ -21,7 +21,7 @@ static int pack_revindex_hashsz;
static int pack_revindex_ix(struct packed_git *p)
{
- unsigned long ui = (unsigned long)p;
+ unsigned long ui = (unsigned long)(intptr_t)p;
int i;
ui = ui ^ (ui >> 16); /* defeat structure alignment */