Changeset 791 for trunk/libtransmission


Ignore:
Timestamp:
Aug 18, 2006, 8:46:19 AM (15 years ago)
Author:
joshe
Message:

Unbreak BeOS build.

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r261 r791  
    404404#endif
    405405}
     406
     407void tr_netNtop( const struct in_addr * addr, char * buf, int len )
     408{
     409    const uint8_t * cast;
     410
     411    cast = (const uint8_t *)addr;
     412    snprintf( buf, len, "%hhu.%hhu.%hhu.%hhu",
     413              cast[0], cast[1], cast[2], cast[3] );
     414}
  • trunk/libtransmission/net.h

    r261 r791  
    5353int  tr_netRecv    ( int s, uint8_t * buf, int size );
    5454
     55void tr_netNtop( const struct in_addr * addr, char * buf, int len );
  • trunk/libtransmission/transmission.c

    r788 r791  
    411411{
    412412    tr_stat_t * s;
     413    tr_peer_t * peer;
    413414    tr_info_t * inf = &tor->info;
    414415    int i;
     
    436437    s->peersDownloading = 0;
    437438   
    438     tr_peer_t * peer;
    439439    for( i = 0; i < tor->peerCount; i++ )
    440440    {
     
    495495tr_peer_stat_t * tr_torrentPeers( tr_torrent_t * tor, int * peerCount )
    496496{
     497    tr_peer_stat_t * peers;
     498
    497499    tr_lockLock( &tor->lock );
    498500
    499501    *peerCount = tor->peerCount;
    500502   
    501     tr_peer_stat_t * peers = (tr_peer_stat_t *) calloc( tor->peerCount, sizeof( tr_peer_stat_t ) );
     503    peers = (tr_peer_stat_t *) calloc( tor->peerCount, sizeof( tr_peer_stat_t ) );
    502504    if (peers != NULL)
    503505    {
     
    512514            if( NULL != addr )
    513515            {
    514                 inet_ntop( AF_INET, addr, peers[i].addr,
     516                tr_netNtop( addr, peers[i].addr,
    515517                           sizeof( peers[i].addr ) );
    516518            }
     
    531533void tr_torrentPeersFree( tr_peer_stat_t * peers, int peerCount )
    532534{
     535    int i;
     536
    533537    if (peers == NULL)
    534538        return;
    535539
    536     int i;
    537540    for (i = 0; i < peerCount; i++)
    538541        free( peers[i].client );
Note: See TracChangeset for help on using the changeset viewer.