diff --git a/macosx/Badger.h b/macosx/Badger.h index e87d332a1..af2c9a5ea 100644 --- a/macosx/Badger.h +++ b/macosx/Badger.h @@ -29,12 +29,12 @@ { tr_handle * fLib; - NSInteger fCompleted; + NSUInteger fCompleted; //tiger-only fields NSImage * fDockIcon, * fBadge; NSDictionary * fAttributes; - NSInteger fCompletedBadged; + NSUInteger fCompletedBadged; BOOL fSpeedBadge, fQuittingTiger; } diff --git a/macosx/CreatorWindowController.m b/macosx/CreatorWindowController.m index 69a7a57a2..c716edcce 100644 --- a/macosx/CreatorWindowController.m +++ b/macosx/CreatorWindowController.m @@ -34,12 +34,12 @@ + (NSString *) chooseFile; - (void) updateEnableOpenCheckForTrackers; -- (void) locationSheetClosed: (NSSavePanel *) openPanel returnCode: (int) code contextInfo: (void *) info; +- (void) locationSheetClosed: (NSSavePanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) info; -- (void) createBlankAddressAlertDidEnd: (NSAlert *) alert returnCode: (int) returnCode contextInfo: (void *) contextInfo; +- (void) createBlankAddressAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo; - (void) createReal; - (void) checkProgress; -- (void) failureSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info; +- (void) failureSheetClosed: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (void *) info; @end @@ -299,7 +299,7 @@ [fTrackers addObject: @""]; [fTrackerTable reloadData]; - int row = [fTrackers count] - 1; + NSInteger row = [fTrackers count] - 1; [fTrackerTable selectRow: row byExtendingSelection: NO]; [fTrackerTable editColumn: 0 row: row withEvent: nil select: YES]; } @@ -363,7 +363,7 @@ [fOpenCheck setState: (fOpenTorrent && hasTracker) ? NSOnState : NSOffState]; } -- (void) locationSheetClosed: (NSSavePanel *) panel returnCode: (int) code contextInfo: (void *) info +- (void) locationSheetClosed: (NSSavePanel *) panel returnCode: (NSInteger) code contextInfo: (void *) info { if (code == NSOKButton) { @@ -375,7 +375,7 @@ } } -- (void) createBlankAddressAlertDidEnd: (NSAlert *) alert returnCode: (int) returnCode contextInfo: (void *) contextInfo +- (void) createBlankAddressAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo { if (([NSApp isOnLeopardOrBetter] ? [[alert suppressionButton] state] == NSOnState : returnCode == NSAlertThirdButtonReturn)) [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningCreatorBlankAddress"]; @@ -392,7 +392,7 @@ if ([[NSFileManager defaultManager] fileExistsAtPath: fLocation]) { NSArray * pathComponents = [fLocation pathComponents]; - int count = [pathComponents count]; + NSInteger count = [pathComponents count]; NSAlert * alert = [[[NSAlert alloc] init] autorelease]; [alert addButtonWithTitle: NSLocalizedString(@"OK", "Create torrent -> file already exists warning -> button")]; @@ -505,7 +505,7 @@ } } -- (void) failureSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info +- (void) failureSheetClosed: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (void *) info { [[alert window] orderOut: nil]; [[self window] close]; diff --git a/macosx/FilterButton.h b/macosx/FilterButton.h index a7f144d81..d8f696673 100644 --- a/macosx/FilterButton.h +++ b/macosx/FilterButton.h @@ -26,9 +26,9 @@ @interface FilterButton : NSButton { - NSInteger fCount; + NSUInteger fCount; } -- (void) setCount: (NSInteger) count; +- (void) setCount: (NSUInteger) count; @end diff --git a/macosx/FilterButton.m b/macosx/FilterButton.m index c1b448fe6..44379d59a 100644 --- a/macosx/FilterButton.m +++ b/macosx/FilterButton.m @@ -30,12 +30,12 @@ { if ((self = [super initWithCoder: coder])) { - fCount = -1; + fCount = NSNotFound; } return self; } -- (void) setCount: (NSInteger) count +- (void) setCount: (NSUInteger) count { if (count == fCount) return; diff --git a/macosx/NSBezierPathAdditions.h b/macosx/NSBezierPathAdditions.h index 0eddba07d..57d0d1d0c 100644 --- a/macosx/NSBezierPathAdditions.h +++ b/macosx/NSBezierPathAdditions.h @@ -26,6 +26,6 @@ @interface NSBezierPath (NSBezierPathAdditions) -+ (NSBezierPath *) bezierPathWithRoundedRect: (NSRect) rect radius: (float) radius; ++ (NSBezierPath *) bezierPathWithRoundedRect: (NSRect) rect radius: (CGFloat) radius; @end diff --git a/macosx/NSBezierPathAdditions.m b/macosx/NSBezierPathAdditions.m index 12798b499..0d698374e 100644 --- a/macosx/NSBezierPathAdditions.m +++ b/macosx/NSBezierPathAdditions.m @@ -27,17 +27,17 @@ @implementation NSBezierPath (NSBezierPathAdditions) -+ (NSBezierPath *) bezierPathWithRoundedRect: (NSRect) rect radius: (float) radius ++ (NSBezierPath *) bezierPathWithRoundedRect: (NSRect) rect radius: (CGFloat) radius { if ([NSApp isOnLeopardOrBetter]) return [self bezierPathWithRoundedRect: rect xRadius: radius yRadius: radius]; - float minX = NSMinX(rect), - minY = NSMinY(rect), - maxX = NSMaxX(rect), - maxY = NSMaxY(rect), - midX = NSMidX(rect), - midY = NSMidY(rect); + CGFloat minX = NSMinX(rect), + minY = NSMinY(rect), + maxX = NSMaxX(rect), + maxY = NSMaxY(rect), + midX = NSMidX(rect), + midY = NSMidY(rect); NSBezierPath * bp = [NSBezierPath bezierPath]; [bp moveToPoint: NSMakePoint(maxX, midY)]; diff --git a/macosx/NSStringAdditions.h b/macosx/NSStringAdditions.h index 39a925025..c61abca36 100644 --- a/macosx/NSStringAdditions.h +++ b/macosx/NSStringAdditions.h @@ -36,7 +36,7 @@ + (NSString *) stringForRatio: (CGFloat) ratio; + (NSString *) timeString: (uint64_t) seconds showSeconds: (BOOL) showSeconds; -+ (NSString *) timeString: (NSUInteger) seconds showSeconds: (BOOL) showSeconds maxFields: (NSUInteger) max; ++ (NSString *) timeString: (uint64_t) seconds showSeconds: (BOOL) showSeconds maxFields: (NSUInteger) max; - (NSComparisonResult) compareFinder: (NSString *) string; //how the Finder compares strings - (NSComparisonResult) compareNumeric: (NSString *) string; //simple compare method for strings with numbers (works for IP addresses) diff --git a/macosx/NSStringAdditions.m b/macosx/NSStringAdditions.m index 37b40a505..6dc944ce1 100644 --- a/macosx/NSStringAdditions.m +++ b/macosx/NSStringAdditions.m @@ -112,14 +112,14 @@ return [NSString timeString: seconds showSeconds: showSeconds maxFields: NSUIntegerMax]; } -+ (NSString *) timeString: (NSUInteger) seconds showSeconds: (BOOL) showSeconds maxFields: (NSUInteger) max ++ (NSString *) timeString: (uint64_t) seconds showSeconds: (BOOL) showSeconds maxFields: (NSUInteger) max { NSMutableArray * timeArray = [NSMutableArray arrayWithCapacity: MIN(max, 4)]; NSUInteger remaining = seconds; if (max > 0 && seconds >= (24 * 60 * 60)) { - NSInteger days = remaining / (24 * 60 * 60); + NSUInteger days = remaining / (24 * 60 * 60); if (days == 1) [timeArray addObject: NSLocalizedString(@"1 day", "time string")]; else diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index 967d89bc3..8d5838b4b 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -393,7 +393,7 @@ groupRect.size.height--; groupRect.origin.y--; } - CGFloat radius = minimal ? 3.0f : 6.0f; + const CGFloat radius = minimal ? 3.0f : 6.0f; NSColor * groupColor = [[GroupsController groups] colorForIndex: groupValue], * darkGroupColor = [groupColor blendedColorWithFraction: 0.2f ofColor: [NSColor whiteColor]];