(trunk libT) make tr_isAddress() and tr_isDirection() inline

This commit is contained in:
Charles Kerr 2009-01-02 04:47:37 +00:00
parent 8eda177838
commit 0cd572a0da
5 changed files with 3 additions and 20 deletions

View File

@ -98,12 +98,6 @@ tr_suspectAddress( const tr_address * a, const char * source )
}
}
tr_bool
tr_isAddress( const tr_address * a )
{
return a && ( a->type==TR_AF_INET || a->type==TR_AF_INET6 );
}
const char *
tr_ntop( const tr_address * src, char * dst, int size )
{

View File

@ -86,7 +86,8 @@ int tr_compareAddresses( const tr_address * a,
void tr_normalizeV4Mapped( tr_address * const addr );
void tr_suspectAddress( const tr_address * a, const char * source );
tr_bool tr_isAddress( const tr_address * a );
#define tr_isAddress(a) ( ((a)!=NULL) && ( (a)->type==TR_AF_INET || (a)->type==TR_AF_INET6 ) )
typedef struct tr_net_af_support
{

View File

@ -153,8 +153,6 @@ canReadWrapper( tr_peerIo * io )
tr_bool err = 0;
tr_session * session = io->session;
assert( tr_isPeerIo( io ) );
dbgmsg( io, "canRead" );
/* try to consume the input buffer */
@ -923,8 +921,6 @@ tr_peerIoTryRead( tr_peerIo * io, size_t howmuch )
{
int res = 0;
assert( tr_isPeerIo( io ) );
if(( howmuch = tr_bandwidthClamp( io->bandwidth, TR_DOWN, howmuch )))
{
int e;
@ -955,8 +951,6 @@ tr_peerIoTryWrite( tr_peerIo * io, size_t howmuch )
{
int n;
assert( tr_isPeerIo( io ) );
if(( howmuch = tr_bandwidthClamp( io->bandwidth, TR_UP, howmuch )))
{
int e;

View File

@ -1415,7 +1415,7 @@ void tr_torrentSetDoneDate( tr_torrent * torrent,
time_t doneDate );
/** @brief Sanity checker to test that the direction is TR_UP or TR_DOWN */
tr_bool tr_isDirection( tr_direction );
#define tr_isDirection(d) (((d)==TR_UP) || ((d)==TR_DOWN))
/** @} */

View File

@ -1277,12 +1277,6 @@ tr_base64_decode( const void * input,
return ret;
}
tr_bool
tr_isDirection( tr_direction dir )
{
return dir==TR_UP || dir==TR_DOWN;
}
int
tr_ptr2int( void* v )
{