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()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.