Changeset 10671


Ignore:
Timestamp:
May 20, 2010, 3:30:18 PM (12 years ago)
Author:
charles
Message:

(trunk libT) make tr_peerIoEnable*() inline functions

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-io.c

    r10534 r10671  
    714714**/
    715715
    716 void
    717 tr_peerIoEnableFEXT( tr_peerIo * io,
    718                      tr_bool     flag )
    719 {
    720     assert( tr_isPeerIo( io ) );
    721     assert( tr_isBool( flag ) );
    722 
    723     dbgmsg( io, "setting FEXT support flag to %d", (flag!=0) );
    724     io->fastExtensionSupported = flag;
    725 }
    726 
    727 void
    728 tr_peerIoEnableLTEP( tr_peerIo  * io,
    729                      tr_bool      flag )
    730 {
    731     assert( tr_isPeerIo( io ) );
    732     assert( tr_isBool( flag ) );
    733 
    734     dbgmsg( io, "setting LTEP support flag to %d", (flag!=0) );
    735     io->extendedProtocolSupported = flag;
    736 }
    737 
    738 void
    739 tr_peerIoEnableDHT( tr_peerIo * io, tr_bool flag )
    740 {
    741     assert( tr_isPeerIo( io ) );
    742     assert( tr_isBool( flag ) );
    743 
    744     dbgmsg( io, "setting DHT support flag to %d", (flag!=0) );
    745     io->dhtSupported = flag;
    746 }
    747 
    748 /**
    749 ***
    750 **/
    751 
    752716static size_t
    753717getDesiredOutputBufferSize( const tr_peerIo * io, uint64_t now )
  • trunk/libtransmission/peer-io.h

    r10524 r10671  
    150150**/
    151151
    152 void        tr_peerIoEnableLTEP( tr_peerIo * io, tr_bool flag );
    153 
     152static inline void tr_peerIoEnableFEXT( tr_peerIo * io, tr_bool flag )
     153{
     154    io->fastExtensionSupported = flag;
     155}
     156static inline tr_bool tr_peerIoSupportsFEXT( const tr_peerIo * io )
     157{
     158    return io->fastExtensionSupported;
     159}
     160
     161static inline void tr_peerIoEnableLTEP( tr_peerIo * io, tr_bool flag )
     162{
     163    io->extendedProtocolSupported = flag;
     164}
    154165static inline tr_bool tr_peerIoSupportsLTEP( const tr_peerIo * io )
    155166{
    156     assert( tr_isPeerIo( io ) );
    157 
    158167    return io->extendedProtocolSupported;
    159168}
    160169
    161 void        tr_peerIoEnableFEXT( tr_peerIo * io, tr_bool flag );
    162 
    163 static inline tr_bool tr_peerIoSupportsFEXT( const tr_peerIo * io )
    164 {
    165     assert( tr_isPeerIo( io ) );
    166 
    167     return io->fastExtensionSupported;
    168 }
    169 
    170 void        tr_peerIoEnableDHT( tr_peerIo * io, tr_bool flag );
    171 
     170static inline void tr_peerIoEnableDHT( tr_peerIo * io, tr_bool flag )
     171{
     172    io->dhtSupported = flag;
     173}
    172174static inline tr_bool tr_peerIoSupportsDHT( const tr_peerIo * io )
    173175{
    174     assert( tr_isPeerIo( io ) );
    175 
    176176    return io->dhtSupported;
    177177}
Note: See TracChangeset for help on using the changeset viewer.