diff options
author | Peter Pettersson <boretrk@hotmail.com> | 2021-08-25 18:58:39 +0200 |
---|---|---|
committer | Peter Pettersson <boretrk@hotmail.com> | 2021-08-25 19:58:50 +0200 |
commit | bcc0d750298d18ccc18e5b57317d1d7833498018 (patch) | |
tree | 8779f7a6491d61cdab6fe4f64a660c391a3d72a1 | |
parent | efc4e7e56a7b8a406e37ef7b6444996b9e377cc7 (diff) | |
download | libgit2-bcc0d750298d18ccc18e5b57317d1d7833498018.tar.gz |
array: make gcc keep the type of the NULL return value
-rw-r--r-- | src/array.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/array.h b/src/array.h index 03537e796..e649d845b 100644 --- a/src/array.h +++ b/src/array.h @@ -70,13 +70,13 @@ on_oom: #define git_array_alloc(a) \ (((a).size >= (a).asize) ? \ git_array_grow(&(a), sizeof(*(a).ptr)) : \ - ((a).ptr ? &(a).ptr[(a).size++] : NULL)) + ((a).ptr ? &(a).ptr[(a).size++] : (void *)NULL)) -#define git_array_last(a) ((a).size ? &(a).ptr[(a).size - 1] : NULL) +#define git_array_last(a) ((a).size ? &(a).ptr[(a).size - 1] : (void *)NULL) -#define git_array_pop(a) ((a).size ? &(a).ptr[--(a).size] : NULL) +#define git_array_pop(a) ((a).size ? &(a).ptr[--(a).size] : (void *)NULL) -#define git_array_get(a, i) (((i) < (a).size) ? &(a).ptr[(i)] : NULL) +#define git_array_get(a, i) (((i) < (a).size) ? &(a).ptr[(i)] : (void *)NULL) #define git_array_size(a) (a).size |