summaryrefslogtreecommitdiff
path: root/pack-objects.c
diff options
context:
space:
mode:
authorFlorian Forster <octo@verplant.org>2006-06-18 15:18:09 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-06-20 08:59:46 (GMT)
commit1d7f171c3a456b980d821ee0f68e01535a5f7e36 (patch)
tree040ae96db3e2d18f84a95cc46ec4d7626bcc1994 /pack-objects.c
parent2bda77e080dd8d47ca0b87c78e9061fbaa37455a (diff)
downloadgit-1d7f171c3a456b980d821ee0f68e01535a5f7e36.zip
git-1d7f171c3a456b980d821ee0f68e01535a5f7e36.tar.gz
git-1d7f171c3a456b980d821ee0f68e01535a5f7e36.tar.bz2
Remove all void-pointer arithmetic.
ANSI C99 doesn't allow void-pointer arithmetic. This patch fixes this in various ways. Usually the strategy that required the least changes was used. Signed-off-by: Florian Forster <octo@verplant.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'pack-objects.c')
-rw-r--r--pack-objects.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pack-objects.c b/pack-objects.c
index 179560f..ba6525d 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -156,7 +156,7 @@ static void prepare_pack_revindex(struct pack_revindex *rix)
rix->revindex = xmalloc(sizeof(unsigned long) * (num_ent + 1));
for (i = 0; i < num_ent; i++) {
- unsigned int hl = *((unsigned int *)(index + 24 * i));
+ unsigned int hl = *((unsigned int *)((char *) index + 24*i));
rix->revindex[i] = ntohl(hl);
}
/* This knows the pack format -- the 20-byte trailer
@@ -300,7 +300,7 @@ static unsigned long write_object(struct sha1file *f,
use_packed_git(p);
datalen = find_packed_object_size(p, entry->in_pack_offset);
- buf = p->pack_base + entry->in_pack_offset;
+ buf = (char *) p->pack_base + entry->in_pack_offset;
sha1write(f, buf, datalen);
unuse_packed_git(p);
hdrlen = 0; /* not really */