more trivial type changes

This commit is contained in:
Mitchell Livingston
2008-10-28 00:08:49 +00:00
parent 8a5697d1a0
commit 6bc269d2bc
11 changed files with 63 additions and 63 deletions

View File

@@ -43,7 +43,7 @@
NSString * fDestination; NSString * fDestination;
BOOL fDeleteTorrent, fDeleteEnable; BOOL fDeleteTorrent, fDeleteEnable;
int fGroupValue; NSInteger fGroupValue;
NSTimer * fTimer; NSTimer * fTimer;
} }

View File

@@ -30,18 +30,18 @@
#import "NSApplicationAdditions.h" #import "NSApplicationAdditions.h"
#import "ExpandedPathToIconTransformer.h" #import "ExpandedPathToIconTransformer.h"
#define UPDATE_SECONDS 1.0 #define UPDATE_SECONDS 1.0f
@interface AddWindowController (Private) @interface AddWindowController (Private)
- (void) confirmAdd; - (void) confirmAdd;
- (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) contextInfo; - (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) contextInfo;
- (void) setGroupsMenu; - (void) setGroupsMenu;
- (void) changeGroupValue: (id) sender; - (void) changeGroupValue: (id) sender;
- (void) sameNameAlertDidEnd: (NSAlert *) alert returnCode: (int) returnCode contextInfo: (void *) contextInfo; - (void) sameNameAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo;
@end @end
@@ -210,7 +210,7 @@
if ([fTorrent isFolder]) if ([fTorrent isFolder])
{ {
NSString * fileString; NSString * fileString;
int count = [fTorrent fileCount]; NSInteger count = [fTorrent fileCount];
if (count != 1) if (count != 1)
fileString = [NSString stringWithFormat: NSLocalizedString(@"%d files", "Add torrent -> info"), count]; fileString = [NSString stringWithFormat: NSLocalizedString(@"%d files", "Add torrent -> info"), count];
else else
@@ -262,7 +262,7 @@
[fController askOpenConfirmed: self add: YES]; //ensure last, since it releases this controller [fController askOpenConfirmed: self add: YES]; //ensure last, since it releases this controller
} }
- (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (int) code contextInfo: (void *) contextInfo - (void) folderChoiceClosed: (NSOpenPanel *) openPanel returnCode: (NSInteger) code contextInfo: (void *) contextInfo
{ {
if (code == NSOKButton) if (code == NSOKButton)
{ {
@@ -302,7 +302,7 @@
fGroupValue = [sender tag]; fGroupValue = [sender tag];
} }
- (void) sameNameAlertDidEnd: (NSAlert *) alert returnCode: (int) returnCode contextInfo: (void *) contextInfo - (void) sameNameAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo
{ {
if (([NSApp isOnLeopardOrBetter] ? [[alert suppressionButton] state] == NSOnState : returnCode == NSAlertThirdButtonReturn)) if (([NSApp isOnLeopardOrBetter] ? [[alert suppressionButton] state] == NSOnState : returnCode == NSAlertThirdButtonReturn))
[[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"]; [[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"];

View File

@@ -31,7 +31,7 @@
- (id) initWithPrefsController: (PrefsController *) prefsController; - (id) initWithPrefsController: (PrefsController *) prefsController;
- (void) startDownload; - (void) startDownload;
- (void) failureSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info; - (void) failureSheetClosed: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (void *) info;
@end @end
@@ -50,7 +50,7 @@
CGFloat oldWidth = [fButton frame].size.width; CGFloat oldWidth = [fButton frame].size.width;
[fButton sizeToFit]; [fButton sizeToFit];
NSRect buttonFrame = [fButton frame]; NSRect buttonFrame = [fButton frame];
buttonFrame.size.width += 12.0; //sizeToFit sizes a bit too small buttonFrame.size.width += 12.0f; //sizeToFit sizes a bit too small
buttonFrame.origin.x -= buttonFrame.size.width - oldWidth; buttonFrame.origin.x -= buttonFrame.size.width - oldWidth;
[fButton setFrame: buttonFrame]; [fButton setFrame: buttonFrame];
@@ -146,7 +146,7 @@
[downloader setViewController: self]; [downloader setViewController: self];
} }
- (void) failureSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info - (void) failureSheetClosed: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (void *) info
{ {
[[alert window] orderOut: self]; [[alert window] orderOut: self];
[self release]; [self release];

View File

@@ -32,29 +32,29 @@
color1.red = redComponent; color1.red = redComponent;
color1.green = greenComponent; color1.green = greenComponent;
color1.blue = blueComponent; color1.blue = blueComponent;
color1.alpha = 1.0; color1.alpha = 1.0f;
color1.position = 0.0; color1.position = 0.0f;
CTGradientElement color2; CTGradientElement color2;
color2.red = redComponent * 0.95; color2.red = redComponent * 0.95f;
color2.green = greenComponent * 0.95; color2.green = greenComponent * 0.95f;
color2.blue = blueComponent * 0.95; color2.blue = blueComponent * 0.95f;
color2.alpha = 1.0; color2.alpha = 1.0f;
color2.position = 0.5; color2.position = 0.5f;
CTGradientElement color3; CTGradientElement color3;
color3.red = redComponent * 0.85; color3.red = redComponent * 0.85f;
color3.green = greenComponent * 0.85; color3.green = greenComponent * 0.85f;
color3.blue = blueComponent * 0.85; color3.blue = blueComponent * 0.85f;
color3.alpha = 1.0; color3.alpha = 1.0f;
color3.position = 0.5; color3.position = 0.5f;
CTGradientElement color4; CTGradientElement color4;
color4.red = redComponent; color4.red = redComponent;
color4.green = greenComponent; color4.green = greenComponent;
color4.blue = blueComponent; color4.blue = blueComponent;
color4.alpha = 1.0; color4.alpha = 1.0f;
color4.position = 1.0; color4.position = 1.0f;
CTGradient * newInstance = [[[self class] alloc] init]; CTGradient * newInstance = [[[self class] alloc] init];
[newInstance addElement: &color1]; [newInstance addElement: &color1];
@@ -69,7 +69,7 @@ CTGradient * fProgressWhiteGradient = nil;
+ (CTGradient *) progressWhiteGradient + (CTGradient *) progressWhiteGradient
{ {
if (!fProgressWhiteGradient) if (!fProgressWhiteGradient)
fProgressWhiteGradient = [[[self class] progressGradientForRed: 0.95 green: 0.95 blue: 0.95] retain]; fProgressWhiteGradient = [[[self class] progressGradientForRed: 0.95f green: 0.95f blue: 0.95f] retain];
return fProgressWhiteGradient; return fProgressWhiteGradient;
} }
@@ -77,7 +77,7 @@ CTGradient * fProgressGrayGradient = nil;
+ (CTGradient *) progressGrayGradient + (CTGradient *) progressGrayGradient
{ {
if (!fProgressGrayGradient) if (!fProgressGrayGradient)
fProgressGrayGradient = [[[self class] progressGradientForRed: 0.7 green: 0.7 blue: 0.7] retain]; fProgressGrayGradient = [[[self class] progressGradientForRed: 0.7f green: 0.7f blue: 0.7f] retain];
return fProgressGrayGradient; return fProgressGrayGradient;
} }
@@ -85,7 +85,7 @@ CTGradient * fProgressLightGrayGradient = nil;
+ (CTGradient *) progressLightGrayGradient + (CTGradient *) progressLightGrayGradient
{ {
if (!fProgressLightGrayGradient) if (!fProgressLightGrayGradient)
fProgressLightGrayGradient = [[[self class] progressGradientForRed: 0.87 green: 0.87 blue: 0.87] retain]; fProgressLightGrayGradient = [[[self class] progressGradientForRed: 0.87f green: 0.87f blue: 0.87f] retain];
return fProgressLightGrayGradient; return fProgressLightGrayGradient;
} }
@@ -93,7 +93,7 @@ CTGradient * fProgressBlueGradient = nil;
+ (CTGradient *) progressBlueGradient + (CTGradient *) progressBlueGradient
{ {
if (!fProgressBlueGradient) if (!fProgressBlueGradient)
fProgressBlueGradient = [[[self class] progressGradientForRed: 0.35 green: 0.67 blue: 0.98] retain]; fProgressBlueGradient = [[[self class] progressGradientForRed: 0.35f green: 0.67f blue: 0.98f] retain];
return fProgressBlueGradient; return fProgressBlueGradient;
} }
@@ -101,7 +101,7 @@ CTGradient * fProgressDarkBlueGradient = nil;
+ (CTGradient *) progressDarkBlueGradient + (CTGradient *) progressDarkBlueGradient
{ {
if (!fProgressDarkBlueGradient) if (!fProgressDarkBlueGradient)
fProgressDarkBlueGradient = [[[self class] progressGradientForRed: 0.616 green: 0.722 blue: 0.776] retain]; fProgressDarkBlueGradient = [[[self class] progressGradientForRed: 0.616f green: 0.722f blue: 0.776f] retain];
return fProgressDarkBlueGradient; return fProgressDarkBlueGradient;
} }
@@ -109,7 +109,7 @@ CTGradient * fProgressGreenGradient = nil;
+ (CTGradient *) progressGreenGradient + (CTGradient *) progressGreenGradient
{ {
if (!fProgressGreenGradient) if (!fProgressGreenGradient)
fProgressGreenGradient = [[[self class] progressGradientForRed: 0.44 green: 0.89 blue: 0.40] retain]; fProgressGreenGradient = [[[self class] progressGradientForRed: 0.44f green: 0.89f blue: 0.40f] retain];
return fProgressGreenGradient; return fProgressGreenGradient;
} }
@@ -117,7 +117,7 @@ CTGradient * fProgressLightGreenGradient = nil;
+ (CTGradient *) progressLightGreenGradient + (CTGradient *) progressLightGreenGradient
{ {
if (!fProgressLightGreenGradient) if (!fProgressLightGreenGradient)
fProgressLightGreenGradient = [[[self class] progressGradientForRed: 0.62 green: 0.99 blue: 0.58] retain]; fProgressLightGreenGradient = [[[self class] progressGradientForRed: 0.62f green: 0.99f blue: 0.58f] retain];
return fProgressLightGreenGradient; return fProgressLightGreenGradient;
} }
@@ -125,7 +125,7 @@ CTGradient * fProgressDarkGreenGradient = nil;
+ (CTGradient *) progressDarkGreenGradient + (CTGradient *) progressDarkGreenGradient
{ {
if (!fProgressDarkGreenGradient) if (!fProgressDarkGreenGradient)
fProgressDarkGreenGradient = [[[self class] progressGradientForRed: 0.627 green: 0.714 blue: 0.639] retain]; fProgressDarkGreenGradient = [[[self class] progressGradientForRed: 0.627f green: 0.714f blue: 0.639f] retain];
return fProgressDarkGreenGradient; return fProgressDarkGreenGradient;
} }
@@ -133,7 +133,7 @@ CTGradient * fProgressRedGradient = nil;
+ (CTGradient *) progressRedGradient + (CTGradient *) progressRedGradient
{ {
if (!fProgressRedGradient) if (!fProgressRedGradient)
fProgressRedGradient = [[[self class] progressGradientForRed: 0.902 green: 0.439 blue: 0.451] retain]; fProgressRedGradient = [[[self class] progressGradientForRed: 0.902f green: 0.439f blue: 0.451f] retain];
return fProgressRedGradient; return fProgressRedGradient;
} }
@@ -141,7 +141,7 @@ CTGradient * fProgressYellowGradient = nil;
+ (CTGradient *) progressYellowGradient + (CTGradient *) progressYellowGradient
{ {
if (!fProgressYellowGradient) if (!fProgressYellowGradient)
fProgressYellowGradient = [[[self class] progressGradientForRed: 0.933 green: 0.890 blue: 0.243] retain]; fProgressYellowGradient = [[[self class] progressGradientForRed: 0.933f green: 0.890f blue: 0.243f] retain];
return fProgressYellowGradient; return fProgressYellowGradient;
} }

View File

@@ -50,7 +50,7 @@
icon = [[NSWorkspace sharedWorkspace] iconForFile: [value stringByExpandingTildeInPath]]; icon = [[NSWorkspace sharedWorkspace] iconForFile: [value stringByExpandingTildeInPath]];
[icon setScalesWhenResized: YES]; [icon setScalesWhenResized: YES];
[icon setSize: NSMakeSize(16.0, 16.0)]; [icon setSize: NSMakeSize(16.0f, 16.0f)];
return icon; return icon;
} }

View File

@@ -47,7 +47,7 @@
NSString * unit; NSString * unit;
if (size < pow(1024, 2)) if (size < pow(1024, 2))
{ {
convertedSize = size / 1024.0; convertedSize = size / 1024.0f;
unit = NSLocalizedString(@"KB", "File size - kilobytes"); unit = NSLocalizedString(@"KB", "File size - kilobytes");
} }
else if (size < pow(1024, 3)) else if (size < pow(1024, 3))

View File

@@ -28,7 +28,7 @@
#import "utils.h" #import "utils.h"
#define MAX_ACROSS 18 #define MAX_ACROSS 18
#define BETWEEN 1.0 #define BETWEEN 1.0f
#define HIGH_PEERS 30 #define HIGH_PEERS 30
@@ -46,14 +46,14 @@
fBack = [[NSImage alloc] initWithSize: [self bounds].size]; fBack = [[NSImage alloc] initWithSize: [self bounds].size];
[fBack lockFocus]; [fBack lockFocus];
CTGradient * gradient = [CTGradient gradientWithBeginningColor: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.4] CTGradient * gradient = [CTGradient gradientWithBeginningColor: [NSColor colorWithCalibratedWhite: 0.0f alpha: 0.4f]
endingColor: [NSColor colorWithCalibratedWhite: 0.2 alpha: 0.4]]; endingColor: [NSColor colorWithCalibratedWhite: 0.2f alpha: 0.4f]];
[gradient fillRect: [self bounds] angle: 90.0]; [gradient fillRect: [self bounds] angle: 90.0f];
[fBack unlockFocus]; [fBack unlockFocus];
//store box colors //store box colors
fGreenAvailabilityColor = [[NSColor colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.4 alpha: 1.0] retain]; fGreenAvailabilityColor = [[NSColor colorWithCalibratedRed: 0.0f green: 1.0f blue: 0.4f alpha: 1.0f] retain];
fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain]; fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0f green: 0.4f blue: 0.8f alpha: 1.0f] retain];
//actually draw the box //actually draw the box
[self setTorrent: nil]; [self setTorrent: nil];
@@ -147,7 +147,7 @@
NSColor * pieceColor = nil; NSColor * pieceColor = nil;
if (showAvailablity ? pieces[index] == -1 : piecesPercent[index] == 1.0) if (showAvailablity ? pieces[index] == -1 : piecesPercent[index] == 1.0f)
{ {
if (first || fPieces[index] != PIECE_FINISHED) if (first || fPieces[index] != PIECE_FINISHED)
{ {
@@ -163,7 +163,7 @@
} }
} }
} }
else if (showAvailablity ? pieces[index] == 0 : piecesPercent[index] == 0.0) else if (showAvailablity ? pieces[index] == 0 : piecesPercent[index] == 0.0f)
{ {
if (first || fPieces[index] != PIECE_NONE) if (first || fPieces[index] != PIECE_NONE)
{ {

View File

@@ -33,7 +33,7 @@
- (void) updateStats; - (void) updateStats;
- (void) performResetStats; - (void) performResetStats;
- (void) resetSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info; - (void) resetSheetClosed: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (void *) info;
@end @end
@@ -73,7 +73,7 @@ tr_handle * fLib;
stringByAppendingString: @":"]]; stringByAppendingString: @":"]];
//size all elements //size all elements
float oldWidth = [fUploadedLabelField frame].size.width; CGFloat oldWidth = [fUploadedLabelField frame].size.width;
[fUploadedLabelField sizeToFit]; [fUploadedLabelField sizeToFit];
[fDownloadedLabelField sizeToFit]; [fDownloadedLabelField sizeToFit];
@@ -81,7 +81,7 @@ tr_handle * fLib;
[fTimeLabelField sizeToFit]; [fTimeLabelField sizeToFit];
[fNumOpenedLabelField sizeToFit]; [fNumOpenedLabelField sizeToFit];
float maxWidth = MAX([fUploadedLabelField frame].size.width, [fDownloadedLabelField frame].size.width); CGFloat maxWidth = MAX([fUploadedLabelField frame].size.width, [fDownloadedLabelField frame].size.width);
maxWidth = MAX(maxWidth, [fRatioLabelField frame].size.width); maxWidth = MAX(maxWidth, [fRatioLabelField frame].size.width);
maxWidth = MAX(maxWidth, [fTimeLabelField frame].size.width); maxWidth = MAX(maxWidth, [fTimeLabelField frame].size.width);
maxWidth = MAX(maxWidth, [fNumOpenedLabelField frame].size.width); maxWidth = MAX(maxWidth, [fNumOpenedLabelField frame].size.width);
@@ -112,13 +112,13 @@ tr_handle * fLib;
[[self window] setFrame: windowRect display: YES]; [[self window] setFrame: windowRect display: YES];
//resize reset button //resize reset button
float oldButtonWidth = [fResetButton frame].size.width; CGFloat oldButtonWidth = [fResetButton frame].size.width;
[fResetButton setTitle: NSLocalizedString(@"Reset", "Stats window -> reset button")]; [fResetButton setTitle: NSLocalizedString(@"Reset", "Stats window -> reset button")];
[fResetButton sizeToFit]; [fResetButton sizeToFit];
NSRect buttonFrame = [fResetButton frame]; NSRect buttonFrame = [fResetButton frame];
buttonFrame.size.width += 10.0; buttonFrame.size.width += 10.0f;
buttonFrame.origin.x -= buttonFrame.size.width - oldButtonWidth; buttonFrame.origin.x -= buttonFrame.size.width - oldButtonWidth;
[fResetButton setFrame: buttonFrame]; [fResetButton setFrame: buttonFrame];
} }
@@ -206,7 +206,7 @@ tr_handle * fLib;
[self updateStats]; [self updateStats];
} }
- (void) resetSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info - (void) resetSheetClosed: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (void *) info
{ {
[[alert window] orderOut: nil]; [[alert window] orderOut: nil];

View File

@@ -30,7 +30,7 @@
{ {
if ((self = [super initWithFrame: rect])) if ((self = [super initWithFrame: rect]))
{ {
fGrayBorderColor = [[NSColor colorWithCalibratedRed: 171.0/255.0 green: 171.0/255.0 blue: 171.0/255.0 alpha: 1.0] retain]; fGrayBorderColor = [[NSColor colorWithCalibratedRed: 171.0f/255.0f green: 171.0f/255.0f blue: 171.0f/255.0f alpha: 1.0f] retain];
} }
return self; return self;
} }
@@ -43,7 +43,7 @@
- (void) drawRect: (NSRect) rect - (void) drawRect: (NSRect) rect
{ {
NSRect lineBorderRect = NSMakeRect(rect.origin.x, [self bounds].size.height - 1.0, rect.size.width, 1.0); NSRect lineBorderRect = NSMakeRect(rect.origin.x, [self bounds].size.height - 1.0f, rect.size.width, 1.0f);
if (NSIntersectsRect(lineBorderRect, rect)) if (NSIntersectsRect(lineBorderRect, rect))
{ {
[[NSColor whiteColor] set]; [[NSColor whiteColor] set];
@@ -52,7 +52,7 @@
rect.size.height--; rect.size.height--;
} }
lineBorderRect.origin.y = 0.0; lineBorderRect.origin.y = 0.0f;
if (NSIntersectsRect(lineBorderRect, rect)) if (NSIntersectsRect(lineBorderRect, rect))
{ {
[fGrayBorderColor set]; [fGrayBorderColor set];

View File

@@ -30,13 +30,13 @@
NSMutableArray * fTorrents; NSMutableArray * fTorrents;
} }
- (id) initWithGroup: (int) group; - (id) initWithGroup: (NSInteger) group;
- (NSInteger) groupIndex; - (NSInteger) groupIndex;
- (NSMutableArray *) torrents; - (NSMutableArray *) torrents;
- (float) ratio; - (CGFloat) ratio;
- (float) uploadRate; - (CGFloat) uploadRate;
- (float) downloadRate; - (CGFloat) downloadRate;
@end @end

View File

@@ -28,7 +28,7 @@
@implementation TorrentGroup @implementation TorrentGroup
- (id) initWithGroup: (int) group - (id) initWithGroup: (NSInteger) group
{ {
if ((self = [super init])) if ((self = [super init]))
{ {
@@ -54,7 +54,7 @@
return fTorrents; return fTorrents;
} }
- (float) ratio - (CGFloat) ratio
{ {
uint64_t uploaded = 0, downloaded = 0; uint64_t uploaded = 0, downloaded = 0;
NSEnumerator * enumerator = [fTorrents objectEnumerator]; NSEnumerator * enumerator = [fTorrents objectEnumerator];
@@ -68,9 +68,9 @@
return tr_getRatio(uploaded, downloaded); return tr_getRatio(uploaded, downloaded);
} }
- (float) uploadRate - (CGFloat) uploadRate
{ {
float rate = 0.0; float rate = 0.0f;
NSEnumerator * enumerator = [fTorrents objectEnumerator]; NSEnumerator * enumerator = [fTorrents objectEnumerator];
Torrent * torrent; Torrent * torrent;
while ((torrent = [enumerator nextObject])) while ((torrent = [enumerator nextObject]))
@@ -79,9 +79,9 @@
return rate; return rate;
} }
- (float) downloadRate - (CGFloat) downloadRate
{ {
float rate = 0.0; float rate = 0.0f;
NSEnumerator * enumerator = [fTorrents objectEnumerator]; NSEnumerator * enumerator = [fTorrents objectEnumerator];
Torrent * torrent; Torrent * torrent;
while ((torrent = [enumerator nextObject])) while ((torrent = [enumerator nextObject]))