Changeset 13501


Ignore:
Timestamp:
Sep 18, 2012, 3:44:59 AM (9 years ago)
Author:
livings124
Message:

return a value (and rename) testTurtleTime instead of passing in a flag to set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r13500 r13501  
    13221322
    13231323/**
    1324  * @param enabled whether turtle should be on/off according to the scheduler
     1324 * return whether turtle should be on/off according to the scheduler
    13251325 */
    1326 static void
    1327 testTurtleTime( const struct tr_turtle_info * t, bool * enabled )
    1328 {
    1329     bool e;
     1326static bool
     1327getInTurtleTime( const struct tr_turtle_info * t )
     1328{
    13301329    struct tm tm;
    13311330    size_t minute_of_the_week;
     
    13401339        minute_of_the_week = MINUTES_PER_WEEK - 1;
    13411340
    1342     e = tr_bitfieldHas( &t->minutes, minute_of_the_week );
    1343     if( enabled != NULL )
    1344         *enabled = e;
     1341    return tr_bitfieldHas( &t->minutes, minute_of_the_week );
    13451342}
    13461343
     
    13601357    assert( t->isClockEnabled );
    13611358
    1362     testTurtleTime( t, &enabled );
     1359    enabled = getInTurtleTime( t );
    13631360    newAutoTurtleState = autoSwitchState( enabled );
    13641361    alreadySwitched = ( t->autoTurtleState == newAutoTurtleState );
     
    13871384    if( turtle->isClockEnabled )
    13881385    {
    1389         testTurtleTime( turtle, &turtle->isEnabled );
     1386        turtle->isEnabled = getInTurtleTime( turtle );
    13901387        turtle->autoTurtleState = autoSwitchState( turtle->isEnabled );
    13911388    }
     
    14961493    if( t->isClockEnabled )
    14971494    {
    1498         bool enabled;
    1499         testTurtleTime( t, &enabled );
     1495        const bool enabled = getInTurtleTime( t );
    15001496        useAltSpeed( s, t, enabled, true );
    15011497        t->autoTurtleState = autoSwitchState( enabled );
Note: See TracChangeset for help on using the changeset viewer.