Changeset 12411


Ignore:
Timestamp:
May 1, 2011, 7:10:34 PM (10 years ago)
Author:
jordan
Message:

(trunk libT) the functions tr_peerMsgsSetChoke() and tr_peerMsgsSetInterested() have bool arguments whose types never got switched from "int" to "bool" when "bool" was adopted.

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-msgs.c

    r12393 r12411  
    669669
    670670void
    671 tr_peerMsgsSetInterested( tr_peermsgs * msgs, int isInterested )
    672 {
    673     assert( tr_isBool( isInterested ) );
    674 
    675     if( isInterested != msgs->peer->clientIsInterested )
    676         sendInterest( msgs, isInterested );
     671tr_peerMsgsSetInterested( tr_peermsgs * msgs, bool clientIsInterested )
     672{
     673    assert( tr_isBool( clientIsInterested ) );
     674
     675    if( clientIsInterested != msgs->peer->clientIsInterested )
     676        sendInterest( msgs, clientIsInterested );
    677677}
    678678
     
    717717
    718718void
    719 tr_peerMsgsSetChoke( tr_peermsgs * msgs, int choke )
     719tr_peerMsgsSetChoke( tr_peermsgs * msgs, bool peerIsChoked )
    720720{
    721721    const time_t now = tr_time( );
     
    724724    assert( msgs );
    725725    assert( msgs->peer );
    726     assert( choke == 0 || choke == 1 );
     726    assert( tr_isBool( peerIsChoked ) );
    727727
    728728    if( msgs->peer->chokeChangedAt > fibrillationTime )
    729729    {
    730         dbgmsg( msgs, "Not changing choke to %d to avoid fibrillation", choke );
    731     }
    732     else if( msgs->peer->peerIsChoked != choke )
    733     {
    734         msgs->peer->peerIsChoked = choke;
    735         if( choke )
     730        dbgmsg( msgs, "Not changing choke to %d to avoid fibrillation", peerIsChoked );
     731    }
     732    else if( msgs->peer->peerIsChoked != peerIsChoked )
     733    {
     734        msgs->peer->peerIsChoked = peerIsChoked;
     735        if( peerIsChoked )
    736736            cancelAllRequestsToClient( msgs );
    737         protocolSendChoke( msgs, choke );
     737        protocolSendChoke( msgs, peerIsChoked );
    738738        msgs->peer->chokeChangedAt = now;
    739739    }
  • trunk/libtransmission/peer-msgs.h

    r12230 r12411  
    3838                             void                 * callback_data );
    3939
    40 void         tr_peerMsgsSetChoke( tr_peermsgs *, int doChoke );
     40void         tr_peerMsgsSetChoke( tr_peermsgs *, bool peerIsChoked );
    4141
    4242int          tr_peerMsgsIsReadingBlock( const tr_peermsgs * msgs, tr_block_index_t block );
    4343
    44 void         tr_peerMsgsSetInterested( tr_peermsgs *, int isInterested );
     44void         tr_peerMsgsSetInterested( tr_peermsgs *, bool clientIsInterested );
    4545
    4646void         tr_peerMsgsHave( tr_peermsgs * msgs,
Note: See TracChangeset for help on using the changeset viewer.