vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit cebf2f598dca48dbcd35c515f7d6ed9b34f9d94b parent 2b8c443603ff4cff16e6590b77943566512af8f9 Author: Marc André Tanner <mat@brain-dump.org> Date: Wed, 30 Sep 2020 11:21:52 +0200 array: mark array_capacity 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 @@ -128,7 +128,7 @@ size_t array_length(const Array *arr) { return arr->len; } -size_t array_capacity(Array *arr) { +size_t array_capacity(const Array *arr) { return arr->count; } diff --git a/array.h b/array.h @@ -93,7 +93,7 @@ bool array_remove(Array*, size_t idx); /** Number of elements currently stored in the array. */ size_t array_length(const Array*); /** Number of elements which can be stored without enlarging the array. */ -size_t array_capacity(Array*); +size_t array_capacity(const Array*); /** Remove all elements with index greater or equal to ``length``, keep allocated memory. */ bool array_truncate(Array*, size_t length); /**