@ -783,10 +783,11 @@ int read_cache(void)
@@ -783,10 +783,11 @@ int read_cache(void)
* in 4-byte network byte order.
*/
unsigned long extsize;
memcpy(&extsize, map + offset + 4, 4);
memcpy(&extsize, (char *) map + offset + 4, 4);
extsize = ntohl(extsize);
if (read_index_extension(map + offset,
map + offset + 8, extsize) < 0)
if (read_index_extension(((const char *) map) + offset,
(char *) map + offset + 8,
extsize) < 0)
goto unmap;
offset += 8;
offset += extsize;
@ -820,7 +821,7 @@ static int ce_write(SHA_CTX *context, int fd, void *data, unsigned int len)
@@ -820,7 +821,7 @@ static int ce_write(SHA_CTX *context, int fd, void *data, unsigned int len)
@ -853,7 +854,7 @@ static unsigned long unpack_object_header(struct packed_git *p, unsigned long of
@@ -853,7 +854,7 @@ static unsigned long unpack_object_header(struct packed_git *p, unsigned long of
if (offset >= p->pack_size)
die("object offset outside of pack file");
pack = p->pack_base + offset;
pack = (unsigned char *) p->pack_base + offset;
c = *pack++;
offset++;
*type = (c >> 4) & 7;
@ -883,7 +884,7 @@ int check_reuse_pack_delta(struct packed_git *p, unsigned long offset,
@@ -883,7 +884,7 @@ int check_reuse_pack_delta(struct packed_git *p, unsigned long offset,
@ -1134,7 +1135,7 @@ int nth_packed_object_sha1(const struct packed_git *p, int n,
@@ -1134,7 +1135,7 @@ int nth_packed_object_sha1(const struct packed_git *p, int n,
void *index = p->index_base + 256;
if (n < 0 || num_packed_objects(p) <= n)
return -1;
memcpy(sha1, (index + 24 * n + 4), 20);
memcpy(sha1, (char *) index + (24 * n) + 4, 20);
return 0;
}
@ -1148,9 +1149,9 @@ int find_pack_entry_one(const unsigned char *sha1,
@@ -1148,9 +1149,9 @@ int find_pack_entry_one(const unsigned char *sha1,
do {
int mi = (lo + hi) / 2;
int cmp = memcmp(index + 24 * mi + 4, sha1, 20);
int cmp = memcmp((char *) index + (24 * mi) + 4, sha1, 20);
if (!cmp) {
e->offset = ntohl(*((unsigned int *)(index + 24 * mi)));
e->offset = ntohl(*((unsigned int *) ((char *) index + (24 * mi))));
@ -47,10 +47,10 @@ int parse_tag_buffer(struct tag *item, void *data, unsigned long size)
@@ -47,10 +47,10 @@ int parse_tag_buffer(struct tag *item, void *data, unsigned long size)
if (size < 64)
return -1;
if (memcmp("object ", data, 7) || get_sha1_hex(data + 7, object))
if (memcmp("object ", data, 7) || get_sha1_hex((char *) data + 7, object))