From 703b066f5aed5a486dd5b0b732b2ee2a7549f460 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 11 May 2021 21:52:15 -0700 Subject: [PATCH] buffer and emplace added to ignored. --- src/min_array.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/min_array.h b/src/min_array.h index 967d35d..0a433dc 100644 --- a/src/min_array.h +++ b/src/min_array.h @@ -60,20 +60,21 @@ static type *name##_array_buffer(struct name##_array *const a, \ if(!name##_array_reserve(a, a->size + buffer)) return 0; \ return a->data ? a->data + a->size : 0; \ } \ -/** Adds `n` to the size of `a`; `n` must be smaller than or equal to the - highest remaining buffer value set by _array_buffer>. */ \ +/** Adds `n` to the size of `a`; this must be no more than the maximum + remaining buffer capacity, set by _array_buffer>. */ \ static void name##_array_emplace(struct name##_array *const a, \ const size_t n) { \ assert(a && a->capacity >= a->size && n <= a->capacity - a->size); \ a->size += n; \ } \ /** @return Push back a new un-initialized datum of `a`. -@throws[realloc, ERANGE] */ \ + @throws[realloc, ERANGE] */ \ static type *name##_array_new(struct name##_array *const a) { \ type *const data = name##_array_buffer(a, 1); \ return data ? name##_array_emplace(a, 1), data : 0; \ } \ /* It's perfectly valid that these functions are not used. */ \ static void name##_unused_coda(void); static void name##_unused(void) { \ - name##_array(0); name##_array_new(0); name##_unused_coda(); } \ + name##_array(0); name##_array_buffer(0, 0); name##_array_emplace(0, 0); \ + name##_array_new(0); name##_unused_coda(); } \ static void name##_unused_coda(void) { name##_unused(); }