From 47d7cb878a2c605f2d2f693a4efef729ebc7c242 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 29 Aug 2021 13:32:34 -0700 Subject: [PATCH] Doc. --- src/min_array.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/min_array.h b/src/min_array.h index 739e1f5..2e1475f 100644 --- a/src/min_array.h +++ b/src/min_array.h @@ -52,10 +52,9 @@ static int name##_array_reserve(struct name##_array *const a, \ a->data = data, a->capacity = c0; \ return 1; \ } \ -/** The capacity of `a` will be increased to at least `n` elements beyond the - size. It will invalidate pointers in `a` if `n` is greater than the buffer - space. @return The start of the buffered space at the back of the array. If - `a` is idle and `buffer` is zero, a null pointer is returned, otherwise null +/** Increases the capacity of `a` to at least `n` elements beyond the size. + @return The start of the buffered space at the back of the array. If `a` is + idle and `buffer` is zero, a null pointer is returned, otherwise null indicates an error. @throws[realloc, ERANGE] */ \ static type *name##_array_buffer(struct name##_array *const a, \ const size_t n) { \ @@ -64,8 +63,7 @@ static type *name##_array_buffer(struct name##_array *const a, \ return name##_array_reserve(a, a->size + n) && a->data \ ? a->data + a->size : 0; \ } \ -/** Adds `n` elements to the back of `a`. It will invalidate pointers in `a` if - `n` is greater than the buffer space. @return A pointer to the elements. If +/** Adds `n` elements to the back of `a`. @return A pointer to the elements. If `a` is idle and `n` is zero, a null pointer will be returned, otherwise null indicates an error. @throws[realloc, ERANGE] */ \ static type *name##_array_append(struct name##_array *const a, \ @@ -75,8 +73,8 @@ static type *name##_array_append(struct name##_array *const a, \ assert(n <= a->capacity && a->size <= a->capacity - n); \ return a->size += n, buffer; \ } \ -/** @return Adds (push back) one new element of `a`. The buffer holds an - element or it will invalidate pointers in `a`. @throws[realloc, ERANGE] */ \ +/** @return Adds (push back) one new element of `a`. + @throws[realloc, ERANGE] */ \ static type *name##_array_new(struct name##_array *const a) \ { return name##_array_append(a, 1); } \ /* It's perfectly valid that these functions are not used. */ \