[Spice-commits] server/red-common.h
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jul 9 10:11:13 UTC 2019
server/red-common.h | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit a0497f0407d126bb8fcae943fe78846d46ff0101
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Sat Jun 1 00:45:33 2019 +0100
red-common: Add a comment for GLIST_FOREACH_GENERIC
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Victor Toso <victortoso at redhat.com>
diff --git a/server/red-common.h b/server/red-common.h
index 6b5d0b2e..223f2869 100644
--- a/server/red-common.h
+++ b/server/red-common.h
@@ -79,6 +79,10 @@ typedef struct GListIter {
GList *next;
} GListIter;
+/* Iterate through a GList. Note that the iteration is "safe" meaning that the
+ * current item can be removed while the list is scanned. This is required as
+ * the code inside the loop in some cases can remove the element we are
+ * processing */
#define GLIST_FOREACH_GENERIC(_list, _iter, _type, _data, _dir) \
for (GListIter _iter = { .link = _list }; \
(_data = (_type *) (_iter.link ? _iter.link->data : NULL), \
More information about the Spice-commits
mailing list