From 8433e0dd3bc906fc77a284579860525241b5c8c1 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 20 May 2010 15:30:18 +0000 Subject: [PATCH] (trunk libT) make tr_peerIoEnable*() inline functions --- libtransmission/peer-io.c | 36 ------------------------------------ libtransmission/peer-io.h | 28 ++++++++++++++-------------- 2 files changed, 14 insertions(+), 50 deletions(-) diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index fd37ee9c2..a117fb234 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -713,42 +713,6 @@ tr_peerIoSetPeersId( tr_peerIo * io, *** **/ -void -tr_peerIoEnableFEXT( tr_peerIo * io, - tr_bool flag ) -{ - assert( tr_isPeerIo( io ) ); - assert( tr_isBool( flag ) ); - - dbgmsg( io, "setting FEXT support flag to %d", (flag!=0) ); - io->fastExtensionSupported = flag; -} - -void -tr_peerIoEnableLTEP( tr_peerIo * io, - tr_bool flag ) -{ - assert( tr_isPeerIo( io ) ); - assert( tr_isBool( flag ) ); - - dbgmsg( io, "setting LTEP support flag to %d", (flag!=0) ); - io->extendedProtocolSupported = flag; -} - -void -tr_peerIoEnableDHT( tr_peerIo * io, tr_bool flag ) -{ - assert( tr_isPeerIo( io ) ); - assert( tr_isBool( flag ) ); - - dbgmsg( io, "setting DHT support flag to %d", (flag!=0) ); - io->dhtSupported = flag; -} - -/** -*** -**/ - static size_t getDesiredOutputBufferSize( const tr_peerIo * io, uint64_t now ) { diff --git a/libtransmission/peer-io.h b/libtransmission/peer-io.h index 30d1bc115..24fd4cafe 100644 --- a/libtransmission/peer-io.h +++ b/libtransmission/peer-io.h @@ -149,30 +149,30 @@ tr_bool tr_isPeerIo ( const tr_peerIo * io ); *** **/ -void tr_peerIoEnableLTEP( tr_peerIo * io, tr_bool flag ); - -static inline tr_bool tr_peerIoSupportsLTEP( const tr_peerIo * io ) +static inline void tr_peerIoEnableFEXT( tr_peerIo * io, tr_bool flag ) { - assert( tr_isPeerIo( io ) ); - - return io->extendedProtocolSupported; + io->fastExtensionSupported = flag; } - -void tr_peerIoEnableFEXT( tr_peerIo * io, tr_bool flag ); - static inline tr_bool tr_peerIoSupportsFEXT( const tr_peerIo * io ) { - assert( tr_isPeerIo( io ) ); - return io->fastExtensionSupported; } -void tr_peerIoEnableDHT( tr_peerIo * io, tr_bool flag ); +static inline void tr_peerIoEnableLTEP( tr_peerIo * io, tr_bool flag ) +{ + io->extendedProtocolSupported = flag; +} +static inline tr_bool tr_peerIoSupportsLTEP( const tr_peerIo * io ) +{ + return io->extendedProtocolSupported; +} +static inline void tr_peerIoEnableDHT( tr_peerIo * io, tr_bool flag ) +{ + io->dhtSupported = flag; +} static inline tr_bool tr_peerIoSupportsDHT( const tr_peerIo * io ) { - assert( tr_isPeerIo( io ) ); - return io->dhtSupported; }