mirror of
https://github.com/transmission/transmission
synced 2025-03-09 13:50:00 +00:00
(trunk libT) inline some one-liners
This commit is contained in:
parent
7b755a9596
commit
07046a26b2
2 changed files with 13 additions and 17 deletions
|
@ -165,12 +165,6 @@ tr_list_size( const tr_list * list )
|
|||
* insert/remove operations
|
||||
*/
|
||||
|
||||
void
|
||||
__tr_list_init( struct __tr_list * head )
|
||||
{
|
||||
head->next = head;
|
||||
head->prev = head;
|
||||
}
|
||||
|
||||
void
|
||||
__tr_list_insert( struct __tr_list * list,
|
||||
|
@ -192,13 +186,6 @@ __tr_list_splice( struct __tr_list * prev,
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
__tr_list_append( struct __tr_list * head,
|
||||
struct __tr_list * list)
|
||||
{
|
||||
__tr_list_insert( list, head->prev, head );
|
||||
}
|
||||
|
||||
void
|
||||
__tr_list_remove( struct __tr_list * head )
|
||||
{
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#ifndef TR_LIST_H
|
||||
#define TR_LIST_H
|
||||
|
||||
#include "transmission.h" /* TR_INLINE */
|
||||
|
||||
typedef struct tr_list
|
||||
{
|
||||
void * data;
|
||||
|
@ -80,8 +82,11 @@ typedef void ( *__tr_list_free_t )( void * );
|
|||
*
|
||||
* Init @head as an empty list.
|
||||
*/
|
||||
void
|
||||
__tr_list_init( struct __tr_list * head );
|
||||
static TR_INLINE void
|
||||
__tr_list_init( struct __tr_list * head )
|
||||
{
|
||||
head->next = head->prev = head;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -109,9 +114,13 @@ __tr_list_splice( struct __tr_list * prev,
|
|||
*
|
||||
* Append @list to the end of @head.
|
||||
*/
|
||||
void
|
||||
static TR_INLINE void
|
||||
__tr_list_append( struct __tr_list * head,
|
||||
struct __tr_list * list);
|
||||
struct __tr_list * list)
|
||||
{
|
||||
__tr_list_insert( list, head->prev, head );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* __tr_list_remove()
|
||||
|
|
Loading…
Add table
Reference in a new issue