vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 605367df045e25ac74a43726fdc72d9c0ecec1cf parent 909624d6892650e2205b74640cf922b8f31c872a Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 30 Sep 2020 10:56:41 +0200 array: mark array_get 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 @@ -55,7 +55,7 @@ void array_clear(Array *arr) { memset(arr->items, 0, arr->count * arr->elem_size); } -void *array_get(Array *arr, size_t idx) { +void *array_get(const Array *arr, size_t idx) { if (idx >= arr->len) { errno = EINVAL; return NULL; diff --git a/array.h b/array.h @@ -66,7 +66,7 @@ bool array_reserve(Array*, size_t count); * of new elements) might invalidate the pointer. * @endrst */ -void *array_get(Array*, size_t idx); +void *array_get(const Array*, size_t idx); /** * Set array element. * @rst