On Fri, 31 Mar 2017 00:01:18 +0000 Oktay Sarimehmet <[email protected]> wrote:
> It doesnt add an element which is adressed as other`s adress. > > Signed-off-by: Oktay Sarimehmet <[email protected]> > --- > src/wayland-util.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/wayland-util.c b/src/wayland-util.c > index cab7fc5..50c52b2 100644 > --- a/src/wayland-util.c > +++ b/src/wayland-util.c > @@ -87,8 +87,8 @@ wl_list_insert_list(struct wl_list *list, struct wl_list > *other) > return; > > other->next->prev = list; > - other->prev->next = list->next; > - list->next->prev = other->prev; > + other->next = list->next; > + list->next->prev = other; > list->next = other->next; > } > Hi, this function is very heavily used, so it's hard to believe it'd be broken. The function is supposed to add the whole list 'other' to the beginning of 'list'. The original code is correct. 'other' is intentionally left in invalid state and needs to be wl_list_init()'d before using again. 'other' is a list head, and must not be part of the list in 'list', because a head is not the same type as an item in the list: you cannot cast a list head element into a type stored in the list as items. Therefore NAK. Thanks, pq
pgprMbQiMtWtg.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/wayland-devel
