Changeset 7574


Ignore:
Timestamp:
Jan 2, 2009, 4:47:37 AM (12 years ago)
Author:
charles
Message:

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

Location:
trunk/libtransmission
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r7564 r7574  
    9999}
    100100
    101 tr_bool
    102 tr_isAddress( const tr_address * a )
    103 {
    104     return a && ( a->type==TR_AF_INET || a->type==TR_AF_INET6 );
    105 }
    106 
    107101const char *
    108102tr_ntop( const tr_address * src, char * dst, int size )
  • trunk/libtransmission/net.h

    r7468 r7574  
    8787
    8888void tr_suspectAddress( const tr_address * a, const char * source );
    89 tr_bool tr_isAddress( const tr_address * a );
     89
     90#define tr_isAddress(a) ( ((a)!=NULL) && ( (a)->type==TR_AF_INET || (a)->type==TR_AF_INET6 ) )
    9091
    9192typedef struct tr_net_af_support
  • trunk/libtransmission/peer-io.c

    r7544 r7574  
    154154    tr_session * session = io->session;
    155155
    156     assert( tr_isPeerIo( io ) );
    157 
    158156    dbgmsg( io, "canRead" );
    159157
     
    924922    int res = 0;
    925923
    926     assert( tr_isPeerIo( io ) );
    927 
    928924    if(( howmuch = tr_bandwidthClamp( io->bandwidth, TR_DOWN, howmuch )))
    929925    {
     
    956952    int n;
    957953
    958     assert( tr_isPeerIo( io ) );
    959 
    960954    if(( howmuch = tr_bandwidthClamp( io->bandwidth, TR_UP, howmuch )))
    961955    {
  • trunk/libtransmission/transmission.h

    r7547 r7574  
    14161416
    14171417/** @brief Sanity checker to test that the direction is TR_UP or TR_DOWN */
    1418 tr_bool tr_isDirection( tr_direction );
     1418#define tr_isDirection(d) (((d)==TR_UP) || ((d)==TR_DOWN))
    14191419
    14201420/** @} */
  • trunk/libtransmission/utils.c

    r7558 r7574  
    12781278}
    12791279
    1280 tr_bool
    1281 tr_isDirection( tr_direction dir )
    1282 {
    1283     return dir==TR_UP || dir==TR_DOWN;
    1284 }
    1285 
    12861280int
    12871281tr_ptr2int( void* v )
Note: See TracChangeset for help on using the changeset viewer.