[Spice-devel] [PATCH spice-server] red-common: Add a comment for GLIST_FOREACH_GENERIC

Victor Toso victortoso at redhat.com
Tue Jul 9 09:56:57 UTC 2019


On Mon, Jul 08, 2019 at 03:23:49PM +0100, Frediano Ziglio wrote:
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-common.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/server/red-common.h b/server/red-common.h
> index 6b5d0b2e0..03efbdacb 100644
> --- a/server/red-common.h
> +++ b/server/red-common.h
> @@ -79,6 +79,10 @@ typedef struct GListIter {
>      GList *next;
>  } GListIter;
>  
> +/* Iterate thougth a GList. Note that the iteration is "safe" meaning that the

thougth -> through 

> + * 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), \

Acked-by: Victor Toso <victortoso at redhat.com>

> -- 
> 2.20.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20190709/6b547ab5/attachment.sig>


More information about the Spice-devel mailing list