Changeset 2427


Ignore:
Timestamp:
Jul 19, 2007, 10:37:30 AM (15 years ago)
Author:
charles
Message:

remove TR_NTOHL macro

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/internal.h

    r2377 r2427  
    8888/* Convenient macros to perform uint32_t endian conversions with
    8989   char pointers */
    90 #define TR_NTOHL(p,a) (a) = tr_ntohl((p))
    9190#define TR_HTONL(a,p) tr_htonl((a), ( uint8_t * )(p))
    9291static inline uint32_t tr_ntohl( uint8_t * p )
  • trunk/libtransmission/peeraz.h

    r2358 r2427  
    285285    }
    286286    /* message length */
    287     TR_NTOHL( buf, msglen );
     287    msglen = tr_ntohl( buf );
    288288    msglen += 4;
    289289    off = 4;
     
    298298    }
    299299    /* name length */
    300     TR_NTOHL( buf + off, namelen );
     300    namelen = tr_ntohl( buf + off );
    301301    off += 4;
    302302    if( off + namelen + 1 > msglen )
  • trunk/libtransmission/peerparse.h

    r2374 r2427  
    114114    }
    115115
    116     TR_NTOHL( p, piece );
     116    piece = tr_ntohl( p );
    117117    if( ( uint32_t )inf->pieceCount <= piece )
    118118    {
     
    215215    }
    216216   
    217     TR_NTOHL( p,     index );
    218     TR_NTOHL( &p[4], begin );
    219     TR_NTOHL( &p[8], length );
     217    index = tr_ntohl( p );
     218    begin = tr_ntohl( &p[4] );
     219    length = tr_ntohl( &p[8] );
    220220
    221221    if( inf->pieceCount <= index )
     
    294294    }
    295295
    296     TR_NTOHL( p,     index );
    297     TR_NTOHL( &p[4], begin );
     296    index = tr_ntohl( p );
     297    begin = tr_ntohl( &p[4] );
    298298
    299299    if( inf->pieceCount <= index )
     
    397397    }
    398398
    399     TR_NTOHL( p,     index );
    400     TR_NTOHL( &p[4], begin );
    401     TR_NTOHL( &p[8], length );
     399    index = tr_ntohl( p );
     400    begin = tr_ntohl( &p[4] );
     401    length = tr_ntohl( &p[8] );
    402402
    403403    if( inf->pieceCount <= index )
     
    454454
    455455    /* Get payload size */
    456     TR_NTOHL( buf, *msglen );
     456    *msglen = tr_ntohl( buf );
    457457
    458458    if( 4 + *msglen > buflen )
Note: See TracChangeset for help on using the changeset viewer.