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/net.c

    r12156 r12204  
    6868tr_netInit( void )
    6969{
    70     static int initialized = FALSE;
     70    static int initialized = false;
    7171
    7272    if( !initialized )
     
    7676        WSAStartup( MAKEWORD( 2, 2 ), &wsaData );
    7777#endif
    78         initialized = TRUE;
     78        initialized = true;
    7979    }
    8080}
     
    181181}
    182182
    183 tr_bool
     183bool
    184184tr_ssToAddr( tr_address * setme_addr,
    185185             tr_port    * setme_port,
     
    192192        setme_addr->addr.addr4.s_addr = sin->sin_addr.s_addr;
    193193        *setme_port = sin->sin_port;
    194         return TRUE;
     194        return true;
    195195    }
    196196
     
    201201        setme_addr->addr.addr6 = sin6->sin6_addr;
    202202        *setme_port = sin6->sin6_port;
    203         return TRUE;
    204     }
    205 
    206     return FALSE;
     203        return true;
     204    }
     205
     206    return false;
    207207}
    208208
     
    241241                      const tr_address  * addr,
    242242                      tr_port             port,
    243                       tr_bool             clientIsSeed )
     243                      bool                clientIsSeed )
    244244{
    245245    static const int domains[NUM_TR_AF_INET_TYPES] = { AF_INET, AF_INET6 };
     
    313313                         const tr_address  * addr,
    314314                         tr_port             port,
    315                          tr_bool             clientIsSeed UNUSED )
     315                         bool                clientIsSeed UNUSED )
    316316{
    317317    struct sockaddr_storage ss;
     
    324324
    325325static int
    326 tr_netBindTCPImpl( const tr_address * addr, tr_port port, tr_bool suppressMsgs, int * errOut )
     326tr_netBindTCPImpl( const tr_address * addr, tr_port port, bool suppressMsgs, int * errOut )
    327327{
    328328    static const int domains[NUM_TR_AF_INET_TYPES] = { AF_INET, AF_INET6 };
     
    397397
    398398int
    399 tr_netBindTCP( const tr_address * addr, tr_port port, tr_bool suppressMsgs )
     399tr_netBindTCP( const tr_address * addr, tr_port port, bool suppressMsgs )
    400400{
    401401    int unused;
     
    403403}
    404404
    405 tr_bool
     405bool
    406406tr_net_hasIPv6( tr_port port )
    407407{
    408     static tr_bool result = FALSE;
    409     static tr_bool alreadyDone = FALSE;
     408    static bool result = false;
     409    static bool alreadyDone = false;
    410410
    411411    if( !alreadyDone )
    412412    {
    413413        int err;
    414         int fd = tr_netBindTCPImpl( &tr_in6addr_any, port, TRUE, &err );
     414        int fd = tr_netBindTCPImpl( &tr_in6addr_any, port, true, &err );
    415415        if( fd >= 0 || err != EAFNOSUPPORT ) /* we support ipv6 */
    416             result = TRUE;
     416            result = true;
    417417        if( fd >= 0 )
    418418            tr_netCloseSocket( fd );
    419         alreadyDone = TRUE;
     419        alreadyDone = true;
    420420    }
    421421
     
    603603***/
    604604
    605 static tr_bool
     605static bool
    606606isIPv4MappedAddress( const tr_address * addr )
    607607{
     
    609609}
    610610
    611 static tr_bool
     611static bool
    612612isIPv6LinkLocalAddress( const tr_address * addr )
    613613{
     
    618618/* isMartianAddr was written by Juliusz Chroboczek,
    619619   and is covered under the same license as third-party/dht/dht.c. */
    620 static tr_bool
     620static bool
    621621isMartianAddr( const struct tr_address * a )
    622622{
     
    651651
    652652        default:
    653             return TRUE;
    654     }
    655 }
    656 
    657 tr_bool
     653            return true;
     654    }
     655}
     656
     657bool
    658658tr_isValidPeerAddress( const tr_address * addr, tr_port port )
    659659{
Note: See TracChangeset for help on using the changeset viewer.