]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
queue_* doc: explicitly note non-emptiness requirement
authorVladimír Čunát <vladimir.cunat@nic.cz>
Wed, 19 Dec 2018 10:17:01 +0000 (11:17 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 7 Jan 2019 14:03:43 +0000 (15:03 +0100)
lib/generic/queue.h

index 1f09cc0742cde49f79210876a10e6a6eeaa99873..755e7594d43a98ea2f85a3038ce022f15b12ca9a 100644 (file)
 #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)