From 3778da6f82f581f057e57cadc6d3d314fbf0d299 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Mon, 8 Aug 2011 16:58:29 +0000 Subject: [PATCH] remove dead code --- libtransmission/bandwidth.c | 16 ---------------- libtransmission/cache.c | 9 --------- libtransmission/peer-mgr.c | 14 -------------- qt/torrent-filter.cc | 15 --------------- 4 files changed, 54 deletions(-) diff --git a/libtransmission/bandwidth.c b/libtransmission/bandwidth.c index 7f4254dba..4b65e404c 100644 --- a/libtransmission/bandwidth.c +++ b/libtransmission/bandwidth.c @@ -158,10 +158,6 @@ tr_bandwidthSetParent( tr_bandwidth * b, /*** **** ***/ -#if 0 -#warning do not check the code in with this enabled -#define DEBUG_DIRECTION TR_UP -#endif static void allocateBandwidth( tr_bandwidth * b, @@ -180,13 +176,6 @@ allocateBandwidth( tr_bandwidth * b, { const unsigned int nextPulseSpeed = b->band[dir].desiredSpeed_Bps; b->band[dir].bytesLeft = ( nextPulseSpeed * period_msec ) / 1000u; - -#ifdef DEBUG_DIRECTION - if( dir == DEBUG_DIRECTION ) - fprintf( stderr, "bandwidth %p currentPieceSpeed(%5.2f of %5.2f) desiredSpeed(%5.2f), allocating %d\n", - b, currentSpeed, tr_bandwidthGetRawSpeed( b, dir ), desiredSpeed, - b->band[dir].bytesLeft ); -#endif } /* add this bandwidth's peer, if any, to the peer pool */ @@ -195,11 +184,6 @@ allocateBandwidth( tr_bandwidth * b, tr_ptrArrayAppend( peer_pool, b->peer ); } -#ifdef DEBUG_DIRECTION -if( ( dir == DEBUG_DIRECTION ) && ( n > 1 ) ) -fprintf( stderr, "bandwidth %p has %d peers\n", b, n ); -#endif - /* traverse & repeat for the subtree */ if( 1 ) { int i; diff --git a/libtransmission/cache.c b/libtransmission/cache.c index 1ee977508..a94ccff41 100644 --- a/libtransmission/cache.c +++ b/libtransmission/cache.c @@ -171,8 +171,6 @@ flushContiguous( tr_cache * cache, int pos, int n ) const tr_piece_index_t piece = b->piece; const uint32_t offset = b->offset; -//fprintf( stderr, "flushing %d contiguous blocks [%d-%d) from cache to disk\n", n, pos, n+pos ); - for( i=pos; ievbuf, walk, b->length ); @@ -182,13 +180,6 @@ flushContiguous( tr_cache * cache, int pos, int n ) } tr_ptrArrayErase( &cache->blocks, pos, pos+n ); -#if 0 - tr_tordbg( tor, "Writing to disk piece %d, offset %d, len %d", (int)piece, (int)offset, (int)(walk-buf) ); - tr_ndbg( MY_NAME, "Removing %d blocks from cache, rank: %d - %d left", n, rank, tr_ptrArraySize(&cache->blocks) ); - fprintf( stderr, "%s - Writing to disk piece %d, offset %d, len %d\n", tr_torrentName(tor), (int)piece, (int)offset, (int)(walk-buf) ); - fprintf( stderr, "%s - Removing %d blocks from cache; %d left\n", MY_NAME, n, tr_ptrArraySize(&cache->blocks) ); -#endif - err = tr_ioWrite( tor, piece, offset, walk-buf, buf ); tr_free( buf ); diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 445047d80..3862f7035 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -2260,20 +2260,6 @@ tr_pexCompare( const void * va, const void * vb ) return 0; } -#if 0 -static int -peerPrefersCrypto( const tr_peer * peer ) -{ - if( peer->encryption_preference == ENCRYPTION_PREFERENCE_YES ) - return true; - - if( peer->encryption_preference == ENCRYPTION_PREFERENCE_NO ) - return false; - - return tr_peerIoIsEncrypted( peer->io ); -} -#endif - /* better goes first */ static int compareAtomsByUsefulness( const void * va, const void *vb ) diff --git a/qt/torrent-filter.cc b/qt/torrent-filter.cc index c71d32114..b79e8fa8b 100644 --- a/qt/torrent-filter.cc +++ b/qt/torrent-filter.cc @@ -196,21 +196,6 @@ TorrentFilter :: filterAcceptsRow( int sourceRow, const QModelIndex& sourceParen accepts = tor->name().contains( text, Qt::CaseInsensitive ); } -#if 0 - if( accepts && !myText.isEmpty( ) ) switch( myTextMode ) - { - case FILTER_BY_NAME: - accepts = tor->name().contains( myText, Qt::CaseInsensitive ); - break; - case FILTER_BY_FILES: - accepts = tor->hasFileSubstring( myText ); - break; - case FILTER_BY_TRACKER: - accepts = tor->hasTrackerSubstring( myText ); - break; - } -#endif - return accepts; }