From 995d754baf011c270e18c57eaac779fda5de616d Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Tue, 18 Oct 2011 02:30:22 +0000 Subject: [PATCH] Silence some new warnings with LLVM 3.0/Xcode 4.2 --- Transmission.xcodeproj/project.pbxproj | 2 +- macosx/Controller.m | 14 +++++++------- macosx/FileOutlineController.m | 2 +- macosx/InfoTrackersViewController.m | 3 ++- macosx/TorrentCell.m | 2 +- macosx/TorrentTableView.m | 2 +- macosx/TrackerCell.m | 2 +- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Transmission.xcodeproj/project.pbxproj b/Transmission.xcodeproj/project.pbxproj index 5995481a6..d14c89654 100644 --- a/Transmission.xcodeproj/project.pbxproj +++ b/Transmission.xcodeproj/project.pbxproj @@ -1999,7 +1999,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 0410; + LastUpgradeCheck = 0420; ORGANIZATIONNAME = "The Transmission Project"; }; buildConfigurationList = 4DF0C59A089918A300DD8943 /* Build configuration list for PBXProject "Transmission" */; diff --git a/macosx/Controller.m b/macosx/Controller.m index 2f234cb6f..f2a3ab5f5 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1255,7 +1255,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy const NSInteger selected = [torrents count]; if (selected == 1) { - NSString * torrentName = [[torrents objectAtIndex: 0] name]; + NSString * torrentName = [(Torrent *)[torrents objectAtIndex: 0] name]; if (deleteData) title = [NSString stringWithFormat: @@ -1379,7 +1379,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy NSString * message, * info; if ([torrents count] == 1) { - NSString * torrentName = [[torrents objectAtIndex: 0] name]; + NSString * torrentName = [(Torrent *)[torrents objectAtIndex: 0] name]; message = [NSString stringWithFormat: NSLocalizedString(@"Are you sure you want to remove \"%@\" from the transfer list?", "Remove completed confirm panel -> title"), torrentName]; @@ -1435,7 +1435,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy NSInteger count = [torrents count]; if (count == 1) [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the new folder for \"%@\".", - "Move torrent -> select destination folder"), [[torrents objectAtIndex: 0] name]]]; + "Move torrent -> select destination folder"), [(Torrent *)[torrents objectAtIndex: 0] name]]]; else [panel setMessage: [NSString stringWithFormat: NSLocalizedString(@"Select the new folder for %d data files.", "Move torrent -> select destination folder"), count]]; @@ -1782,7 +1782,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy - (void) setSort: (id) sender { NSString * sortType; - switch ([sender tag]) + switch ([(NSMenuItem *)sender tag]) { case SORT_ORDER_TAG: sortType = SORT_ORDER; @@ -1810,7 +1810,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy sortType = SORT_SIZE; break; default: - NSAssert1(NO, @"Unknown sort tag received: %d", [sender tag]); + NSAssert1(NO, @"Unknown sort tag received: %d", [(NSMenuItem *)sender tag]); return; } @@ -1832,7 +1832,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy - (void) setSortReverse: (id) sender { - const BOOL setReverse = [sender tag] == SORT_DESC_TAG; + const BOOL setReverse = [(NSMenuItem *)sender tag] == SORT_DESC_TAG; if (setReverse != [fDefaults boolForKey: @"SortReverse"]) { [fDefaults setBool: setReverse forKey: @"SortReverse"]; @@ -2235,7 +2235,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy { [fTableView removeCollapsedGroup: [torrent groupValue]]; //remove old collapsed group - [torrent setGroupValue: [sender tag]]; + [torrent setGroupValue: [(NSMenuItem *)sender tag]]; } [self applyFilter]; diff --git a/macosx/FileOutlineController.m b/macosx/FileOutlineController.m index 51f346e7d..ed33bfd04 100644 --- a/macosx/FileOutlineController.m +++ b/macosx/FileOutlineController.m @@ -333,7 +333,7 @@ typedef enum { NSString * path = [fTorrent fileLocation: item]; if (!path) - path = [[item path] stringByAppendingPathComponent: [item name]]; + path = [[(FileListNode *)item path] stringByAppendingPathComponent: [(FileListNode *)item name]]; return path; } else if ([ident isEqualToString: @"Check"]) diff --git a/macosx/InfoTrackersViewController.m b/macosx/InfoTrackersViewController.m index fa5e59433..56a6f5ec3 100644 --- a/macosx/InfoTrackersViewController.m +++ b/macosx/InfoTrackersViewController.m @@ -184,8 +184,9 @@ return [tableView rowHeight]; } -- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex +- (BOOL) tableView: (NSTableView *) tableView shouldEditTableColumn: (NSTableColumn *) tableColumn row: (NSInteger) row { + //don't allow tier row to be edited by double-click return NO; } diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index 5b55a5899..56b5e951d 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -784,7 +784,7 @@ - (NSAttributedString *) attributedTitle { - NSString * title = [[self representedObject] name]; + NSString * title = [(Torrent *)[self representedObject] name]; return [[[NSAttributedString alloc] initWithString: title attributes: fTitleAttributes] autorelease]; } diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index a596d20a9..a7596fbad 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -202,7 +202,7 @@ - (NSString *) outlineView: (NSOutlineView *) outlineView typeSelectStringForTableColumn: (NSTableColumn *) tableColumn item: (id) item { - return [item isKindOfClass: [Torrent class]] ? [item name] + return [item isKindOfClass: [Torrent class]] ? [(Torrent *)item name] : [[self preparedCellAtColumn: [self columnWithIdentifier: @"Group"] row: [self rowForItem: item]] stringValue]; } diff --git a/macosx/TrackerCell.m b/macosx/TrackerCell.m index b76a24dd1..b499a5d19 100644 --- a/macosx/TrackerCell.m +++ b/macosx/TrackerCell.m @@ -64,7 +64,7 @@ NSMutableSet * fTrackerIconLoading; + (void) initialize { - fTrackerIconCache = [[NSMutableDictionary alloc] init]; + fTrackerIconCache = [[NSCache alloc] init]; fTrackerIconLoading = [[NSMutableSet alloc] init]; }