vlc | branch: master | Romain Vimont <[email protected]> | Wed Sep 16 15:54:32 
2020 +0200| [152963ca3e70dc603c3ddd15c0fda715f7cfaedd] | committer: Thomas 
Guillem

vlc_list: prevent name conflict

The macro vlc_list_foreach() declares an internal variable
vlc_list_it_XXX variable for looping, where XXX is the variable provided
by the user to receive the item.

If this name is "next", the resulting internal variable name is
"vlc_list_it_next", which conflicts with the function
vlc_list_it_next().

Add an _ to the internal variable name to prevent it.

Signed-off-by: Thomas Guillem <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=152963ca3e70dc603c3ddd15c0fda715f7cfaedd
---

 include/vlc_list.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/vlc_list.h b/include/vlc_list.h
index 45263cc789..bea20bfd9f 100644
--- a/include/vlc_list.h
+++ b/include/vlc_list.h
@@ -257,11 +257,11 @@ static inline void vlc_list_it_next(struct vlc_list_it 
*restrict it)
  * It is however <b>not</b> safe to delete another item.
  */
 #define vlc_list_foreach(pos, head, member) \
-    for (struct vlc_list_it vlc_list_it_##pos = vlc_list_it_start(head); \
-         vlc_list_it_continue(&(vlc_list_it_##pos)) \
-          && ((pos) = vlc_list_entry_p((vlc_list_it_##pos).current, \
+    for (struct vlc_list_it vlc_list_it__##pos = vlc_list_it_start(head); \
+         vlc_list_it_continue(&(vlc_list_it__##pos)) \
+          && ((pos) = vlc_list_entry_p((vlc_list_it__##pos).current, \
                                        pos, member), true); \
-         vlc_list_it_next(&(vlc_list_it_##pos)))
+         vlc_list_it_next(&(vlc_list_it__##pos)))
 
 /**
  * Converts a list node pointer to an element pointer.

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to