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>
This commit is contained in:

committed by
Junio C Hamano

parent
2bda77e080
commit
1d7f171c3a
@ -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 */
|
||||
|
Reference in New Issue
Block a user