From 863211feb62023e37cad3f57cc72b2bb30262383 Mon Sep 17 00:00:00 2001 From: lurchi Date: Mon, 21 Aug 2017 01:09:15 +0200 Subject: [PATCH] improve documentation about the GNUNET_array_append and GNUNET_array_grow macros --- src/include/gnunet_common.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index bda011fb2..950f5cc34 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -973,7 +973,8 @@ GNUNET_ntoh_double (double d); * arr is important since size is the number of elements and * not the size in bytes * @param size the number of elements in the existing vector (number - * of elements to copy over) + * of elements to copy over), will be updated with the new + * array size * @param tsize the target size for the resulting vector, use 0 to * free the vector (then, arr will be NULL afterwards). */ @@ -981,8 +982,16 @@ GNUNET_ntoh_double (double d); /** * @ingroup memory - * Append an element to a list (growing the - * list by one). + * Append an element to a list (growing the list by one). + * + * @param arr base-pointer of the vector, may be NULL if size is 0; + * will be updated to reflect the new address. The TYPE of + * arr is important since size is the number of elements and + * not the size in bytes + * @param size the number of elements in the existing vector (number + * of elements to copy over), will be updated with the new + * array size + * @param element the element that will be appended to the array */ #define GNUNET_array_append(arr,size,element) do { GNUNET_array_grow(arr,size,size+1); arr[size-1] = element; } while(0) -- 2.25.1