Changeset 9720


Ignore:
Timestamp:
Dec 12, 2009, 1:05:29 AM (12 years ago)
Author:
charles
Message:

(trunk libT) removed dead code: tr_isTimeval(), tr_timevalMsec(), tr_timevalSet()

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tr-dht.c

    r9719 r9720  
    8585{
    8686    struct timeval tv;
    87     tr_timevalSet( &tv, roughly / 2 + tr_cryptoWeakRandInt( roughly ),
    88                    tr_cryptoWeakRandInt( 1000000 ) );
     87    tv.tv_sec = roughly / 2 + tr_cryptoWeakRandInt( roughly );
     88    tv.tv_usec = tr_cryptoWeakRandInt( 1000000 );
    8989    select( 0, NULL, NULL, NULL, &tv );
    9090}
  • trunk/libtransmission/utils.c

    r9709 r9720  
    466466**/
    467467
    468 tr_bool
    469 tr_isTimeval( const struct timeval * tv )
    470 {
    471     return tv && ( tv->tv_sec >= 0 )
    472               && ( tv->tv_usec >= 0 )
    473               && ( tv->tv_usec < 1000000 );
    474 }
    475 
    476 void
    477 tr_timevalMsec( uint64_t milliseconds, struct timeval * setme )
    478 {
    479     const uint64_t microseconds = milliseconds * 1000;
    480     assert( setme != NULL );
    481     setme->tv_sec  = microseconds / 1000000;
    482     setme->tv_usec = microseconds % 1000000;
    483     assert( tr_isTimeval( setme ) );
    484 }
    485 
    486 void
    487 tr_timevalSet( struct timeval * setme, int seconds, int microseconds )
    488 {
    489     setme->tv_sec = seconds;
    490     setme->tv_usec = microseconds;
    491     assert( tr_isTimeval( setme ) );
    492 }
    493 
    494468void
    495469tr_timerAdd( struct event * timer, int seconds, int microseconds )
    496470{
    497471    struct timeval tv;
    498     tr_timevalSet( &tv, seconds, microseconds );
    499     event_add( timer, &tv );
     472    tv.tv_sec = seconds;
     473    tv.tv_usec = microseconds;
     474
     475    assert( tv.tv_sec >= 0 );
     476    assert( tv.tv_usec >= 0 );
     477    assert( tv.tv_usec < 1000000 );
     478
     479    evtimer_add( timer, &tv );
    500480}
    501481
  • trunk/libtransmission/utils.h

    r9709 r9720  
    254254                                                      TR_GNUC_MALLOC;
    255255
    256 struct timeval;
    257 
    258 tr_bool tr_isTimeval( const struct timeval * tv );
    259 
    260 void tr_timevalMsec( uint64_t milliseconds, struct timeval * setme );
    261 
    262 void tr_timevalSet( struct timeval * setme, int seconds, int microseconds );
    263 
    264256struct event;
    265257
Note: See TracChangeset for help on using the changeset viewer.