mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
include: Add list_move_after() and list_move_before().
Signed-off-by: Francisco Casas <fcasas@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
This commit is contained in:
parent
2dcfc888fb
commit
a2996c2d59
Notes:
Alexandre Julliard
2022-10-18 00:13:00 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/5
@ -150,8 +150,8 @@ static inline unsigned int list_count( const struct list *list )
|
||||
return count;
|
||||
}
|
||||
|
||||
/* move all elements from src to the tail of dst */
|
||||
static inline void list_move_tail( struct list *dst, struct list *src )
|
||||
/* move all elements from src to before the specified element */
|
||||
static inline void list_move_before( struct list *dst, struct list *src )
|
||||
{
|
||||
if (list_empty(src)) return;
|
||||
|
||||
@ -162,8 +162,8 @@ static inline void list_move_tail( struct list *dst, struct list *src )
|
||||
list_init(src);
|
||||
}
|
||||
|
||||
/* move all elements from src to the head of dst */
|
||||
static inline void list_move_head( struct list *dst, struct list *src )
|
||||
/* move all elements from src to after the specified element */
|
||||
static inline void list_move_after( struct list *dst, struct list *src )
|
||||
{
|
||||
if (list_empty(src)) return;
|
||||
|
||||
@ -174,6 +174,18 @@ static inline void list_move_head( struct list *dst, struct list *src )
|
||||
list_init(src);
|
||||
}
|
||||
|
||||
/* move all elements from src to the head of dst */
|
||||
static inline void list_move_head( struct list *dst, struct list *src )
|
||||
{
|
||||
list_move_after( dst, src );
|
||||
}
|
||||
|
||||
/* move all elements from src to the tail of dst */
|
||||
static inline void list_move_tail( struct list *dst, struct list *src )
|
||||
{
|
||||
list_move_before( dst, src );
|
||||
}
|
||||
|
||||
/* iterate through the list */
|
||||
#define LIST_FOR_EACH(cursor,list) \
|
||||
for ((cursor) = (list)->next; (cursor) != (list); (cursor) = (cursor)->next)
|
||||
|
Loading…
x
Reference in New Issue
Block a user