Ignore:
Timestamp:
Jan 30, 2009, 12:41:08 AM (13 years ago)
Author:
charles
Message:

(trunk libT) more assertions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/verify.c

    r7658 r7816  
    3535
    3636static void
    37 fireCheckDone( tr_torrent *      torrent,
    38                tr_verify_done_cb verify_done_cb )
    39 {
     37fireCheckDone( tr_torrent * tor, tr_verify_done_cb verify_done_cb )
     38{
     39    assert( tr_isTorrent( tor ) );
     40
    4041    if( verify_done_cb )
    41         verify_done_cb( torrent );
     42        verify_done_cb( tor );
    4243}
    4344
    4445static struct verify_node currentNode;
    45 
    46 static tr_list *          verifyList = NULL;
    47 
    48 static tr_thread *        verifyThread = NULL;
    49 
    50 static int                stopCurrent = FALSE;
     46static tr_list * verifyList = NULL;
     47static tr_thread * verifyThread = NULL;
     48static int stopCurrent = FALSE;
    5149
    5250static tr_lock*
     
    145143
    146144        tr_torinf( tor, _( "Verifying torrent" ) );
     145        assert( tr_isTorrent( tor ) );
    147146        tor->verifyState = TR_VERIFY_NOW;
    148147        buffer = tr_new( uint8_t, tor->info.pieceSize );
     
    151150        tr_free( buffer );
    152151        tor->verifyState = TR_VERIFY_NONE;
     152        assert( tr_isTorrent( tor ) );
    153153
    154154        if( !stopCurrent )
     
    169169{
    170170    const int uncheckedCount = tr_torrentCountUncheckedPieces( tor );
     171
     172    assert( tr_isTorrent( tor ) );
    171173
    172174    if( !uncheckedCount )
     
    211213    tr_lockLock( lock );
    212214
     215    assert( tr_isTorrent( tor ) );
     216
    213217    found = ( tor == currentNode.torrent )
    214218         || ( tr_list_find( verifyList, tor, compareVerifyByTorrent ) != NULL );
     
    222226{
    223227    tr_lock * lock = getVerifyLock( );
    224 
    225228    tr_lockLock( lock );
     229
     230    assert( tr_isTorrent( tor ) );
    226231
    227232    if( tor == currentNode.torrent )
Note: See TracChangeset for help on using the changeset viewer.