get rid of a warning

This commit is contained in:
Mitchell Livingston 2007-06-30 21:53:45 +00:00
parent 3b1597789e
commit f62addb8aa
2 changed files with 30 additions and 29 deletions

View File

@ -35,7 +35,7 @@
{ {
tr_handle_t * fLib; tr_handle_t * fLib;
tr_torrent_t * fHandle; tr_torrent_t * fHandle;
tr_info_t * fInfo; const tr_info_t * fInfo;
tr_stat_t * fStat; tr_stat_t * fStat;
int fID; int fID;
@ -222,7 +222,7 @@
- (NSNumber *) ratioSortKey; - (NSNumber *) ratioSortKey;
- (int) torrentID; - (int) torrentID;
- (tr_info_t *) torrentInfo; - (const tr_info_t *) torrentInfo;
- (tr_stat_t *) torrentStat; - (tr_stat_t *) torrentStat;
@end @end

View File

@ -818,13 +818,13 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
if ([self allDownloaded] || ![fDefaults boolForKey: @"WarningRemainingSpace"]) if ([self allDownloaded] || ![fDefaults boolForKey: @"WarningRemainingSpace"])
return YES; return YES;
NSString * volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: [self downloadFolder]] NSString * volumeName;
objectAtIndex: 0]; if ((volumeName = [[[NSFileManager defaultManager] componentsToDisplayForPath: [self downloadFolder]] objectAtIndex: 0]))
{
NSDictionary * fsAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: [self downloadFolder]]; NSDictionary * fsAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath: [self downloadFolder]];
uint64_t remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue], uint64_t remainingSpace = [[fsAttributes objectForKey: NSFileSystemFreeSize] unsignedLongLongValue];
torrentRemaining = fStat->left;
if (volumeName && remainingSpace <= torrentRemaining) if (remainingSpace <= fStat->left)
{ {
NSAlert * alert = [[NSAlert alloc] init]; NSAlert * alert = [[NSAlert alloc] init];
[alert setMessageText: [NSString stringWithFormat: [alert setMessageText: [NSString stringWithFormat:
@ -845,6 +845,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
return result != NSAlertFirstButtonReturn; return result != NSAlertFirstButtonReturn;
} }
}
return YES; return YES;
} }
@ -1443,7 +1444,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
return fID; return fID;
} }
- (tr_info_t *) torrentInfo - (const tr_info_t *) torrentInfo
{ {
return fInfo; return fInfo;
} }