<html><head></head><body>The objects tree is a tree. Each object has a list of children.<br><br><div class="gmail_quote">Le 20 août 2018 13:57:10 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 20/08/2018 12:05, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> This is standard terminology for a tree structure. Siblings are on <br> same level. Children are below and parent is above.<br></blockquote><br>For me a list is flat, not a tree. You can always transverse them back <br>and forth, but not up and down. The implementation doesn't do that either.<br><br>The main storage (head) is in one place and the nodes are in another one <br>and they are not equivalent.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"><br> Le 20 août 2018 10:24:51 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a <br> écrit :<br><br> An example of the confusion we want to avoid and what led me to dig into<br> this code:<br><br> vlc_list siblings<br><br> Is is a list or a list item/node ? The plural led me to think it it's a<br> list of siblings but I was wrong. Having "vlc_list_node siblings" would<br> clear that confusion.<br><br><br> On 20/08/2018 09:21, Steve Lhomme wrote:<br><br> On 17/08/2018 19:06, Rémi Denis-Courmont wrote:<br><br> You cannot have a different typedef here. This is by<br> design. And we already use different member names for<br> heads and nodes. <br><br> It's possible, it's even desirable. "vlc_list node" is the<br> part that doesn't make sense here. A node is not a list, the<br> fact it shares the same internals is because of the current<br> design. It may change in the future, but what is 100% is that<br> a node must not be used as a vlc_list despite its type. And so<br> it should not imply it can be from its type (maybe the<br> mnemonic is wrong, who knows).<br><br> Le 17 août 2018 16:04:33 GMT+03:00, Steve Lhomme<br> <robux4@ycbcr.xyz> a écrit : --- <br> include/vlc_list.h | 23 +++++++++++++---------- 1<br> file changed, 13 insertions(+), 10 deletions(-) diff<br> --git a/include/vlc_list.h b/include/vlc_list.h index<br> 45263cc789..002119db6b 100644 --- a/include/vlc_list.h<br> +++ b/include/vlc_list.h @@ -45,6 +45,9 @@ struct<br> vlc_list struct vlc_list *next; }; <br> +/* type to use in list items to differentiate with<br> the list itself */ +typedef struct vlc_list <br> vlc_list_node; + /** * Static initializer<br> for a list head. */ @@ -66,7 +69,7 @@ static<br> inline void vlc_list_init(struct vlc_list *restrict head)<br> * \param prev Node pointer of the previous element.<br> * \param next Node pointer of the next element.<br> */ -static inline void<br> vlc_list_add_between(struct vlc_list *restrict node, <br> +static inline void vlc_list_add_between(vlc_list_node<br> *restrict node,<br> struct<br> vlc_list *prev,<br> struct<br> vlc_list *next) { @@ -82,7 +85,7 @@ static<br> inline void vlc_list_add_between(struct vlc_list *restrict<br> node, * \param node Node pointer of the element to<br> insert [OUT]. * \param prev Node pointer of the<br> previous element. */ -static inline void<br> vlc_list_add_after(struct vlc_list *restrict node, <br> +static inline void vlc_list_add_after(vlc_list_node<br> *restrict node,<br> struct<br> vlc_list *prev) { <br> vlc_list_add_between(node, prev, prev->next); @@ -94,7<br> +97,7 @@ static inline void vlc_list_add_after(struct<br> vlc_list *restrict node, * \param node Node pointer<br> of the element to insert [OUT]. * \param prev Node<br> pointer of the next element. */ -static inline<br> void vlc_list_add_before(struct vlc_list *restrict node,<br> +static inline void vlc_list_add_before(vlc_list_node<br> *restrict node,<br> struct<br> vlc_list *next) { <br> vlc_list_add_between(node, next->prev, next); @@<br> -106,7 +109,7 @@ static inline void<br> vlc_list_add_before(struct vlc_list *restrict node, <br> * \param node Node pointer of the element to append to the<br> list [OUT]. * \param head Head pointer of the list<br> to append the element to. */ -static inline<br> void vlc_list_append(struct vlc_list *restrict node, <br> +static inline void vlc_list_append(vlc_list_node<br> *restrict node, <br> struct vlc_list *head) { <br> vlc_list_add_before(node, head); @@ -118,7 +121,7 @@<br> static inline void vlc_list_append(struct vlc_list<br> *restrict node, * \param node Node pointer of the<br> element to prepend to the list [OUT]. * \param head<br> Head pointer of the list to prepend the element to. <br> */ -static inline void vlc_list_prepend(struct<br> vlc_list *restrict node, +static inline void<br> vlc_list_prepend(vlc_list_node *restrict node,<br> struct vlc_list<br> *head) { vlc_list_add_after(node, head);<br> @@ -131,7 +134,7 @@ static inline void<br> vlc_list_prepend(struct vlc_list *restrict node, *<br> \warning The element must be inside a list. *<br> Otherwise the behaviour is undefined. */ <br> -static inline void vlc_list_remove(struct vlc_list<br> *restrict node) +static inline void<br> vlc_list_remove(vlc_list_node *restrict node) {<br> struct vlc_list *prev = node->prev; <br> struct vlc_list *next = node->next; @@ -177,7 +180,7<br> @@ static inline bool vlc_list_is_empty(const struct<br> vlc_list *head) * \retval false The element is not<br> first (or is in another list). * \retval true The<br> element is first. */ -static inline bool<br> vlc_list_is_first(const struct vlc_list *node, +static<br> inline bool vlc_list_is_first(const vlc_list_node *node,<br> const struct<br> vlc_list *head) { return node->prev ==<br> head; @@ -192,7 +195,7 @@ static inline bool<br> vlc_list_is_first(const struct vlc_list *node, *<br> \retval false The element is not last (or is in another<br> list). * \retval true The element is last. <br> */ -static inline bool vlc_list_is_last(const struct<br> vlc_list *node, +static inline bool<br> vlc_list_is_last(const vlc_list_node *node,<br> const struct<br> vlc_list *head) { return node->next ==<br> head; @@ -289,7 +292,7 @@ static inline void<br> *vlc_list_last_or_null(const struct vlc_list *head, <br> } static inline void<br> *vlc_list_prev_or_null(const struct vlc_list *head, <br> - struct vlc_list<br> *node, + <br> vlc_list_node *node,<br> size_t<br> offset) { if (vlc_list_is_first(node,<br> head)) @@ -298,7 +301,7 @@ static inline void<br> *vlc_list_prev_or_null(const struct vlc_list *head, <br> } static inline void<br> *vlc_list_next_or_null(const struct vlc_list *head, <br> - struct vlc_list<br> *node, + <br> vlc_list_node *node,<br> size_t<br> offset) { if (vlc_list_is_last(node,<br> head)) -- Envoyé de mon appareil Android avec Courriel K-9<br> Mail. Veuillez excuser ma brièveté.<br><hr><br> vlc-devel mailing list To unsubscribe or modify your<br> subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a> <br><br><hr><br> vlc-devel mailing list To unsubscribe or modify your<br> subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a> <br><br><br><hr><br><br> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br><br> -- <br> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez <br> excuser ma brièveté.<br><br><br><hr><br> vlc-devel mailing list<br> To unsubscribe or modify your subscription options:<br> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></blockquote><br><hr><br>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>
-- <br>
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>