(trunk libT) inline some one-liners

This commit is contained in:
Charles Kerr 2009-06-30 16:40:34 +00:00
parent 7b755a9596
commit 07046a26b2
2 changed files with 13 additions and 17 deletions

View File

@ -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 )
{

View File

@ -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()