fast-import: make code "-Wpointer-arith" clean
authorJonathan Nieder <jrnieder@gmail.com>
Mon, 28 Feb 2011 21:16:59 +0000 (15:16 -0600)
committerJonathan Nieder <jrnieder@gmail.com>
Mon, 28 Feb 2011 21:25:12 +0000 (15:25 -0600)
The dereference() function to peel a tree-ish and find the underlying
tree expects arithmetic to (void *) to work on byte addresses. We
should be reading the text of objects through a char * anyway.

Noticed-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
fast-import.c
index 6c37b8400a143db55e3e16c6a3af788aa0467322..e1268b8cb4ae2ac482928b23e6a3a04bf78c7fcb 100644 (file)
@@ -2848,7 +2848,7 @@ static struct object_entry *dereference(struct object_entry *oe,
                                        unsigned char sha1[20])
 {
        unsigned long size;
-       void *buf = NULL;
+       char *buf = NULL;
        if (!oe) {
                enum object_type type = sha1_object_info(sha1, NULL);
                if (type < 0)