From 3614dd5811ebb0b7286e7ad8b66b4ef2ea6cc9c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 30 Sep 2020 10:57:32 +0200 Subject: [PATCH] array: mark array_get_ptr argument as const --- array.c | 2 +- array.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/array.c b/array.c index 0f1e1f0..9c40299 100644 --- 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 index 6c9d8a8..69d6047 100644 --- 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. */ -- 2.11.4.GIT