xwrite: poll on non-blocking FDs
[gitweb.git] / pack-revindex.c
index 5bd7c619803c8457a8c1a1a69a11758d34b49eac..e542ea7703a740916f8d2cac9176674782d37f61 100644 (file)
@@ -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 */
@@ -45,7 +45,7 @@ static void init_pack_revindex(void)
        if (!num)
                return;
        pack_revindex_hashsz = num * 11;
-       pack_revindex = xcalloc(sizeof(*pack_revindex), pack_revindex_hashsz);
+       pack_revindex = xcalloc(pack_revindex_hashsz, sizeof(*pack_revindex));
        for (p = packed_git; p; p = p->next) {
                num = pack_revindex_ix(p);
                num = - 1 - num;