Skip to content

Commit bcc0d75

Browse files
committed
array: make gcc keep the type of the NULL return value
1 parent efc4e7e commit bcc0d75

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/array.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ GIT_INLINE(void *) git_array_grow(void *_a, size_t item_size)
7070
#define git_array_alloc(a) \
7171
(((a).size >= (a).asize) ? \
7272
git_array_grow(&(a), sizeof(*(a).ptr)) : \
73-
((a).ptr ? &(a).ptr[(a).size++] : NULL))
73+
((a).ptr ? &(a).ptr[(a).size++] : (void *)NULL))
7474

75-
#define git_array_last(a) ((a).size ? &(a).ptr[(a).size - 1] : NULL)
75+
#define git_array_last(a) ((a).size ? &(a).ptr[(a).size - 1] : (void *)NULL)
7676

77-
#define git_array_pop(a) ((a).size ? &(a).ptr[--(a).size] : NULL)
77+
#define git_array_pop(a) ((a).size ? &(a).ptr[--(a).size] : (void *)NULL)
7878

79-
#define git_array_get(a, i) (((i) < (a).size) ? &(a).ptr[(i)] : NULL)
79+
#define git_array_get(a, i) (((i) < (a).size) ? &(a).ptr[(i)] : (void *)NULL)
8080

8181
#define git_array_size(a) (a).size
8282

0 commit comments

Comments
 (0)