more trivial type changes
This commit is contained in:
parent
8a5697d1a0
commit
6bc269d2bc
|
@ -43,7 +43,7 @@
|
|||
NSString * fDestination;
|
||||
|
||||
BOOL fDeleteTorrent, fDeleteEnable;
|
||||
int fGroupValue;
|
||||
NSInteger fGroupValue;
|
||||
|
||||
NSTimer * fTimer;
|
||||
}
|
||||
|
|
|
@ -30,18 +30,18 @@
|
|||
#import "NSApplicationAdditions.h"
|
||||
#import "ExpandedPathToIconTransformer.h"
|
||||
|
||||
#define UPDATE_SECONDS 1.0
|
||||
#define UPDATE_SECONDS 1.0f
|
||||
|
||||
@interface AddWindowController (Private)
|
||||
|
||||
- (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) changeGroupValue: (id) sender;
|
||||
|
||||
- (void) sameNameAlertDidEnd: (NSAlert *) alert returnCode: (int) returnCode contextInfo: (void *) contextInfo;
|
||||
- (void) sameNameAlertDidEnd: (NSAlert *) alert returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -210,7 +210,7 @@
|
|||
if ([fTorrent isFolder])
|
||||
{
|
||||
NSString * fileString;
|
||||
int count = [fTorrent fileCount];
|
||||
NSInteger count = [fTorrent fileCount];
|
||||
if (count != 1)
|
||||
fileString = [NSString stringWithFormat: NSLocalizedString(@"%d files", "Add torrent -> info"), count];
|
||||
else
|
||||
|
@ -262,7 +262,7 @@
|
|||
[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)
|
||||
{
|
||||
|
@ -302,7 +302,7 @@
|
|||
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))
|
||||
[[NSUserDefaults standardUserDefaults] setBool: NO forKey: @"WarningFolderDataSameName"];
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
- (id) initWithPrefsController: (PrefsController *) prefsController;
|
||||
- (void) startDownload;
|
||||
- (void) failureSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info;
|
||||
- (void) failureSheetClosed: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (void *) info;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
|||
CGFloat oldWidth = [fButton frame].size.width;
|
||||
[fButton sizeToFit];
|
||||
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;
|
||||
[fButton setFrame: buttonFrame];
|
||||
|
||||
|
@ -146,7 +146,7 @@
|
|||
[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];
|
||||
[self release];
|
||||
|
|
|
@ -32,29 +32,29 @@
|
|||
color1.red = redComponent;
|
||||
color1.green = greenComponent;
|
||||
color1.blue = blueComponent;
|
||||
color1.alpha = 1.0;
|
||||
color1.position = 0.0;
|
||||
color1.alpha = 1.0f;
|
||||
color1.position = 0.0f;
|
||||
|
||||
CTGradientElement color2;
|
||||
color2.red = redComponent * 0.95;
|
||||
color2.green = greenComponent * 0.95;
|
||||
color2.blue = blueComponent * 0.95;
|
||||
color2.alpha = 1.0;
|
||||
color2.position = 0.5;
|
||||
color2.red = redComponent * 0.95f;
|
||||
color2.green = greenComponent * 0.95f;
|
||||
color2.blue = blueComponent * 0.95f;
|
||||
color2.alpha = 1.0f;
|
||||
color2.position = 0.5f;
|
||||
|
||||
CTGradientElement color3;
|
||||
color3.red = redComponent * 0.85;
|
||||
color3.green = greenComponent * 0.85;
|
||||
color3.blue = blueComponent * 0.85;
|
||||
color3.alpha = 1.0;
|
||||
color3.position = 0.5;
|
||||
color3.red = redComponent * 0.85f;
|
||||
color3.green = greenComponent * 0.85f;
|
||||
color3.blue = blueComponent * 0.85f;
|
||||
color3.alpha = 1.0f;
|
||||
color3.position = 0.5f;
|
||||
|
||||
CTGradientElement color4;
|
||||
color4.red = redComponent;
|
||||
color4.green = greenComponent;
|
||||
color4.blue = blueComponent;
|
||||
color4.alpha = 1.0;
|
||||
color4.position = 1.0;
|
||||
color4.alpha = 1.0f;
|
||||
color4.position = 1.0f;
|
||||
|
||||
CTGradient * newInstance = [[[self class] alloc] init];
|
||||
[newInstance addElement: &color1];
|
||||
|
@ -69,7 +69,7 @@ CTGradient * fProgressWhiteGradient = nil;
|
|||
+ (CTGradient *) progressWhiteGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ CTGradient * fProgressGrayGradient = nil;
|
|||
+ (CTGradient *) progressGrayGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ CTGradient * fProgressLightGrayGradient = nil;
|
|||
+ (CTGradient *) progressLightGrayGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ CTGradient * fProgressBlueGradient = nil;
|
|||
+ (CTGradient *) progressBlueGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ CTGradient * fProgressDarkBlueGradient = nil;
|
|||
+ (CTGradient *) progressDarkBlueGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ CTGradient * fProgressGreenGradient = nil;
|
|||
+ (CTGradient *) progressGreenGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ CTGradient * fProgressLightGreenGradient = nil;
|
|||
+ (CTGradient *) progressLightGreenGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ CTGradient * fProgressDarkGreenGradient = nil;
|
|||
+ (CTGradient *) progressDarkGreenGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ CTGradient * fProgressRedGradient = nil;
|
|||
+ (CTGradient *) progressRedGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ CTGradient * fProgressYellowGradient = nil;
|
|||
+ (CTGradient *) progressYellowGradient
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
icon = [[NSWorkspace sharedWorkspace] iconForFile: [value stringByExpandingTildeInPath]];
|
||||
|
||||
[icon setScalesWhenResized: YES];
|
||||
[icon setSize: NSMakeSize(16.0, 16.0)];
|
||||
[icon setSize: NSMakeSize(16.0f, 16.0f)];
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
NSString * unit;
|
||||
if (size < pow(1024, 2))
|
||||
{
|
||||
convertedSize = size / 1024.0;
|
||||
convertedSize = size / 1024.0f;
|
||||
unit = NSLocalizedString(@"KB", "File size - kilobytes");
|
||||
}
|
||||
else if (size < pow(1024, 3))
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#import "utils.h"
|
||||
|
||||
#define MAX_ACROSS 18
|
||||
#define BETWEEN 1.0
|
||||
#define BETWEEN 1.0f
|
||||
|
||||
#define HIGH_PEERS 30
|
||||
|
||||
|
@ -46,14 +46,14 @@
|
|||
fBack = [[NSImage alloc] initWithSize: [self bounds].size];
|
||||
|
||||
[fBack lockFocus];
|
||||
CTGradient * gradient = [CTGradient gradientWithBeginningColor: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.4]
|
||||
endingColor: [NSColor colorWithCalibratedWhite: 0.2 alpha: 0.4]];
|
||||
[gradient fillRect: [self bounds] angle: 90.0];
|
||||
CTGradient * gradient = [CTGradient gradientWithBeginningColor: [NSColor colorWithCalibratedWhite: 0.0f alpha: 0.4f]
|
||||
endingColor: [NSColor colorWithCalibratedWhite: 0.2f alpha: 0.4f]];
|
||||
[gradient fillRect: [self bounds] angle: 90.0f];
|
||||
[fBack unlockFocus];
|
||||
|
||||
//store box colors
|
||||
fGreenAvailabilityColor = [[NSColor colorWithCalibratedRed: 0.0 green: 1.0 blue: 0.4 alpha: 1.0] retain];
|
||||
fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain];
|
||||
fGreenAvailabilityColor = [[NSColor colorWithCalibratedRed: 0.0f green: 1.0f blue: 0.4f alpha: 1.0f] retain];
|
||||
fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0f green: 0.4f blue: 0.8f alpha: 1.0f] retain];
|
||||
|
||||
//actually draw the box
|
||||
[self setTorrent: nil];
|
||||
|
@ -147,7 +147,7 @@
|
|||
|
||||
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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
- (void) updateStats;
|
||||
|
||||
- (void) performResetStats;
|
||||
- (void) resetSheetClosed: (NSAlert *) alert returnCode: (int) code contextInfo: (void *) info;
|
||||
- (void) resetSheetClosed: (NSAlert *) alert returnCode: (NSInteger) code contextInfo: (void *) info;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -73,7 +73,7 @@ tr_handle * fLib;
|
|||
stringByAppendingString: @":"]];
|
||||
|
||||
//size all elements
|
||||
float oldWidth = [fUploadedLabelField frame].size.width;
|
||||
CGFloat oldWidth = [fUploadedLabelField frame].size.width;
|
||||
|
||||
[fUploadedLabelField sizeToFit];
|
||||
[fDownloadedLabelField sizeToFit];
|
||||
|
@ -81,7 +81,7 @@ tr_handle * fLib;
|
|||
[fTimeLabelField 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, [fTimeLabelField frame].size.width);
|
||||
maxWidth = MAX(maxWidth, [fNumOpenedLabelField frame].size.width);
|
||||
|
@ -112,13 +112,13 @@ tr_handle * fLib;
|
|||
[[self window] setFrame: windowRect display: YES];
|
||||
|
||||
//resize reset button
|
||||
float oldButtonWidth = [fResetButton frame].size.width;
|
||||
CGFloat oldButtonWidth = [fResetButton frame].size.width;
|
||||
|
||||
[fResetButton setTitle: NSLocalizedString(@"Reset", "Stats window -> reset button")];
|
||||
[fResetButton sizeToFit];
|
||||
|
||||
NSRect buttonFrame = [fResetButton frame];
|
||||
buttonFrame.size.width += 10.0;
|
||||
buttonFrame.size.width += 10.0f;
|
||||
buttonFrame.origin.x -= buttonFrame.size.width - oldButtonWidth;
|
||||
[fResetButton setFrame: buttonFrame];
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ tr_handle * fLib;
|
|||
[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];
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@
|
|||
|
||||
- (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))
|
||||
{
|
||||
[[NSColor whiteColor] set];
|
||||
|
@ -52,7 +52,7 @@
|
|||
rect.size.height--;
|
||||
}
|
||||
|
||||
lineBorderRect.origin.y = 0.0;
|
||||
lineBorderRect.origin.y = 0.0f;
|
||||
if (NSIntersectsRect(lineBorderRect, rect))
|
||||
{
|
||||
[fGrayBorderColor set];
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
NSMutableArray * fTorrents;
|
||||
}
|
||||
|
||||
- (id) initWithGroup: (int) group;
|
||||
- (id) initWithGroup: (NSInteger) group;
|
||||
|
||||
- (NSInteger) groupIndex;
|
||||
- (NSMutableArray *) torrents;
|
||||
|
||||
- (float) ratio;
|
||||
- (float) uploadRate;
|
||||
- (float) downloadRate;
|
||||
- (CGFloat) ratio;
|
||||
- (CGFloat) uploadRate;
|
||||
- (CGFloat) downloadRate;
|
||||
|
||||
@end
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
@implementation TorrentGroup
|
||||
|
||||
- (id) initWithGroup: (int) group
|
||||
- (id) initWithGroup: (NSInteger) group
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
|
@ -54,7 +54,7 @@
|
|||
return fTorrents;
|
||||
}
|
||||
|
||||
- (float) ratio
|
||||
- (CGFloat) ratio
|
||||
{
|
||||
uint64_t uploaded = 0, downloaded = 0;
|
||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||
|
@ -68,9 +68,9 @@
|
|||
return tr_getRatio(uploaded, downloaded);
|
||||
}
|
||||
|
||||
- (float) uploadRate
|
||||
- (CGFloat) uploadRate
|
||||
{
|
||||
float rate = 0.0;
|
||||
float rate = 0.0f;
|
||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||
Torrent * torrent;
|
||||
while ((torrent = [enumerator nextObject]))
|
||||
|
@ -79,9 +79,9 @@
|
|||
return rate;
|
||||
}
|
||||
|
||||
- (float) downloadRate
|
||||
- (CGFloat) downloadRate
|
||||
{
|
||||
float rate = 0.0;
|
||||
float rate = 0.0f;
|
||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||
Torrent * torrent;
|
||||
while ((torrent = [enumerator nextObject]))
|
||||
|
|
Loading…
Reference in New Issue