Ignore:
Timestamp:
Nov 12, 2007, 10:26:10 PM (14 years ago)
Author:
charles
Message:

minor tweaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r3775 r3815  
    4949};
    5050
     51static void
     52tr_cpReset( tr_completion * cp )
     53{
     54    tr_torrent * tor = cp->tor;
     55
     56    tr_bitfieldClear( cp->pieceBitfield );
     57    tr_bitfieldClear( cp->blockBitfield );
     58    memset( cp->completeBlocks, 0, sizeof(uint16_t) * tor->info.pieceCount );
     59
     60    cp->doneDirty = TRUE;
     61    cp->doneHave = 0;
     62    cp->doneTotal = 0;
     63    cp->completeHave = 0;
     64}
     65
    5166tr_completion * tr_cpInit( tr_torrent * tor )
    5267{
     
    7085    tr_bitfieldFree( cp->blockBitfield );
    7186    tr_free(         cp );
    72 }
    73 
    74 void tr_cpReset( tr_completion * cp )
    75 {
    76     tr_torrent * tor = cp->tor;
    77 
    78     tr_bitfieldClear( cp->pieceBitfield );
    79     tr_bitfieldClear( cp->blockBitfield );
    80     memset( cp->completeBlocks, 0, sizeof(uint16_t) * tor->info.pieceCount );
    81 
    82     cp->doneDirty = TRUE;
    83     cp->doneHave = 0;
    84     cp->doneTotal = 0;
    85     cp->completeHave = 0;
    8687}
    8788
     
    311312        b -= (info->pieceSize - (info->totalSize % info->pieceSize));
    312313
    313    return b;
     314    return b;
    314315}
    315316
     
    317318tr_cpHaveTotal( const tr_completion * cp )
    318319{
    319    return cp->completeHave;
    320 }
     320    return cp->completeHave;
     321}
Note: See TracChangeset for help on using the changeset viewer.