Ignore:
Timestamp:
Mar 22, 2011, 3:19:54 PM (11 years ago)
Author:
jordan
Message:

(trunk) #4138 "use stdbool.h instead of tr_bool" -- done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r12177 r12204  
    2929    cp->completeBlocks = NULL;
    3030    cp->sizeNow = 0;
    31     cp->sizeWhenDoneIsDirty = TRUE;
    32     cp->blocksWantedIsDirty = TRUE;
    33     cp->haveValidIsDirty = TRUE;
     31    cp->sizeWhenDoneIsDirty = true;
     32    cp->blocksWantedIsDirty = true;
     33    cp->haveValidIsDirty = true;
    3434}
    3535
     
    5656***/
    5757
    58 static inline tr_bool
     58static inline bool
    5959isSeed( const tr_completion * cp )
    6060{
     
    9494tr_cpInvalidateDND( tr_completion * cp )
    9595{
    96     cp->sizeWhenDoneIsDirty = TRUE;
    97     cp->blocksWantedIsDirty = TRUE;
     96    cp->sizeWhenDoneIsDirty = true;
     97    cp->blocksWantedIsDirty = true;
    9898}
    9999
     
    125125        cp->blocksWantedLazy = wanted;
    126126        cp->blocksWantedCompleteLazy = complete;
    127         cp->blocksWantedIsDirty = FALSE;
     127        cp->blocksWantedIsDirty = false;
    128128    }
    129129
     
    148148        cp->blocksWantedCompleteLazy -= complete_blocks[piece];
    149149
    150     cp->sizeWhenDoneIsDirty = TRUE;
    151     cp->haveValidIsDirty = TRUE;
     150    cp->sizeWhenDoneIsDirty = true;
     151    cp->haveValidIsDirty = true;
    152152    complete_blocks[piece] = 0;
    153153    tr_bitsetRemRange( &cp->blockBitset, first, last+1 );
     
    184184            cp->blocksWantedCompleteLazy++;
    185185
    186         cp->sizeWhenDoneIsDirty = TRUE;
    187         cp->haveValidIsDirty = TRUE;
    188     }
    189 }
    190 
    191 
    192 tr_bool
     186        cp->sizeWhenDoneIsDirty = true;
     187        cp->haveValidIsDirty = true;
     188    }
     189}
     190
     191
     192bool
    193193tr_cpBlockBitsetInit( tr_completion * cp, const tr_bitset * blocks )
    194194{
    195     tr_bool success = FALSE;
     195    bool success = false;
    196196    tr_torrent * tor = cp->tor;
    197197
     
    204204        cp->sizeNow = tor->info.totalSize;
    205205
    206         success = TRUE;
     206        success = true;
    207207    }
    208208    else if( blocks->haveNone )
    209209    {
    210210        /* already reset... */
    211         success = TRUE;
     211        success = true;
    212212    }
    213213    else
     
    237237                cp->sizeNow = 0;
    238238            } else {
    239                 cp->blockBitset.haveAll = cp->blockBitset.haveNone = FALSE;
     239                cp->blockBitset.haveAll = cp->blockBitset.haveNone = false;
    240240                cp->sizeNow = tr_bitfieldCountRange( tgt, 0, tor->blockCount-1 );
    241241                cp->sizeNow *= tor->blockSize;
     
    275275                size += tr_torPieceCountBytes( tor, i );
    276276
    277         cp->haveValidIsDirty = FALSE;
     277        cp->haveValidIsDirty = false;
    278278        cp->haveValidLazy = size;
    279279    }
     
    297297                size += tr_torPieceCountBytes( tor, i );
    298298
    299         cp->sizeWhenDoneIsDirty = FALSE;
     299        cp->sizeWhenDoneIsDirty = false;
    300300        cp->sizeWhenDoneLazy = size;
    301301    }
     
    309309    int i;
    310310    const float interval = cp->tor->info.pieceCount / (float)tabCount;
    311     const tr_bool seed = isSeed( cp );
     311    const bool seed = isSeed( cp );
    312312
    313313    for( i=0; i<tabCount; ++i ) {
     
    330330}
    331331
    332 tr_bool
     332bool
    333333tr_cpFileIsComplete( const tr_completion * cp, tr_file_index_t i )
    334334{
     
    336336
    337337    if( cp->tor->info.files[i].length == 0 )
    338         return TRUE;
     338        return true;
    339339
    340340    tr_torGetFileBlockRange( cp->tor, i, &f, &l );
Note: See TracChangeset for help on using the changeset viewer.