From: Vladimír Čunát Date: Wed, 19 Dec 2018 10:17:01 +0000 (+0100) Subject: queue_* doc: explicitly note non-emptiness requirement X-Git-Tag: v3.2.1~11^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ac690457d1dea8b183cfcdd94c2fa0ae48681bc4;p=thirdparty%2Fknot-resolver.git queue_* doc: explicitly note non-emptiness requirement --- diff --git a/lib/generic/queue.h b/lib/generic/queue.h index 1f09cc074..755e7594d 100644 --- a/lib/generic/queue.h +++ b/lib/generic/queue.h @@ -98,19 +98,22 @@ #define queue_push_head(q, data) \ *((__typeof__((q).pdata_t)) queue_push_head_impl(&(q).queue)) = data -/** @brief Remove the element at the head. */ +/** @brief Remove the element at the head. + * The queue must not be empty. */ #define queue_pop(q) \ queue_pop_impl(&(q).queue) -/** @brief Return a "reference" to the element at the head (it's an L-value) . */ +/** @brief Return a "reference" to the element at the head (it's an L-value). + * The queue must not be empty. */ #define queue_head(q) \ ( *(__typeof__((q).pdata_t)) queue_head_impl(&(q).queue) ) -/** @brief Return a "reference" to the element at the tail (it's an L-value) . */ +/** @brief Return a "reference" to the element at the tail (it's an L-value). + * The queue must not be empty. */ #define queue_tail(q) \ ( *(__typeof__((q).pdata_t)) queue_tail_impl(&(q).queue) ) -/** @brief Return the number of elements in the queue. */ +/** @brief Return the number of elements in the queue (very efficient). */ #define queue_len(q) \ ((const size_t)(q).queue.len)