From 4d1d41985e1f3033ef82e9761b0bc49310008cf0 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 13 Nov 2020 14:19:33 +0100 Subject: bessere Namen für Funktionen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- arraylist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arraylist.c') diff --git a/arraylist.c b/arraylist.c index f72d3e2..bb4d0c2 100644 --- a/arraylist.c +++ b/arraylist.c @@ -17,7 +17,7 @@ struct ArrayList { }; static T ** -ArrayList_allocate(void *ptr, size_t nelem) +ArrayList_allocateArray(void *ptr, size_t nelem) { T **new_ptr = reallocarray(ptr, nelem, sizeof *new_ptr); @@ -79,11 +79,11 @@ ArrayList_growIfNeeded(struct ArrayList *arrayList) static const size_t DEFAULT_CAPACITY = 10; arrayList->capacity = DEFAULT_CAPACITY; - arrayList->array = ArrayList_allocate(NULL, DEFAULT_CAPACITY); + arrayList->array = ArrayList_allocateArray(NULL, DEFAULT_CAPACITY); } else { size_t new_capacity = (arrayList->capacity * 3) / 2; // *= 1.5 - T ** new_arrayList = ArrayList_allocate(arrayList->array, new_capacity); + T ** new_arrayList = ArrayList_allocateArray(arrayList->array, new_capacity); arrayList->capacity = new_capacity; arrayList->array = new_arrayList; -- cgit v1.3