Changeset 9833


Ignore:
Timestamp:
Dec 28, 2009, 11:11:26 PM (12 years ago)
Author:
charles
Message:

(trunk libT) remove dead code -- tr_assert()

Location:
trunk/libtransmission
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r9671 r9833  
    331331    const tr_block_index_t lastBlock = file->length ? ( ( file->offset + file->length - 1 ) / tor->blockSize ) : firstBlock;
    332332
    333     tr_assert( tr_torBlockPiece( tor, firstBlock ) == file->firstPiece,
    334                "file->offset %"PRIu64"; file->length %"PRIu64"; "
    335                "pieceSize %"PRIu32"; blockSize %"PRIu32"; "
    336                "firstBlock %"PRIu64"; lastBlock %"PRIu64,
    337                file->offset, file->length,
    338                tor->info.pieceSize, tor->blockSize,
    339                firstBlock, lastBlock );
    340 
    341     tr_assert( tr_torBlockPiece( tor, lastBlock ) == file->lastPiece,
    342                "file->offset %"PRIu64"; file->length %"PRIu64"; "
    343                "pieceSize %"PRIu32"; blockSize %"PRIu32"; "
    344                "firstBlock %"PRIu64"; lastBlock %"PRIu64,
    345                file->offset, file->length,
    346                tor->info.pieceSize, tor->blockSize,
    347                firstBlock, lastBlock );
     333    assert( tr_torBlockPiece( tor, firstBlock ) == file->firstPiece );
     334    assert( tr_torBlockPiece( tor, lastBlock ) == file->lastPiece );
    348335
    349336    for( block=firstBlock; block<=lastBlock; ++block )
  • trunk/libtransmission/utils.c

    r9720 r9833  
    224224    return buf;
    225225}
    226 
    227 void
    228 tr_assertImpl( const char * file, int line, const char * test, const char * fmt, ... )
    229 {
    230     char buf[64];
    231     fprintf( stderr, "[%s] Transmission %s Assertion \"%s\" failed at %s:%d.  ",
    232                      tr_getLogTimeStr( buf, sizeof( buf ) ),
    233                       LONG_VERSION_STRING, test, file, line );
    234     if( fmt && *fmt ) {
    235         va_list args;
    236         fputc( '(', stderr );
    237         va_start( args, fmt );
    238         vfprintf( stderr, fmt, args );
    239         va_end( args );
    240         fputs( ")  ", stderr );
    241     }
    242     fputs( "Please report this bug at <http://trac.transmissionbt.com/newticket>; Thank you.\n", stderr );
    243     abort( );
    244 }
    245 
    246226
    247227tr_bool
  • trunk/libtransmission/utils.h

    r9720 r9833  
    115115****/
    116116
    117 void tr_assertImpl( const char * file, int line, const char * test, const char * fmt, ... ) TR_GNUC_PRINTF( 4, 5 );
    118 
    119 #ifdef NDEBUG
    120  #define tr_assert( test, fmt, ... )
    121 #else
    122  #define tr_assert( test, fmt, ... ) \
    123     do { if( ! ( test ) ) tr_assertImpl( __FILE__, __LINE__, #test, fmt, __VA_ARGS__ ); } while( 0 )
    124 #endif
    125 
    126117void tr_msgInit( void );
    127118
  • trunk/libtransmission/web.c

    r9826 r9833  
    1313#include <curl/curl.h>
    1414#include <event.h>
     15
     16#include <assert.h>
    1517
    1618#include "transmission.h"
     
    314316        event_add( io_event, NULL );
    315317    }
    316     else tr_assert( 0, "unhandled action: %d", action );
     318    else assert( 0 && "unhandled action" );
    317319
    318320    return 0; /* libcurl documentation: "The callback MUST return 0." */
Note: See TracChangeset for help on using the changeset viewer.