Changeset 5917


Ignore:
Timestamp:
May 23, 2008, 6:56:42 PM (14 years ago)
Author:
charles
Message:

shave 16 bytes off sizeof(tr_peerIo)

Location:
trunk/libtransmission
Files:
2 edited

Legend:

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

    r5738 r5917  
    4242**/
    4343
    44 struct tr_extensions
    45 {
    46     unsigned int extendedProtocolSupported : 1;
    47     unsigned int fastPeersSupported : 1;
    48 };
    49 
    5044struct tr_peerIo
    5145{
    52     struct tr_handle * handle;
    53 
    54     struct in_addr in_addr;
    55     int port;
    56     int socket;
    57     int encryptionMode;
    58     int timeout;
    59     struct bufferevent * bufev;
    60     uint8_t peerId[20];
    61     time_t timeCreated;
    62 
    63     tr_extensions extensions;
    64 
    65     unsigned int isEncrypted : 1;
    66     unsigned int isIncoming : 1;
    67     unsigned int peerIdIsSet : 1;
    68 
    69     tr_can_read_cb     canRead;
    70     tr_did_write_cb    didWrite;
    71     tr_net_error_cb    gotError;
    72     void             * userData;
    73 
    74     tr_crypto * crypto;
     46    unsigned int          isEncrypted : 1;
     47    unsigned int          isIncoming : 1;
     48    unsigned int          peerIdIsSet : 1;
     49    unsigned int          extendedProtocolSupported : 1;
     50    unsigned int          fastPeersSupported : 1;
     51
     52    uint8_t               encryptionMode;
     53    uint8_t               timeout;
     54    uint16_t              port;
     55    int                   socket;
     56
     57    uint8_t               peerId[20];
     58    time_t                timeCreated;
     59
     60    struct tr_handle    * handle;
     61
     62    struct in_addr        in_addr;
     63    struct bufferevent  * bufev;
     64
     65    tr_can_read_cb        canRead;
     66    tr_did_write_cb       didWrite;
     67    tr_net_error_cb       gotError;
     68    void                * userData;
     69
     70    tr_crypto           * crypto;
    7571};
    7672
     
    389385    assert( flag==0 || flag==1 );
    390386   
    391     io->extensions.extendedProtocolSupported = flag;
     387    io->extendedProtocolSupported = flag;
    392388}
    393389
     
    398394    assert( flag==0 || flag==1 );
    399395   
    400     io->extensions.fastPeersSupported = flag;
     396    io->fastPeersSupported = flag;
    401397}
    402398
     
    406402    assert( io != NULL );
    407403   
    408     return io->extensions.extendedProtocolSupported;
     404    return io->extendedProtocolSupported;
    409405}
    410406
     
    414410    assert( io != NULL );
    415411   
    416     return io->extensions.fastPeersSupported;
     412    return io->fastPeersSupported;
    417413}
    418414/**
  • trunk/libtransmission/peer-io.h

    r4608 r5917  
    2424struct tr_crypto;
    2525typedef struct tr_peerIo tr_peerIo;
    26 typedef struct tr_extensions tr_extensions;
    2726
    2827/**
Note: See TracChangeset for help on using the changeset viewer.