Changeset 7894


Ignore:
Timestamp:
Feb 17, 2009, 4:00:53 AM (13 years ago)
Author:
livings124
Message:

assorted trivial cleanup

Location:
trunk
Files:
5 edited

Legend:

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

    r7892 r7894  
    993993            /* if we're seeding and we've reached our seed ratio limit, stop the torrent */
    994994            if( tr_torrentIsSeed( tor ) && tr_torrentGetSeedRatio( tor, &seedRatio ) ) {
    995                 double up = (double)tor->uploadedCur + (double)tor->uploadedPrev;
    996                 double down = (double)tor->downloadedCur + (double)tor->downloadedPrev;
    997                 double ratio = tr_getRatio( up, down );
     995                const double up = tor->uploadedCur + tor->uploadedPrev;
     996                const double down = tor->downloadedCur + tor->downloadedPrev;
     997                const double ratio = tr_getRatio( up, down );
    998998                if( ratio >= seedRatio ) {
    999999                    tr_torrentStop( tor );
  • trunk/libtransmission/torrent.c

    r7893 r7894  
    229229
    230230        case TR_RATIOLIMIT_GLOBAL:
    231             if(( isLimited = tr_sessionIsRatioLimited( tor->session )))
    232                 if( ratio )
    233                     *ratio = tr_sessionGetRatioLimit( tor->session );
     231            isLimited = tr_sessionIsRatioLimited( tor->session );
     232            if( isLimited && ratio )
     233                *ratio = tr_sessionGetRatioLimit( tor->session );
    234234            break;
    235235
  • trunk/macosx/BadgeView.m

    r7659 r7894  
    102102@implementation BadgeView (Private)
    103103
    104 //dock icon must have locked focus
    105104- (void) badge: (NSImage *) badge string: (NSString *) string atHeight: (CGFloat) height adjustForQuit: (BOOL) quit
    106105{
  • trunk/macosx/Torrent.m

    r7892 r7894  
    14851485            continue;
    14861486       
    1487         NSInteger priority = tr_torrentGetFilePriority(fHandle, index);
     1487        const NSInteger priority = tr_torrentGetFilePriority(fHandle, index);
    14881488        if (priority == TR_PRI_LOW)
    14891489        {
     
    15141514- (NSDate *) dateAdded
    15151515{
    1516     time_t date = fStat->addedDate;
     1516    const time_t date = fStat->addedDate;
    15171517    return [NSDate dateWithTimeIntervalSince1970: date];
    15181518}
     
    15201520- (NSDate *) dateCompleted
    15211521{
    1522     time_t date = fStat->doneDate;
     1522    const time_t date = fStat->doneDate;
    15231523    return date != 0 ? [NSDate dateWithTimeIntervalSince1970: date] : nil;
    15241524}
     
    15261526- (NSDate *) dateActivity
    15271527{
    1528     time_t date = fStat->activityDate;
     1528    const time_t date = fStat->activityDate;
    15291529    return date != 0 ? [NSDate dateWithTimeIntervalSince1970: date] : nil;
    15301530}
  • trunk/macosx/TorrentTableView.m

    r7659 r7894  
    723723- (void) setQuickLimitMode: (id) sender
    724724{
    725     NSInteger mode;
     725    tr_speedlimit mode;
    726726    switch ([sender tag])
    727727    {
     
    746746- (void) setQuickLimit: (id) sender
    747747{
    748     BOOL upload = [sender menu] == fUploadMenu;
     748    const BOOL upload = [sender menu] == fUploadMenu;
    749749    [fMenuTorrent setSpeedMode: TR_SPEEDLIMIT_SINGLE upload: upload];
    750750    [fMenuTorrent setSpeedLimit: [[sender representedObject] intValue] upload: upload];
Note: See TracChangeset for help on using the changeset viewer.