diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 593d94885..e3adb0efb 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -484,8 +484,6 @@ tr_torrentSetLocalError( tr_torrent * tor, const char * fmt, ... ) static void tr_torrentClearError( tr_torrent * tor ) { - assert( tr_isTorrent( tor ) ); - tor->error = TR_STAT_OK; tor->errorString[0] = '\0'; tor->errorTracker[0] = '\0'; @@ -1481,8 +1479,6 @@ tr_torrentAmountFinished( const tr_torrent * tor, static void tr_torrentResetTransferStats( tr_torrent * tor ) { - assert( tr_isTorrent( tor ) ); - tr_torrentLock( tor ); tor->downloadedPrev += tor->downloadedCur; @@ -1522,7 +1518,6 @@ freeTorrent( tr_torrent * tor ) tr_session * session = tor->session; tr_info * inf = &tor->info; - assert( tr_isTorrent( tor ) ); assert( !tor->isRunning ); tr_sessionLock( session ); @@ -1615,8 +1610,6 @@ tr_torrentGetCurrentSizeOnDisk( const tr_torrent * tor ) static void torrentStart( tr_torrent * tor ) { - assert( tr_isTorrent( tor ) ); - /* already running... */ if( tor->isRunning ) return; @@ -1689,7 +1682,6 @@ verifyTorrent( void * vtor ) { tr_torrent * tor = vtor; - assert( tr_isTorrent( tor ) ); tr_sessionLock( tor->session ); /* if the torrent's already being verified, stop it */ @@ -1882,7 +1874,6 @@ fireCompletenessChange( tr_torrent * tor, tr_completeness status, tr_bool wasRunning ) { - assert( tr_isTorrent( tor ) ); assert( ( status == TR_LEECH ) || ( status == TR_SEED ) || ( status == TR_PARTIAL_SEED ) ); @@ -1955,8 +1946,6 @@ torrentCallScript( const tr_torrent * tor, const char * script ) char timeStr[128]; const time_t now = tr_time( ); - assert( tr_isTorrent( tor ) ); - tr_strlcpy( timeStr, ctime( &now ), sizeof( timeStr ) ); *strchr( timeStr,'\n' ) = '\0'; @@ -2141,17 +2130,14 @@ tr_torrentGetFilePriorities( const tr_torrent * tor ) static void setFileDND( tr_torrent * tor, tr_file_index_t fileIndex, int doDownload ) { - tr_file * file; const int8_t dnd = !doDownload; tr_piece_index_t firstPiece; int8_t firstPieceDND; tr_piece_index_t lastPiece; int8_t lastPieceDND; tr_file_index_t i; + tr_file * file = &tor->info.files[fileIndex]; - assert( tr_isTorrent( tor ) ); - - file = &tor->info.files[fileIndex]; file->dnd = dnd; firstPiece = file->firstPiece; lastPiece = file->lastPiece; @@ -2672,14 +2658,10 @@ walkLocalData( const tr_torrent * tor, tr_ptrArray * folders, tr_ptrArray * dirtyFolders ) { - int i; struct stat sb; - char * buf; + char * buf = tr_buildPath( dir, base, NULL ); + int i = stat( buf, &sb ); - assert( tr_isTorrent( tor ) ); - - buf = tr_buildPath( dir, base, NULL ); - i = stat( buf, &sb ); if( !i ) { DIR * odir = NULL; @@ -2728,8 +2710,6 @@ deleteLocalData( tr_torrent * tor, tr_fileFunc fileFunc ) char * tmp = cpch ? tr_strndup( firstFile, cpch - firstFile ) : NULL; char * root = tr_buildPath( tor->currentDir, tmp, NULL ); - assert( tr_isTorrent( tor ) ); - for( f=0; finfo.fileCount; ++f ) { tr_ptrArrayInsertSorted( &torrentFiles, tr_strdup( tor->info.files[f].name ), vstrcmp ); tr_ptrArrayInsertSorted( &torrentFiles, tr_torrentBuildPartial( tor, f ), vstrcmp );