remove dead code

This commit is contained in:
Jordan Lee 2011-08-08 16:58:29 +00:00
parent b7371264fb
commit 3778da6f82
4 changed files with 0 additions and 54 deletions

View File

@ -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;

View File

@ -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; i<pos+n; ++i ) {
b = blocks[i];
evbuffer_copyout( b->evbuf, 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 );

View File

@ -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 )

View File

@ -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;
}