Changeset 7016


Ignore:
Timestamp:
Nov 2, 2008, 1:07:01 AM (12 years ago)
Author:
livings124
Message:

more type changes

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r7013 r7016  
    12661266    [fTorrents removeObjectsInArray: torrents];
    12671267   
     1268    //for tiger - when 10.5-only repace with NSIntegerMax
    12681269    int lowestOrderValue = INT_MAX;
    12691270    enumerator = [torrents objectEnumerator];
  • trunk/macosx/InfoWindowController.h

    r7007 r7016  
    3737   
    3838    IBOutlet NSView * fInfoView, * fActivityView, * fTrackerView, * fPeersView, * fFilesView, * fOptionsView;
    39     int fCurrentTabTag;
     39    NSInteger fCurrentTabTag;
    4040    IBOutlet NSMatrix * fTabMatrix;
    4141
     
    6565    IBOutlet PiecesView * fPiecesView;
    6666    IBOutlet NSSegmentedControl * fPiecesControl;
    67     float fWebSeedTableHeight, fSpaceBetweenWebSeedAndPeer;
     67    CGFloat fWebSeedTableHeight, fSpaceBetweenWebSeedAndPeer;
    6868    NSViewAnimation * fWebSeedTableAnimation;
    6969   
  • trunk/macosx/InfoWindowController.m

    r7007 r7016  
    7575- (void) updateInfoFiles;
    7676
    77 - (NSView *) tabViewForTag: (int) tag;
     77- (NSView *) tabViewForTag: (NSInteger) tag;
    7878- (void) setWebSeedTableHidden: (BOOL) hide animate: (BOOL) animate;
    7979- (NSArray *) peerSortDescriptors;
     
    9898    NSPanel * window = (NSPanel *)[self window];
    9999   
    100     float windowHeight = [window frame].size.height;
     100    CGFloat windowHeight = [window frame].size.height;
    101101   
    102102    [window setFrameAutosaveName: @"InspectorWindow"];
     
    121121    fCurrentTabTag = INVALID;
    122122    NSString * identifier = [[NSUserDefaults standardUserDefaults] stringForKey: @"InspectorSelected"];
    123     int tag;
     123    NSInteger tag;
    124124    if ([identifier isEqualToString: TAB_INFO_IDENT])
    125125        tag = TAB_INFO_TAG;
     
    243243    fTorrents = [torrents retain];
    244244
    245     int numberSelected = [fTorrents count];
     245    NSUInteger numberSelected = [fTorrents count];
    246246    if (numberSelected != 1)
    247247    {
     
    255255       
    256256            uint64_t size = 0;
    257             int fileCount = 0;
     257            NSInteger fileCount = 0;
    258258            NSEnumerator * enumerator = [torrents objectEnumerator];
    259259            Torrent * torrent;
     
    414414        {
    415415            NSString * fileString;
    416             int fileCount = [torrent fileCount];
     416            NSInteger fileCount = [torrent fileCount];
    417417            if (fileCount == 1)
    418418                fileString = NSLocalizedString(@"1 file", "Inspector -> selected torrents");
     
    534534    Torrent * torrent = [enumerator nextObject]; //first torrent
    535535   
    536     int uploadSpeedMode = [torrent speedMode: YES],
    537         uploadSpeedLimit = [torrent speedLimit: YES],
    538         downloadSpeedMode = [torrent speedMode: NO],
    539         downloadSpeedLimit = [torrent speedLimit: NO];
     536    NSInteger uploadSpeedMode = [torrent speedMode: YES],
     537                uploadSpeedLimit = [torrent speedLimit: YES],
     538                downloadSpeedMode = [torrent speedMode: NO],
     539                downloadSpeedLimit = [torrent speedLimit: NO];
    540540   
    541541    while ((torrent = [enumerator nextObject])
     
    557557   
    558558    //set upload view
    559     int index;
     559    NSInteger index;
    560560    if (uploadSpeedMode == TR_SPEEDLIMIT_SINGLE)
    561561        index = OPTION_POPUP_LIMIT;
     
    599599    torrent = [enumerator nextObject]; //first torrent
    600600   
    601     int checkRatio = [torrent ratioSetting];
    602     float ratioLimit = [torrent ratioLimit];
     601    NSInteger checkRatio = [torrent ratioSetting];
     602    CGFloat ratioLimit = [torrent ratioLimit];
    603603   
    604604    while ((torrent = [enumerator nextObject]) && (checkRatio != INVALID || checkRatio != INVALID))
     
    633633    torrent = [enumerator nextObject]; //first torrent
    634634   
    635     int maxPeers = [torrent maxPeerConnect];
     635    NSInteger maxPeers = [torrent maxPeerConnect];
    636636   
    637637    while ((torrent = [enumerator nextObject]))
     
    684684- (void) setTab: (id) sender
    685685{
    686     int oldTabTag = fCurrentTabTag;
     686    NSInteger oldTabTag = fCurrentTabTag;
    687687    fCurrentTabTag = [fTabMatrix selectedTag];
    688688    if (fCurrentTabTag == oldTabTag)
     
    692692   
    693693    //take care of old view
    694     float oldHeight = 0;
     694    CGFloat oldHeight = 0;
    695695    NSString * oldResizeSaveKey = nil;
    696696    if (oldTabTag != INVALID)
     
    790790    if (resizeSaveKey)
    791791    {
    792         float height = [[NSUserDefaults standardUserDefaults] floatForKey: resizeSaveKey];
    793         if (height != 0)
     792        CGFloat height = [[NSUserDefaults standardUserDefaults] floatForKey: resizeSaveKey];
     793        if (height != 0.0)
    794794            viewRect.size.height = MAX(height, TAB_MIN_HEIGHT);
    795795    }
    796796   
    797     float difference = (viewRect.size.height - oldHeight) * [window userSpaceScaleFactor];
     797    CGFloat difference = (viewRect.size.height - oldHeight) * [window userSpaceScaleFactor];
    798798    windowRect.origin.y -= difference;
    799799    windowRect.size.height += difference;
     
    826826- (void) setNextTab
    827827{
    828     int tag = [fTabMatrix selectedTag]+1;
     828    NSInteger tag = [fTabMatrix selectedTag]+1;
    829829    if (tag >= [fTabMatrix numberOfColumns])
    830830        tag = 0;
     
    836836- (void) setPreviousTab
    837837{
    838     int tag = [fTabMatrix selectedTag]-1;
     838    NSInteger tag = [fTabMatrix selectedTag]-1;
    839839    if (tag < 0)
    840840        tag = [fTabMatrix numberOfColumns]-1;
     
    844844}
    845845
    846 - (int) numberOfRowsInTableView: (NSTableView *) tableView
     846- (NSInteger) numberOfRowsInTableView: (NSTableView *) tableView
    847847{
    848848    if (tableView == fPeerTable)
     
    855855}
    856856
    857 - (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) column row: (int) row
     857- (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) column row: (NSInteger) row
    858858{
    859859    if (tableView == fPeerTable)
     
    899899        if ([item isKindOfClass: [NSNumber class]])
    900900        {
    901             int tier = [item intValue];
     901            NSInteger tier = [item intValue];
    902902            if (tier == 0)
    903903                return NSLocalizedString(@"User-Added", "Inspector -> tracker table");
     
    936936}
    937937
    938 - (BOOL) tableView: (NSTableView *) tableView shouldSelectRow: (int) row
     938- (BOOL) tableView: (NSTableView *) tableView shouldSelectRow: (NSInteger) row
    939939{
    940940    return tableView == fTrackerTable;
     
    945945    if ([notification object] == fTrackerTable)
    946946    {
    947         int numSelected = [fTrackerTable numberOfSelectedRows];
     947        NSInteger numSelected = [fTrackerTable numberOfSelectedRows];
    948948        [fTrackerAddRemoveControl setEnabled: numSelected > 0 forSegment: TRACKER_REMOVE_TAG];
    949949    }
     
    958958
    959959- (NSString *) tableView: (NSTableView *) tableView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect
    960                 tableColumn: (NSTableColumn *) column row: (int) row mouseLocation: (NSPoint) mouseLocation
     960                tableColumn: (NSTableColumn *) column row: (NSInteger) row mouseLocation: (NSPoint) mouseLocation
    961961{
    962962    if (tableView == fPeerTable)
     
    972972       
    973973        NSString * portString;
    974         int port;
     974        NSInteger port;
    975975        if ((port = [[peer objectForKey: @"Port"] intValue]) > 0)
    976976            portString = [NSString stringWithFormat: @"%d", port];
     
    11681168{
    11691169    BOOL upload = sender == fUploadLimitPopUp;
    1170     int mode;
     1170    NSInteger mode;
    11711171    switch ([sender indexOfSelectedItem])
    11721172    {
     
    12061206{
    12071207    BOOL upload = sender == fUploadLimitField;
    1208     int limit = [sender intValue];
     1208    NSInteger limit = [sender intValue];
    12091209   
    12101210    Torrent * torrent;
     
    12171217- (void) setRatioSetting: (id) sender
    12181218{
    1219     int setting;
     1219    NSInteger setting;
    12201220    switch ([sender indexOfSelectedItem])
    12211221    {
     
    12511251- (void) setRatioLimit: (id) sender
    12521252{
    1253     float limit = [sender floatValue];
     1253    CGFloat limit = [sender floatValue];
    12541254   
    12551255    Torrent * torrent;
     
    12611261- (void) setPeersConnectLimit: (id) sender
    12621262{
    1263     int limit = [sender intValue];
     1263    NSInteger limit = [sender intValue];
    12641264   
    12651265    Torrent * torrent;
     
    13101310- (void) updateInfoActivity
    13111311{
    1312     int numberSelected = [fTorrents count];
     1312    NSInteger numberSelected = [fTorrents count];
    13131313    if (numberSelected == 0)
    13141314        return;
     
    14011401    [fAnnounceResponseField setSelectable: ![announceResponse isEqualToString: @""]];
    14021402   
    1403     int announceNext = [torrent nextAnnounceTime];
     1403    NSInteger announceNext = [torrent nextAnnounceTime];
    14041404    NSString * announceNextString;
    14051405    switch (announceNext)
     
    14361436    [fScrapeResponseField setSelectable: ![scrapeResponse isEqualToString: @""]];
    14371437   
    1438     int scrapeNext = [torrent nextScrapeTime];
     1438    NSInteger scrapeNext = [torrent nextScrapeTime];
    14391439    NSString * scrapeNextString;
    14401440    switch (scrapeNext)
     
    14581458    Torrent * torrent = [fTorrents objectAtIndex: 0];
    14591459   
    1460     int seeders = [torrent seeders], leechers = [torrent leechers], completed = [torrent completedFromTracker];
     1460    NSInteger seeders = [torrent seeders], leechers = [torrent leechers], completed = [torrent completedFromTracker];
    14611461    [fSeedersField setStringValue: seeders >= 0 ? [NSString stringWithFormat: @"%d", seeders] : @""];
    14621462    [fLeechersField setStringValue: leechers >= 0 ? [NSString stringWithFormat: @"%d", leechers] : @""];
     
    14671467    if (active)
    14681468    {
    1469         int total = [torrent totalPeersConnected];
     1469        NSInteger total = [torrent totalPeersConnected];
    14701470        NSString * connected = [NSString stringWithFormat:
    14711471                                NSLocalizedString(@"%d Connected", "Inspector -> Peers tab -> peers"), total];
     
    14741474        {
    14751475            NSMutableArray * components = [NSMutableArray arrayWithCapacity: 4];
    1476             int count;
     1476            NSInteger count;
    14771477            if ((count = [torrent totalPeersTracker]) > 0)
    14781478                [components addObject: [NSString stringWithFormat:
     
    15231523}
    15241524
    1525 - (NSView *) tabViewForTag: (int) tag
     1525- (NSView *) tabViewForTag: (NSInteger) tag
    15261526{
    15271527    switch (tag)
     
    15611561    if (hide)
    15621562    {
    1563         float webSeedFrameMaxY = NSMaxY(webSeedFrame);
     1563        CGFloat webSeedFrameMaxY = NSMaxY(webSeedFrame);
    15641564        webSeedFrame.size.height = 0;
    15651565        webSeedFrame.origin.y = webSeedFrameMaxY;
  • trunk/macosx/Torrent.h

    r6885 r7016  
    6666    NSDate * fPreviousFinishedIndexesDate;
    6767   
    68     float fRatioLimit;
    69     int fRatioSetting;
     68    CGFloat fRatioLimit;
     69    NSInteger fRatioSetting;
    7070    BOOL fFinishedSeeding, fWaitToStart, fStalled;
    7171   
    72     int fOrderValue, fGroupValue;
     72    NSInteger fOrderValue, fGroupValue;
    7373   
    7474    BOOL fAddedTrackers;
     
    9090- (NSString *) downloadFolder;
    9191
    92 - (void) getAvailability: (int8_t *) tab size: (int) size;
    93 - (void) getAmountFinished: (float *) tab size: (int) size;
     92- (void) getAvailability: (int8_t *) tab size: (NSInteger) size;
     93- (void) getAmountFinished: (float *) tab size: (NSInteger) size;
    9494- (NSIndexSet *) previousFinishedPieces;
    9595-(void) setPreviousFinishedPieces: (NSIndexSet *) indexes;
     
    107107- (void) resetCache;
    108108
    109 - (float) ratio;
    110 - (int) ratioSetting;
    111 - (void) setRatioSetting: (int) setting;
    112 - (float) ratioLimit;
    113 - (void) setRatioLimit: (float) limit;
    114 - (float) actualStopRatio; //returns INVALID if will not stop
    115 - (float) progressStopRatio;
     109- (CGFloat) ratio;
     110- (NSInteger) ratioSetting;
     111- (void) setRatioSetting: (NSInteger) setting;
     112- (CGFloat) ratioLimit;
     113- (void) setRatioLimit: (CGFloat) limit;
     114- (CGFloat) actualStopRatio; //returns INVALID if will not stop
     115- (CGFloat) progressStopRatio;
    116116
    117117- (tr_speedlimit) speedMode: (BOOL) upload;
    118118- (void) setSpeedMode: (tr_speedlimit) mode upload: (BOOL) upload;
    119 - (int) speedLimit: (BOOL) upload;
    120 - (void) setSpeedLimit: (int) limit upload: (BOOL) upload;
     119- (NSInteger) speedLimit: (BOOL) upload;
     120- (void) setSpeedLimit: (NSInteger) limit upload: (BOOL) upload;
    121121
    122122- (void) setMaxPeerConnect: (uint16_t) count;
     
    146146- (NSString *) trackerAddressAnnounce;
    147147- (NSDate *) lastAnnounceTime;
    148 - (int) nextAnnounceTime;
     148- (NSInteger) nextAnnounceTime;
    149149- (NSString *) announceResponse;
    150150
    151151- (NSString *) trackerAddressScrape;
    152152- (NSDate *) lastScrapeTime;
    153 - (int) nextScrapeTime;
     153- (NSInteger) nextScrapeTime;
    154154- (NSString *) scrapeResponse;
    155155
     
    163163- (NSDate *) dateCreated;
    164164
    165 - (int) pieceSize;
    166 - (int) pieceCount;
     165- (NSInteger) pieceSize;
     166- (NSInteger) pieceCount;
    167167- (NSString *) hashString;
    168168- (BOOL) privateTorrent;
     
    174174- (BOOL) publicTorrent;
    175175
    176 - (float) progress;
    177 - (float) progressDone;
    178 - (float) progressLeft;
    179 - (float) checkingProgress;
    180 
    181 - (int) eta;
    182 - (int) etaRatio;
    183 
    184 - (float) notAvailableDesired;
     176- (CGFloat) progress;
     177- (CGFloat) progressDone;
     178- (CGFloat) progressLeft;
     179- (CGFloat) checkingProgress;
     180
     181- (NSInteger) eta;
     182- (NSInteger) etaRatio;
     183
     184- (CGFloat) notAvailableDesired;
    185185
    186186- (BOOL) isActive;
     
    205205- (NSString *) stateString;
    206206
    207 - (int) seeders;
    208 - (int) leechers;
    209 - (int) completedFromTracker;
    210 
    211 - (int) totalPeersConnected;
    212 - (int) totalPeersTracker;
    213 - (int) totalPeersIncoming;
    214 - (int) totalPeersCache;
    215 - (int) totalPeersPex;
    216 - (int) totalPeersKnown;
    217 
    218 - (int) peersSendingToUs;
    219 - (int) peersGettingFromUs;
    220 
    221 - (float) downloadRate;
    222 - (float) uploadRate;
    223 - (float) totalRate;
     207- (NSInteger) seeders;
     208- (NSInteger) leechers;
     209- (NSInteger) completedFromTracker;
     210
     211- (NSInteger) totalPeersConnected;
     212- (NSInteger) totalPeersTracker;
     213- (NSInteger) totalPeersIncoming;
     214- (NSInteger) totalPeersCache;
     215- (NSInteger) totalPeersPex;
     216- (NSInteger) totalPeersKnown;
     217
     218- (NSInteger) peersSendingToUs;
     219- (NSInteger) peersGettingFromUs;
     220
     221- (CGFloat) downloadRate;
     222- (CGFloat) uploadRate;
     223- (CGFloat) totalRate;
    224224- (uint64_t) haveVerified;
    225225- (uint64_t) haveTotal;
     
    228228- (uint64_t) uploadedTotal;
    229229- (uint64_t) failedHash;
    230 - (float) swarmSpeed;
    231 
    232 - (int) orderValue;
    233 - (void) setOrderValue: (int) orderValue;
    234 
    235 - (int) groupValue;
    236 - (void) setGroupValue: (int) groupValue;
    237 - (int) groupOrderValue;
     230- (CGFloat) swarmSpeed;
     231
     232- (NSInteger) orderValue;
     233- (void) setOrderValue: (NSInteger) orderValue;
     234
     235- (NSInteger) groupValue;
     236- (void) setGroupValue: (NSInteger) groupValue;
     237- (NSInteger) groupOrderValue;
    238238- (void) checkGroupValueForRemoval: (NSNotification *) notification;
    239239
    240240- (NSArray *) fileList;
    241 - (int) fileCount;
     241- (NSInteger) fileCount;
    242242- (void) updateFileStat;
    243243
    244244//methods require fileStats to have been updated recently to be accurate
    245 - (float) fileProgress: (FileListNode *) node;
    246 - (BOOL) canChangeDownloadCheckForFile: (int) index;
     245- (CGFloat) fileProgress: (FileListNode *) node;
     246- (BOOL) canChangeDownloadCheckForFile: (NSInteger) index;
    247247- (BOOL) canChangeDownloadCheckForFiles: (NSIndexSet *) indexSet;
    248 - (int) checkForFiles: (NSIndexSet *) indexSet;
    249 - (void) setFileCheckState: (int) state forIndexes: (NSIndexSet *) indexSet;
    250 - (void) setFilePriority: (int) priority forIndexes: (NSIndexSet *) indexSet;
    251 - (BOOL) hasFilePriority: (int) priority forIndexes: (NSIndexSet *) indexSet;
     248- (NSInteger) checkForFiles: (NSIndexSet *) indexSet;
     249- (void) setFileCheckState: (NSInteger) state forIndexes: (NSIndexSet *) indexSet;
     250- (void) setFilePriority: (NSInteger) priority forIndexes: (NSIndexSet *) indexSet;
     251- (BOOL) hasFilePriority: (NSInteger) priority forIndexes: (NSIndexSet *) indexSet;
    252252- (NSSet *) filePrioritiesForIndexes: (NSIndexSet *) indexSet;
    253253
     
    257257- (NSDate *) dateActivityOrAdd;
    258258
    259 - (int) stalledMinutes;
     259- (NSInteger) stalledMinutes;
    260260- (BOOL) isStalled;
    261261
  • trunk/macosx/Torrent.m

    r6979 r7016  
    4545
    4646- (void) createFileList;
    47 - (void) insertPath: (NSMutableArray *) components forParent: (FileListNode *) parent fileSize: (uint64_t) size index: (int) index;
     47- (void) insertPath: (NSMutableArray *) components forParent: (FileListNode *) parent fileSize: (uint64_t) size index: (NSInteger) index;
    4848
    4949- (void) completenessChange: (NSNumber *) status;
     
    5252- (void) endQuickPause;
    5353
    54 - (NSString *) etaString: (int) eta;
     54- (NSString *) etaString: (NSInteger) eta;
    5555
    5656- (void) updateAllTrackers: (NSMutableArray *) trackers;
     
    232232}
    233233
    234 - (void) getAvailability: (int8_t *) tab size: (int) size
     234- (void) getAvailability: (int8_t *) tab size: (NSInteger) size
    235235{
    236236    tr_torrentAvailability(fHandle, tab, size);
    237237}
    238238
    239 - (void) getAmountFinished: (float *) tab size: (int) size
     239- (void) getAmountFinished: (float *) tab size: (NSInteger) size
    240240{
    241241    tr_torrentAmountFinished(fHandle, tab, size);
     
    274274   
    275275    //check to stop for ratio
    276     float stopRatio;
     276    CGFloat stopRatio;
    277277    if ([self isSeeding] && (stopRatio = [self actualStopRatio]) != INVALID && [self ratio] >= stopRatio)
    278278    {
     
    348348}
    349349
    350 - (float) ratio
     350- (CGFloat) ratio
    351351{
    352352    return fStat->ratio;
    353353}
    354354
    355 - (int) ratioSetting
     355- (NSInteger) ratioSetting
    356356{
    357357    return fRatioSetting;
    358358}
    359359
    360 - (void) setRatioSetting: (int) setting
     360- (void) setRatioSetting: (NSInteger) setting
    361361{
    362362    fRatioSetting = setting;
    363363}
    364364
    365 - (float) ratioLimit
     365- (CGFloat) ratioLimit
    366366{
    367367    return fRatioLimit;
    368368}
    369369
    370 - (void) setRatioLimit: (float) limit
     370- (void) setRatioLimit: (CGFloat) limit
    371371{
    372372    if (limit >= 0)
     
    374374}
    375375
    376 - (float) actualStopRatio
     376- (CGFloat) actualStopRatio
    377377{
    378378    if (fRatioSetting == NSOnState)
     
    384384}
    385385
    386 - (float) progressStopRatio
    387 {
    388     float stopRatio, ratio;
     386- (CGFloat) progressStopRatio
     387{
     388    CGFloat stopRatio, ratio;
    389389    if ((stopRatio = [self actualStopRatio]) == INVALID || (ratio = [self ratio]) >= stopRatio)
    390390        return 1.0;
     
    405405}
    406406
    407 - (int) speedLimit: (BOOL) upload
     407- (NSInteger) speedLimit: (BOOL) upload
    408408{
    409409    return tr_torrentGetSpeedLimit(fHandle, upload ? TR_UP : TR_DOWN);
    410410}
    411411
    412 - (void) setSpeedLimit: (int) limit upload: (BOOL) upload
     412- (void) setSpeedLimit: (NSInteger) limit upload: (BOOL) upload
    413413{
    414414    tr_torrentSetSpeedLimit(fHandle, upload ? TR_UP : TR_DOWN, limit);
     
    473473        NSArray * oldComponents = [oldFolder pathComponents],
    474474                * newComponents = [folder pathComponents];
    475         int count;
     475        NSInteger count;
    476476       
    477477        if ((count = [oldComponents count]) < [newComponents count]
     
    559559           
    560560            //determine amount needed
    561             for (int i = 0; i < [self fileCount]; i++)
     561            for (NSInteger i = 0; i < [self fileCount]; i++)
    562562            {
    563563                if (tr_torrentGetFileDL(fHandle, i))
     
    655655}
    656656
    657 - (void) destinationChoiceClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) context
     657- (void) destinationChoiceClosed: (NSOpenPanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) context
    658658{
    659659    if (code != NSOKButton)
     
    728728- (NSDate *) lastAnnounceTime
    729729{
    730     int date = fStat->lastAnnounceTime;
     730    NSInteger date = fStat->lastAnnounceTime;
    731731    return date > 0 ? [NSDate dateWithTimeIntervalSince1970: date] : nil;
    732732}
    733733
    734 - (int) nextAnnounceTime
    735 {
    736     int date = fStat->nextAnnounceTime;
     734- (NSInteger) nextAnnounceTime
     735{
     736    NSInteger date = fStat->nextAnnounceTime;
    737737    NSTimeInterval difference;
    738738    switch (date)
     
    744744        default:
    745745            difference = [[NSDate dateWithTimeIntervalSince1970: date] timeIntervalSinceNow];
    746             return difference > 0 ? (int)difference : STAT_TIME_NONE;
     746            return difference > 0 ? (NSInteger)difference : STAT_TIME_NONE;
    747747    }
    748748}
     
    760760- (NSDate *) lastScrapeTime
    761761{
    762     int date = fStat->lastScrapeTime;
     762    NSInteger date = fStat->lastScrapeTime;
    763763    return date > 0 ? [NSDate dateWithTimeIntervalSince1970: date] : nil;
    764764}
    765765
    766 - (int) nextScrapeTime
    767 {
    768     int date = fStat->nextScrapeTime;
     766- (NSInteger) nextScrapeTime
     767{
     768    NSInteger date = fStat->nextScrapeTime;
    769769    NSTimeInterval difference;
    770770    switch (date)
     
    776776        default:
    777777            difference = [[NSDate dateWithTimeIntervalSince1970: date] timeIntervalSinceNow];
    778             return difference > 0 ? (int)difference : STAT_TIME_NONE;
     778            return difference > 0 ? (NSInteger)difference : STAT_TIME_NONE;
    779779    }
    780780}
     
    787787- (NSMutableArray *) allTrackers: (BOOL) separators
    788788{
    789     int count = fInfo->trackerCount, capacity = count;
     789    NSInteger count = fInfo->trackerCount, capacity = count;
    790790    if (separators)
    791791        capacity += fInfo->trackers[count-1].tier + 1;
    792792    NSMutableArray * allTrackers = [NSMutableArray arrayWithCapacity: capacity];
    793793   
    794     for (int i = 0, tier = -1; i < count; i++)
     794    for (NSInteger i = 0, tier = -1; i < count; i++)
    795795    {
    796796        if (separators && tier != fInfo->trackers[i].tier)
     
    809809{
    810810    //find added tracker at end of first tier
    811     int i;
     811    NSInteger i;
    812812    for (i = 1; i < [trackers count]; i++)
    813813        if ([[trackers objectAtIndex: i] isKindOfClass: [NSNumber class]])
     
    860860- (NSDate *) dateCreated
    861861{
    862     int date = fInfo->dateCreated;
     862    NSInteger date = fInfo->dateCreated;
    863863    return date > 0 ? [NSDate dateWithTimeIntervalSince1970: date] : nil;
    864864}
    865865
    866 - (int) pieceSize
     866- (NSInteger) pieceSize
    867867{
    868868    return fInfo->pieceSize;
    869869}
    870870
    871 - (int) pieceCount
     871- (NSInteger) pieceCount
    872872{
    873873    return fInfo->pieceCount;
     
    904904}
    905905
    906 - (float) progress
     906- (CGFloat) progress
    907907{
    908908    return fStat->percentComplete;
    909909}
    910910
    911 - (float) progressDone
     911- (CGFloat) progressDone
    912912{
    913913    return fStat->percentDone;
    914914}
    915915
    916 - (float) progressLeft
    917 {
    918     return (float)[self sizeLeft] / [self size];
    919 }
    920 
    921 - (float) checkingProgress
     916- (CGFloat) progressLeft
     917{
     918    return (CGFloat)[self sizeLeft] / [self size];
     919}
     920
     921- (CGFloat) checkingProgress
    922922{
    923923    return fStat->recheckProgress;
    924924}
    925925
    926 - (int) eta
     926- (NSInteger) eta
    927927{
    928928    return fStat->eta;
    929929}
    930930
    931 - (int) etaRatio
     931- (NSInteger) etaRatio
    932932{
    933933    if (![self isSeeding])
    934934        return TR_ETA_UNKNOWN;
    935935   
    936     float uploadRate = [self uploadRate];
     936    CGFloat uploadRate = [self uploadRate];
    937937    if (uploadRate < 0.1)
    938938        return TR_ETA_UNKNOWN;
    939939   
    940     float stopRatio = [self actualStopRatio], ratio = [self ratio];
     940    CGFloat stopRatio = [self actualStopRatio], ratio = [self ratio];
    941941    if (stopRatio == INVALID || ratio >= stopRatio)
    942942        return TR_ETA_UNKNOWN;
    943943   
    944     return (float)MAX([self downloadedTotal], [self haveTotal]) * (stopRatio - ratio) / uploadRate / 1024.0;
    945 }
    946 
    947 - (float) notAvailableDesired
    948 {
    949     return 1.0 - (float)fStat->desiredAvailable / [self sizeLeft];
     944    return (CGFloat)MAX([self downloadedTotal], [self haveTotal]) * (stopRatio - ratio) / uploadRate / 1024.0;
     945}
     946
     947- (CGFloat) notAvailableDesired
     948{
     949    return 1.0 - (CGFloat)fStat->desiredAvailable / [self sizeLeft];
    950950}
    951951
     
    10001000- (NSArray *) peers
    10011001{
    1002     int totalPeers;
     1002    NSInteger totalPeers;
    10031003    tr_peer_stat * peers = tr_torrentPeers(fHandle, &totalPeers);
    10041004   
    10051005    NSMutableArray * peerDicts = [NSMutableArray arrayWithCapacity: totalPeers];
    10061006   
    1007     for (int i = 0; i < totalPeers; i++)
     1007    for (NSInteger i = 0; i < totalPeers; i++)
    10081008    {
    10091009        tr_peer_stat * peer = &peers[i];
     
    10381038- (NSArray *) webSeeds
    10391039{
    1040     const int webSeedCount = fInfo->webseedCount;
     1040    const NSInteger webSeedCount = fInfo->webseedCount;
    10411041    NSMutableArray * webSeeds = [NSMutableArray arrayWithCapacity: webSeedCount];
    10421042   
    10431043    float * dlSpeeds = tr_torrentWebSpeeds(fHandle);
    10441044   
    1045     for (int i = 0; i < webSeedCount; i++)
     1045    for (NSInteger i = 0; i < webSeedCount; i++)
    10461046    {
    10471047        NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity: 2];
     
    10661066    if (![self allDownloaded])
    10671067    {
    1068         float progress;
     1068        CGFloat progress;
    10691069        if ([self isFolder] && [fDefaults boolForKey: @"DisplayStatusProgressSelected"])
    10701070        {
     
    11121112        && (fRatioSetting == NSOnState || (fRatioSetting == NSMixedState && [fDefaults boolForKey: @"RatioCheck"]))))
    11131113    {
    1114         int eta = fStat->activity == TR_STATUS_DOWNLOAD ? [self eta] : [self etaRatio];
     1114        NSInteger eta = fStat->activity == TR_STATUS_DOWNLOAD ? [self eta] : [self etaRatio];
    11151115        string = [string stringByAppendingFormat: @" - %@", [self etaString: eta]];
    11161116    }
     
    11641164                                                    "Torrent -> status string"), [self peersSendingToUs]];
    11651165               
    1166                 int webSeedCount = fStat->webseedsSendingToUs;
     1166                NSInteger webSeedCount = fStat->webseedsSendingToUs;
    11671167                if (webSeedCount > 0)
    11681168                {
     
    12811281}
    12821282
    1283 - (int) seeders
     1283- (NSInteger) seeders
    12841284{
    12851285    return fStat->seeders;
    12861286}
    12871287
    1288 - (int) leechers
     1288- (NSInteger) leechers
    12891289{
    12901290    return fStat->leechers;
    12911291}
    12921292
    1293 - (int) completedFromTracker
     1293- (NSInteger) completedFromTracker
    12941294{
    12951295    return fStat->timesCompleted;
    12961296}
    12971297
    1298 - (int) totalPeersConnected
     1298- (NSInteger) totalPeersConnected
    12991299{
    13001300    return fStat->peersConnected;
    13011301}
    13021302
    1303 - (int) totalPeersTracker
     1303- (NSInteger) totalPeersTracker
    13041304{
    13051305    return fStat->peersFrom[TR_PEER_FROM_TRACKER];
    13061306}
    13071307
    1308 - (int) totalPeersIncoming
     1308- (NSInteger) totalPeersIncoming
    13091309{
    13101310    return fStat->peersFrom[TR_PEER_FROM_INCOMING];
    13111311}
    13121312
    1313 - (int) totalPeersCache
     1313- (NSInteger) totalPeersCache
    13141314{
    13151315    return fStat->peersFrom[TR_PEER_FROM_CACHE];
    13161316}
    13171317
    1318 - (int) totalPeersPex
     1318- (NSInteger) totalPeersPex
    13191319{
    13201320    return fStat->peersFrom[TR_PEER_FROM_PEX];
    13211321}
    13221322
    1323 - (int) totalPeersKnown
     1323- (NSInteger) totalPeersKnown
    13241324{
    13251325    return fStat->peersKnown;
    13261326}
    13271327
    1328 - (int) peersSendingToUs
     1328- (NSInteger) peersSendingToUs
    13291329{
    13301330    return fStat->peersSendingToUs;
    13311331}
    13321332
    1333 - (int) peersGettingFromUs
     1333- (NSInteger) peersGettingFromUs
    13341334{
    13351335    return fStat->peersGettingFromUs;
    13361336}
    13371337
    1338 - (float) downloadRate
     1338- (CGFloat) downloadRate
    13391339{
    13401340    return fStat->rateDownload;
    13411341}
    13421342
    1343 - (float) uploadRate
     1343- (CGFloat) uploadRate
    13441344{
    13451345    return fStat->rateUpload;
    13461346}
    13471347
    1348 - (float) totalRate
     1348- (CGFloat) totalRate
    13491349{
    13501350    return [self downloadRate] + [self uploadRate];
     
    13811381}
    13821382
    1383 - (float) swarmSpeed
     1383- (CGFloat) swarmSpeed
    13841384{
    13851385    return fStat->swarmSpeed;
    13861386}
    13871387
    1388 - (int) orderValue
     1388- (NSInteger) orderValue
    13891389{
    13901390    return fOrderValue;
    13911391}
    13921392
    1393 - (void) setOrderValue: (int) orderValue
     1393- (void) setOrderValue: (NSInteger) orderValue
    13941394{
    13951395    fOrderValue = orderValue;
    13961396}
    13971397
    1398 - (int) groupValue
     1398- (NSInteger) groupValue
    13991399{
    14001400    return fGroupValue;
    14011401}
    14021402
    1403 - (void) setGroupValue: (int) goupValue
     1403- (void) setGroupValue: (NSInteger) goupValue
    14041404{
    14051405    fGroupValue = goupValue;
    14061406}
    14071407
    1408 - (int) groupOrderValue
     1408- (NSInteger) groupOrderValue
    14091409{
    14101410    return [[GroupsController groups] rowValueForIndex: fGroupValue];
     
    14221422}
    14231423
    1424 - (int) fileCount
     1424- (NSInteger) fileCount
    14251425{
    14261426    return fInfo->fileCount;
     
    14351435}
    14361436
    1437 - (float) fileProgress: (FileListNode *) node
     1437- (CGFloat) fileProgress: (FileListNode *) node
    14381438{
    14391439    if ([self isComplete])
     
    14491449   
    14501450    uint64_t have = 0;
    1451     for (int index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
     1451    for (NSInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
    14521452        have += fFileStat[index].bytesCompleted;
    14531453   
    14541454    NSAssert([node size], @"director in torrent file has size 0");
    1455     return (float)have / [node size];
    1456 }
    1457 
    1458 - (BOOL) canChangeDownloadCheckForFile: (int) index
     1455    return (CGFloat)have / [node size];
     1456}
     1457
     1458- (BOOL) canChangeDownloadCheckForFile: (NSInteger) index
    14591459{
    14601460    if (!fFileStat)
     
    14721472        [self updateFileStat];
    14731473   
    1474     for (int index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
     1474    for (NSInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
    14751475        if (fFileStat[index].progress < 1.0)
    14761476            return YES;
     
    14781478}
    14791479
    1480 - (int) checkForFiles: (NSIndexSet *) indexSet
     1480- (NSInteger) checkForFiles: (NSIndexSet *) indexSet
    14811481{
    14821482    BOOL onState = NO, offState = NO;
    1483     for (int index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
     1483    for (NSInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
    14841484    {
    14851485        if (tr_torrentGetFileDL(fHandle, index) || ![self canChangeDownloadCheckForFile: index])
     
    14941494}
    14951495
    1496 - (void) setFileCheckState: (int) state forIndexes: (NSIndexSet *) indexSet
     1496- (void) setFileCheckState: (NSInteger) state forIndexes: (NSIndexSet *) indexSet
    14971497{
    14981498    NSUInteger count = [indexSet count];
     
    15081508}
    15091509
    1510 - (void) setFilePriority: (int) priority forIndexes: (NSIndexSet *) indexSet
     1510- (void) setFilePriority: (NSInteger) priority forIndexes: (NSIndexSet *) indexSet
    15111511{
    15121512    const NSUInteger count = [indexSet count];
     
    15191519}
    15201520
    1521 - (BOOL) hasFilePriority: (int) priority forIndexes: (NSIndexSet *) indexSet
    1522 {
    1523     for (int index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
     1521- (BOOL) hasFilePriority: (NSInteger) priority forIndexes: (NSIndexSet *) indexSet
     1522{
     1523    for (NSInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
    15241524        if (priority == tr_torrentGetFilePriority(fHandle, index) && [self canChangeDownloadCheckForFile: index])
    15251525            return YES;
     
    15321532    NSMutableSet * priorities = [NSMutableSet setWithCapacity: 3];
    15331533   
    1534     for (int index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
     1534    for (NSInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
    15351535    {
    15361536        if (![self canChangeDownloadCheckForFile: index])
    15371537            continue;
    15381538       
    1539         int priority = tr_torrentGetFilePriority(fHandle, index);
     1539        NSInteger priority = tr_torrentGetFilePriority(fHandle, index);
    15401540        if (priority == TR_PRI_LOW)
    15411541        {
     
    15881588}
    15891589
    1590 - (int) stalledMinutes
     1590- (NSInteger) stalledMinutes
    15911591{
    15921592    time_t start = fStat->startDate;
     
    17431743    if ([self isFolder])
    17441744    {
    1745         int count = [self fileCount];
     1745        NSInteger count = [self fileCount];
    17461746        NSMutableArray * fileList = [[NSMutableArray alloc] initWithCapacity: count];
    17471747       
    1748         for (int i = 0; i < count; i++)
     1748        for (NSInteger i = 0; i < count; i++)
    17491749        {
    17501750            tr_file * file = &fInfo->files[i];
     
    17951795}
    17961796
    1797 - (void) insertPath: (NSMutableArray *) components forParent: (FileListNode *) parent fileSize: (uint64_t) size index: (int) index
     1797- (void) insertPath: (NSMutableArray *) components forParent: (FileListNode *) parent fileSize: (uint64_t) size index: (NSInteger) index
    17981798{
    17991799    NSString * name = [components objectAtIndex: 0];
     
    19311931}
    19321932
    1933 - (NSString *) etaString: (int) eta
     1933- (NSString *) etaString: (NSInteger) eta
    19341934{
    19351935    switch (eta)
     
    19471947{
    19481948    //get count
    1949     int count = 0;
     1949    NSInteger count = 0;
    19501950    NSEnumerator * enumerator = [trackers objectEnumerator];
    19511951    id object;
     
    19561956    //recreate the tracker structure
    19571957    tr_tracker_info * trackerStructs = tr_new(tr_tracker_info, count);
    1958     int tier = 0;
    1959     int i = 0;
     1958    NSInteger tier = 0, i = 0;
    19601959    enumerator = [trackers objectEnumerator];
    19611960    while ((object = [enumerator nextObject]))
Note: See TracChangeset for help on using the changeset viewer.