[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 02/26] queue: Add macro for incremental traversal
From: |
Lluís Vilanova |
Subject: |
[Qemu-devel] [PATCH v7 02/26] queue: Add macro for incremental traversal |
Date: |
Thu, 22 Jun 2017 20:41:32 +0300 |
User-agent: |
StGit/0.17.1-dirty |
Adds macro QTAILQ_FOREACH_CONTINUE to support incremental list
traversal.
Signed-off-by: Lluís Vilanova <address@hidden>
---
include/qemu/queue.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/qemu/queue.h b/include/qemu/queue.h
index 35292c3155..eb2bf9cb1c 100644
--- a/include/qemu/queue.h
+++ b/include/qemu/queue.h
@@ -415,6 +415,18 @@ struct {
\
(var); \
(var) = ((var)->field.tqe_next))
+/**
+ * QTAILQ_FOREACH_CONTINUE:
+ * @var: Variable to resume iteration from.
+ * @field: Field in @var holding a QTAILQ_ENTRY for this queue.
+ *
+ * Resumes iteration on a queue from the element in @var.
+ */
+#define QTAILQ_FOREACH_CONTINUE(var, field) \
+ for ((var) = ((var)->field.tqe_next); \
+ (var); \
+ (var) = ((var)->field.tqe_next))
+
#define QTAILQ_FOREACH_SAFE(var, head, field, next_var) \
for ((var) = ((head)->tqh_first); \
(var) && ((next_var) = ((var)->field.tqe_next), 1); \
- [Qemu-devel] [RFC PATCH v7 00/26] translate: [tcg] Generic translation framework, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 02/26] queue: Add macro for incremental traversal, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 04/26] target: [tcg] Add generic translation framework, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 08/26] target: [tcg, i386] Refactor init_globals, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 01/26] Pass generic CPUState to gen_intermediate_code(), Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 03/26] cpu-exec: Avoid global variables in icount-related functions, Lluís Vilanova, 2017/06/22
- Re: [Qemu-devel] [RFC PATCH v7 00/26] translate: [tcg] Generic translation framework, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [RFC PATCH v7 00/26] translate: [tcg] Generic translation framework, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [RFC PATCH v7 00/26] translate: [tcg] Generic translation framework, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 02/26] queue: Add macro for incremental traversal, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 04/26] target: [tcg] Add generic translation framework, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 03/26] cpu-exec: Avoid global variables in icount-related functions, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 07/26] target: [tcg, i386] Refactor init_disas_context, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 08/26] target: [tcg, i386] Refactor init_globals, Lluís Vilanova, 2017/06/22
- [Qemu-devel] [PATCH v7 09/26] target: [tcg, i386] Refactor insn_start, Lluís Vilanova, 2017/06/22