Changeset 6889


Ignore:
Timestamp:
Oct 12, 2008, 10:17:27 PM (13 years ago)
Author:
livings124
Message:

more changes in counter scope

Location:
trunk/macosx
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/CreatorWindowController.m

    r6738 r6889  
    126126       
    127127        //remove potentially invalid addresses
    128         NSInteger i;
    129         for (i = [fTrackers count]-1; i >= 0; i--)
     128        for (NSInteger i = [fTrackers count]-1; i >= 0; i--)
    130129        {
    131130            if (!tr_httpIsValidURL([[fTrackers objectAtIndex: i] UTF8String]))
     
    414413    tr_tracker_info * trackerInfo = tr_new0(tr_tracker_info, [fTrackers count]);
    415414   
    416     NSUInteger i;
    417     for (i = 0; i < [fTrackers count]; i++)
     415    for (NSUInteger i = 0; i < [fTrackers count]; i++)
    418416        trackerInfo[i].announce = (char *)[[fTrackers objectAtIndex: i] UTF8String];
    419417   
  • trunk/macosx/GroupsController.m

    r6273 r6889  
    116116    if (index != -1)
    117117    {
    118         int i;
    119         for (i = 0; i < [fGroups count]; i++)
     118        for (NSInteger i = 0; i < [fGroups count]; i++)
    120119            if (index == [[[fGroups objectAtIndex: i] objectForKey: @"Index"] intValue])
    121120                return i;
     
    171170{
    172171    //find the lowest index
    173     int index;
     172    NSInteger index;
    174173    for (index = 0; index < [fGroups count]; index++)
    175174    {
     
    198197{
    199198    NSMutableIndexSet * indexes = [NSMutableIndexSet indexSet];
    200     int index;
    201     for (index = [rowIndexes firstIndex]; index != NSNotFound; index = [rowIndexes indexGreaterThanIndex: index])
     199    for (NSInteger index = [rowIndexes firstIndex]; index != NSNotFound; index = [rowIndexes indexGreaterThanIndex: index])
    202200        [indexes addIndex: [[[fGroups objectAtIndex: index] objectForKey: @"Index"] intValue]];
    203201   
     
    219217   
    220218    //determine where to move them
    221     int i, originalRow = newRow;
    222     for (i = [indexes firstIndex]; i < originalRow && i != NSNotFound; i = [indexes indexGreaterThanIndex: i])
     219    for (NSInteger i = [indexes firstIndex], startRow = newRow; i < startRow && i != NSNotFound; i = [indexes indexGreaterThanIndex: i])
    223220        newRow--;
    224221   
     
    228225   
    229226    //insert objects at new location
    230     for (i = 0; i < [movingGroups count]; i++)
     227    for (NSInteger i = 0; i < [movingGroups count]; i++)
    231228        [fGroups insertObject: [movingGroups objectAtIndex: i] atIndex: newRow + i];
    232229   
  • trunk/macosx/NSMenuAdditions.m

    r4793 r6889  
    3232   
    3333    NSMenuItem * item;
    34     unsigned int i;
    35     for (i = [indexes lastIndex]; i != NSNotFound; i = [indexes indexLessThanIndex: i])
     34    for (NSUInteger i = [indexes lastIndex]; i != NSNotFound; i = [indexes indexLessThanIndex: i])
    3635    {
    3736        item = [[menu itemAtIndex: i] retain];
  • trunk/macosx/TorrentCell.m

    r6252 r6889  
    684684    NSMutableIndexSet * finishedIndexes = [NSMutableIndexSet indexSet];
    685685   
    686     int i;
    687     for (i = 0; i < pieceCount; i++)
     686    for (NSInteger i = 0; i < pieceCount; i++)
    688687    {
    689688        NSColor * pieceColor;
  • trunk/macosx/TorrentTableView.m

    r6289 r6889  
    7272           
    7373            //remove all unnecessary columns
    74             int i;
    75             for (i = [[self tableColumns] count]-1; i >= 0; i--)
     74            for (NSInteger i = [[self tableColumns] count]-1; i >= 0; i--)
    7675            {
    7776                NSTableColumn * column = [[self tableColumns] objectAtIndex: i];
     
    256255   
    257256    NSPoint mouseLocation = [self convertPoint: [[self window] convertScreenToBase: [NSEvent mouseLocation]] fromView: nil];
    258    
    259     NSUInteger row;
    260     for (row = rows.location; row < NSMaxRange(rows); row++)
     257    for (NSUInteger row = rows.location; row < NSMaxRange(rows); row++)
    261258    {
    262259        if (![[self itemAtRow: row] isKindOfClass: [Torrent class]])
     
    450447        else
    451448        {
    452             int i, group = [item groupIndex];
    453             for (i = 0; i < [self numberOfRows]; i++)
     449            int group = [item groupIndex];
     450            for (NSInteger i = 0; i < [self numberOfRows]; i++)
    454451            {
    455452                if ([indexSet containsIndex: i])
     
    474471    NSMutableArray * values = [NSMutableArray arrayWithCapacity: [selectedIndexes count]];
    475472   
    476     NSUInteger i;
    477     for (i = [selectedIndexes firstIndex]; i != NSNotFound; i = [selectedIndexes indexGreaterThanIndex: i])
     473    for (NSUInteger i = [selectedIndexes firstIndex]; i != NSNotFound; i = [selectedIndexes indexGreaterThanIndex: i])
    478474        [values addObject: [self itemAtRow: i]];
    479475   
     
    486482    NSMutableArray * torrents = [NSMutableArray arrayWithCapacity: [selectedIndexes count]]; //take a shot at guessing capacity
    487483   
    488     NSUInteger i;
    489     for (i = [selectedIndexes firstIndex]; i != NSNotFound; i = [selectedIndexes indexGreaterThanIndex: i])
     484    for (NSUInteger i = [selectedIndexes firstIndex]; i != NSNotFound; i = [selectedIndexes indexGreaterThanIndex: i])
    490485    {
    491486        id item = [self itemAtRow: i];
     
    609604    [NSMenu popUpContextMenu: fActionMenu withEvent: newEvent forView: self];
    610605   
    611     NSInteger i;
    612     for (i = [fActionMenu numberOfItems]-1; i >= numberOfNonFileItems; i--)
     606    for (NSInteger i = [fActionMenu numberOfItems]-1; i >= numberOfNonFileItems; i--)
    613607        [fActionMenu removeItemAtIndex: i];
    614608   
     
    630624            const int speedLimitActionValue[] = { 0, 5, 10, 20, 30, 40, 50, 75, 100, 150, 200, 250, 500, 750, -1 };
    631625           
    632             int i;
    633             for (i = 0; speedLimitActionValue[i] != -1; i++)
     626            for (NSInteger i = 0; speedLimitActionValue[i] != -1; i++)
    634627            {
    635628                item = [[NSMenuItem alloc] initWithTitle: [NSString stringWithFormat: NSLocalizedString(@"%d KB/s",
     
    664657            const float ratioLimitActionValue[] = { 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, -1.0 };
    665658           
    666             int i;
    667             for (i = 0; ratioLimitActionValue[i] != -1.0; i++)
     659            for (NSInteger i = 0; ratioLimitActionValue[i] != -1.0; i++)
    668660            {
    669661                item = [[NSMenuItem alloc] initWithTitle: [NSString localizedStringWithFormat: @"%.2f", ratioLimitActionValue[i]]
     
    709701    NSRange rows = [self rowsInRect: visibleRect];
    710702    BOOL start = YES;
    711     int i;
    712703   
    713704    if (rows.length > 0)
     
    716707        if ([[self itemAtRow: rows.location] isKindOfClass: [Torrent class]])
    717708        {
    718             for (i = rows.location-1; i>=0; i--)
     709            for (NSInteger i = rows.location-1; i>=0; i--)
    719710            {
    720711                if (![[self itemAtRow: i] isKindOfClass: [Torrent class]])
     
    729720        }
    730721       
     722        NSInteger i;
    731723        for (i = rows.location; i < NSMaxRange(rows); i++)
    732724        {
     
    753745    visibleRect.size.height = height;
    754746   
    755     for (i=0; i<numberOfRects; i++)
     747    for (NSInteger i=0; i<numberOfRects; i++)
    756748    {
    757749        if (!start)
     
    848840   
    849841    NSMutableArray * progressMarks = [NSMutableArray arrayWithCapacity: 16];
    850     NSAnimationProgress i;
    851     for (i = 0.0625; i <= 1.0; i += 0.0625)
     842    for (NSAnimationProgress i = 0.0625; i <= 1.0; i += 0.0625)
    852843        [progressMarks addObject: [NSNumber numberWithFloat: i]];
    853844   
  • trunk/macosx/TrackerTableView.m

    r6009 r6889  
    4848    NSRange rows = [self rowsInRect: visibleRect];
    4949    BOOL start = YES;
    50     int i;
    5150   
    5251    if (rows.length > 0)
     
    5958            if (![[fTrackers objectAtIndex: rows.location] isKindOfClass: [NSNumber class]])
    6059            {
    61                 for (i = rows.location-1; i>=0; i--)
     60                for (NSInteger i = rows.location-1; i>=0; i--)
    6261                {
    6362                    if ([[fTrackers objectAtIndex: i] isKindOfClass: [NSNumber class]])
     
    7372        }
    7473       
     74        NSInteger i;
    7575        for (i = rows.location; i < NSMaxRange(rows); i++)
    7676        {
     
    9797    visibleRect.size.height = height;
    9898   
    99     for (i=0; i<numberOfRects; i++)
     99    for (NSInteger i=0; i<numberOfRects; i++)
    100100    {
    101101        if (!start)
Note: See TracChangeset for help on using the changeset viewer.