From 64f6b2cb5f12f3336491e9a80479ea78bc30b3f2 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 9 Jan 2011 18:45:18 +0000 Subject: [PATCH] silence a warning --- macosx/NSStringAdditions.m | 3 ++- macosx/Torrent.m | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/macosx/NSStringAdditions.m b/macosx/NSStringAdditions.m index 546116608..6f68b3755 100644 --- a/macosx/NSStringAdditions.m +++ b/macosx/NSStringAdditions.m @@ -211,12 +211,13 @@ } //match Finder's behavior - NSNumberFormatter * numberFormatter = [[[NSNumberFormatter alloc] init] autorelease]; + NSNumberFormatter * numberFormatter = [[NSNumberFormatter alloc] init]; [numberFormatter setNumberStyle: NSNumberFormatterDecimalStyle]; [numberFormatter setMinimumFractionDigits: 0]; [numberFormatter setMaximumFractionDigits: decimals]; NSString * fileSizeString = [numberFormatter stringFromNumber: [NSNumber numberWithFloat: convertedSize]]; + [numberFormatter release]; if (!notAllowedUnit || ![unit isEqualToString: notAllowedUnit]) fileSizeString = [fileSizeString stringByAppendingFormat: @" %@", unit]; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index d8ccfe3af..30202a5dc 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -1203,6 +1203,10 @@ int trashDataFile(const char * filename) case TR_STATUS_SEED: return NSLocalizedString(@"Seeding", "Torrent -> status string"); + + default: + NSAssert1(NO, @"Unknown activity %d for statis string", fStat->activity); + return nil; } }