queue_* doc: explicitly note non-emptiness requirement

parent 0c957722
...@@ -98,19 +98,22 @@ ...@@ -98,19 +98,22 @@
#define queue_push_head(q, data) \ #define queue_push_head(q, data) \
*((__typeof__((q).pdata_t)) queue_push_head_impl(&(q).queue)) = 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) \ #define queue_pop(q) \
queue_pop_impl(&(q).queue) 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) \ #define queue_head(q) \
( *(__typeof__((q).pdata_t)) queue_head_impl(&(q).queue) ) ( *(__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) \ #define queue_tail(q) \
( *(__typeof__((q).pdata_t)) queue_tail_impl(&(q).queue) ) ( *(__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) \ #define queue_len(q) \
((const size_t)(q).queue.len) ((const size_t)(q).queue.len)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment