vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 62f49a834ba71a0c1e31d8ba8f075b0d1fff6070 parent 605367df045e25ac74a43726fdc72d9c0ecec1cf Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 30 Sep 2020 10:57:32 +0200 array: mark array_get_ptr argument as const Diffstat:
| M | array.c | | | 2 | +- |
| M | array.h | | | 2 | +- |
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/array.c b/array.c @@ -63,7 +63,7 @@ void *array_get(const Array *arr, size_t idx) { return arr->items + (idx * arr->elem_size); } -void *array_get_ptr(Array *arr, size_t idx) { +void *array_get_ptr(const Array *arr, size_t idx) { if (arr->elem_size != sizeof(void*)) { errno = ENOTSUP; return NULL; diff --git a/array.h b/array.h @@ -76,7 +76,7 @@ void *array_get(const Array*, size_t idx); */ bool array_set(Array*, size_t idx, void *item); /** Dereference pointer stored in array element. */ -void *array_get_ptr(Array*, size_t idx); +void *array_get_ptr(const Array*, size_t idx); /** Store the address to which ``item`` points to into the array. */ bool array_set_ptr(Array*, size_t idx, void *item); /** Add element to the end of the array. */