]> granicus.if.org Git - transmission/commitdiff
update some floats to CGFloats; append "f" to some float constants
authorMitchell Livingston <livings124@transmissionbt.com>
Sat, 25 Oct 2008 21:34:30 +0000 (21:34 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Sat, 25 Oct 2008 21:34:30 +0000 (21:34 +0000)
macosx/AboutWindowController.m
macosx/BadgeView.h
macosx/BadgeView.m
macosx/MessageWindowController.h
macosx/MessageWindowController.m
macosx/TorrentCell.m

index 95f65951190dca43b1f275e4219d0f9d6990cfd4..5d96bb92f790d7b3b9259933fc932efd8f75c50e 100644 (file)
@@ -53,7 +53,7 @@ AboutWindowController * fAboutBoxInstance = nil;
     [fLicenseButton sizeToFit];
     
     NSRect buttonFrame = [fLicenseButton frame];
-    buttonFrame.size.width += 10.0;
+    buttonFrame.size.width += 10.0f;
     buttonFrame.origin.x -= buttonFrame.size.width - oldButtonWidth;
     [fLicenseButton setFrame: buttonFrame];
 }
index ac428c53d5a6b5a4e5dc346c3fedf6974875b4af..ab1698012a48065b62044bd721048d0351fdbcfb 100644 (file)
     
     NSDictionary * fAttributes;
     
-    float fDownloadRate, fUploadRate;
+    CGFloat fDownloadRate, fUploadRate;
     BOOL fQuitting;
 }
 
 - (id) initWithFrame: (NSRect) frame lib: (tr_handle *) lib;
 
-- (BOOL) setRatesWithDownload: (float) downloadRate upload: (float) uploadRate;
+- (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate;
 - (void) setQuitting;
 
 @end
index 6c24c91140b9cdeab149eaea1d5f2e747ea4b148..e2d30e343b67cfd31a1dcde42b02d462bfc7530e 100644 (file)
 #import "BadgeView.h"
 #import "NSStringAdditions.h"
 
-#define BETWEEN_PADDING 2.0
+#define BETWEEN_PADDING 2.0f
 
 @interface BadgeView (Private)
 
-- (void) badge: (NSImage *) badge string: (NSString *) string atHeight: (float) height adjustForQuit: (BOOL) quit;
+- (void) badge: (NSImage *) badge string: (NSString *) string atHeight: (CGFloat) height adjustForQuit: (BOOL) quit;
 
 @end
 
@@ -54,7 +54,7 @@
     [super dealloc];
 }
 
-- (BOOL) setRatesWithDownload: (float) downloadRate upload: (float) uploadRate
+- (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate
 {
     //only needs update if the badges were displayed or are displayed now
     BOOL needsUpdate = fDownloadRate != downloadRate || fUploadRate != uploadRate;
     {
         NSImage * quitBadge = [NSImage imageNamed: @"QuitBadge.png"];
         [self badge: quitBadge string: NSLocalizedString(@"Quitting", "Dock Badger -> quit")
-                atHeight: (rect.size.height - [quitBadge size].height) * 0.5 adjustForQuit: YES];
+                atHeight: (rect.size.height - [quitBadge size].height) * 0.5f adjustForQuit: YES];
         return;
     }
     
-    BOOL upload = fUploadRate >= 0.1,
-        download = fDownloadRate >= 0.1;
-    float bottom = 0.0;
+    BOOL upload = fUploadRate >= 0.1f,
+        download = fDownloadRate >= 0.1f;
+    CGFloat bottom = 0.0f;
     if (upload)
     {
         NSImage * uploadBadge = [NSImage imageNamed: @"UploadBadge.png"];
 @implementation BadgeView (Private)
 
 //dock icon must have locked focus
-- (void) badge: (NSImage *) badge string: (NSString *) string atHeight: (float) height adjustForQuit: (BOOL) quit
+- (void) badge: (NSImage *) badge string: (NSString *) string atHeight: (CGFloat) height adjustForQuit: (BOOL) quit
 {
     if (!fAttributes)
     {
         NSShadow * stringShadow = [[NSShadow alloc] init];
-        [stringShadow setShadowOffset: NSMakeSize(2.0, -2.0)];
-        [stringShadow setShadowBlurRadius: 4.0];
+        [stringShadow setShadowOffset: NSMakeSize(2.0f, -2.0f)];
+        [stringShadow setShadowBlurRadius: 4.0f];
         
         fAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:
             [NSColor whiteColor], NSForegroundColorAttributeName,
-            [NSFont boldSystemFontOfSize: 26.0], NSFontAttributeName, stringShadow, NSShadowAttributeName, nil];
+            [NSFont boldSystemFontOfSize: 26.0f], NSFontAttributeName, stringShadow, NSShadowAttributeName, nil];
         
         [stringShadow release];
     }
     badgeRect.size = [badge size];
     badgeRect.origin.y = height;
     
-    [badge drawInRect: badgeRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
+    [badge drawInRect: badgeRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0f];
     
     //string is in center of image
     NSSize stringSize = [string sizeWithAttributes: fAttributes];
     
     NSRect stringRect = badgeRect;
-    stringRect.origin.x += (badgeRect.size.width - stringSize.width) * 0.5;
-    stringRect.origin.y += (badgeRect.size.height - stringSize.height) * 0.5 + (quit ? 2.0 : 1.0); //adjust for shadow, extra for quit
+    stringRect.origin.x += (badgeRect.size.width - stringSize.width) * 0.5f;
+    stringRect.origin.y += (badgeRect.size.height - stringSize.height) * 0.5f + (quit ? 2.0f : 1.0f); //adjust for shadow, extra for quit
     stringRect.size = stringSize;
     
     [string drawInRect: stringRect withAttributes: fAttributes];
index 6533a7777f52170b1565f1e3be27e9f385abe036..15778540f6615abbde2f4ce5949bac8d49048b10 100644 (file)
@@ -32,7 +32,7 @@
     IBOutlet NSButton * fSaveButton, * fClearButton;
     
     NSMutableArray * fMessages;
-    unsigned int fIndex;
+    NSUInteger fIndex;
     
     NSDictionary * fAttributes;
     
index 03be69de8ac7736bd1eba315b2676846391a20e5..df6bb6acdf4e45a6e80c236fbe5bd91642fa728d 100644 (file)
     NSScroller * scroller = [[fMessageTable enclosingScrollView] verticalScroller];
     BOOL shouldScroll = [scroller floatValue] == 1.0 || [scroller isHidden] || [scroller knobProportion] == 1.0;
     
-    int total = [fMessages count];
+    NSUInteger total = [fMessages count];
     if (total > MAX_MESSAGES)
     {
         //remove the oldest
         [fMessageTable scrollRowToVisible: total-1];
 }
 
-- (int) numberOfRowsInTableView: (NSTableView *) tableView
+- (NSInteger) numberOfRowsInTableView: (NSTableView *) tableView
 {
     return [fMessages count];
 }
 
-- (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) column row: (int) row
+- (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) column row: (NSInteger) row
 {
     NSString * ident = [column identifier];
     NSDictionary * message = [fMessages objectAtIndex: row];
 }
 
 #warning don't cut off end
-- (float) tableView: (NSTableView *) tableView heightOfRow: (int) row
+- (float) tableView: (NSTableView *) tableView heightOfRow: (NSInteger) row
 {
     NSTableColumn * column = [tableView tableColumnWithIdentifier: @"Message"];
     
     if (!fAttributes)
         fAttributes = [[[[column dataCell] attributedStringValue] attributesAtIndex: 0 effectiveRange: NULL] retain];
     
-    int count = [[[fMessages objectAtIndex: row] objectForKey: @"Message"] sizeWithAttributes: fAttributes].width / [column width];
-    return [tableView rowHeight] * (float)(count+1);
+    CGFloat count = floorf([[[fMessages objectAtIndex: row] objectForKey: @"Message"] sizeWithAttributes: fAttributes].width
+                            / [column width]);
+    return [tableView rowHeight] * (count + 1.0f);
 }
 
 - (void) tableView: (NSTableView *) tableView sortDescriptorsDidChange: (NSArray *) oldDescriptors
 }
 
 - (NSString *) tableView: (NSTableView *) tableView toolTipForCell: (NSCell *) cell rect: (NSRectPointer) rect
-                tableColumn: (NSTableColumn *) column row: (int) row mouseLocation: (NSPoint) mouseLocation
+                tableColumn: (NSTableColumn *) column row: (NSInteger) row mouseLocation: (NSPoint) mouseLocation
 {
     NSDictionary * message = [fMessages objectAtIndex: row];
     return [NSString stringWithFormat: @"%@:%@", [[message objectForKey: @"File"] lastPathComponent], [message objectForKey: @"Line"]];
             didEndSelector: @selector(writeToFileSheetClosed:returnCode:contextInfo:) contextInfo: fileString];
 }
 
-- (void) writeToFileSheetClosed: (NSSavePanel *) panel returnCode: (int) code contextInfo: (NSString *) string
+- (void) writeToFileSheetClosed: (NSSavePanel *) panel returnCode: (NSInteger) code contextInfo: (NSString *) string
 {
     if (code == NSOKButton)
     {
index 4e77e56ac4349585602dc08209bc587a9323e9e3..bdc63b04da3a3a2b0ab3a7278804f763ad1ed3c7 100644 (file)
 #import "NSBezierPathAdditions.h"
 #import "CTGradientAdditions.h"
 
-#define BAR_HEIGHT 12.0
+#define BAR_HEIGHT 12.0f
 
-#define IMAGE_SIZE_REG 32.0
-#define IMAGE_SIZE_MIN 16.0
+#define IMAGE_SIZE_REG 32.0f
+#define IMAGE_SIZE_MIN 16.0f
 
-#define NORMAL_BUTTON_WIDTH 14.0
-#define ACTION_BUTTON_WIDTH 16.0
+#define NORMAL_BUTTON_WIDTH 14.0f
+#define ACTION_BUTTON_WIDTH 16.0f
 
 //ends up being larger than font height
-#define HEIGHT_TITLE 16.0
-#define HEIGHT_STATUS 12.0
-
-#define PADDING_HORIZONTAL 3.0
-#define PADDING_BETWEEN_IMAGE_AND_TITLE 5.0
-#define PADDING_BETWEEN_IMAGE_AND_BAR 7.0
-#define PADDING_ABOVE_TITLE 4.0
-#define PADDING_ABOVE_MIN_STATUS 4.0
-#define PADDING_BETWEEN_TITLE_AND_MIN_STATUS 2.0
-#define PADDING_BETWEEN_TITLE_AND_PROGRESS 1.0
-#define PADDING_BETWEEN_PROGRESS_AND_BAR 2.0
-#define PADDING_BETWEEN_TITLE_AND_BAR_MIN 3.0
-#define PADDING_BETWEEN_BAR_AND_STATUS 2.0
-
-#define PIECES_TOTAL_PERCENT 0.6
+#define HEIGHT_TITLE 16.0f
+#define HEIGHT_STATUS 12.0f
+
+#define PADDING_HORIZONTAL 3.0f
+#define PADDING_BETWEEN_IMAGE_AND_TITLE 5.0f
+#define PADDING_BETWEEN_IMAGE_AND_BAR 7.0f
+#define PADDING_ABOVE_TITLE 4.0f
+#define PADDING_ABOVE_MIN_STATUS 4.0f
+#define PADDING_BETWEEN_TITLE_AND_MIN_STATUS 2.0f
+#define PADDING_BETWEEN_TITLE_AND_PROGRESS 1.0f
+#define PADDING_BETWEEN_PROGRESS_AND_BAR 2.0f
+#define PADDING_BETWEEN_TITLE_AND_BAR_MIN 3.0f
+#define PADDING_BETWEEN_BAR_AND_STATUS 2.0f
+
+#define PIECES_TOTAL_PERCENT 0.6f
 
 #define MAX_PIECES (18*18)
 
         [paragraphStyle setLineBreakMode: NSLineBreakByTruncatingTail];
     
         fTitleAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
-                                [NSFont messageFontOfSize: 12.0], NSFontAttributeName,
+                                [NSFont messageFontOfSize: 12.0f], NSFontAttributeName,
                                 paragraphStyle, NSParagraphStyleAttributeName, nil];
         fStatusAttributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
-                                [NSFont messageFontOfSize: 9.0], NSFontAttributeName,
+                                [NSFont messageFontOfSize: 9.0f], NSFontAttributeName,
                                 paragraphStyle, NSParagraphStyleAttributeName, nil];
         [paragraphStyle release];
         
-        fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0 green: 0.4 blue: 0.8 alpha: 1.0] retain];
-        fBarBorderColor = [[NSColor colorWithDeviceWhite: 0.0 alpha: 0.2] retain];
+        fBluePieceColor = [[NSColor colorWithCalibratedRed: 0.0f green: 0.4f blue: 0.8f alpha: 1.0f] retain];
+        fBarBorderColor = [[NSColor colorWithDeviceWhite: 0.0f alpha: 0.2f] retain];
     }
        return self;
 }
 
 - (NSRect) iconRectForBounds: (NSRect) bounds
 {
-    float imageSize = [fDefaults boolForKey: @"SmallView"] ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG;
+    CGFloat imageSize = [fDefaults boolForKey: @"SmallView"] ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG;
     
     NSRect result = bounds;
     result.origin.x += PADDING_HORIZONTAL;
-    result.origin.y += floorf((result.size.height - imageSize) * 0.5);
+    result.origin.y += floorf((result.size.height - imageSize) * 0.5f);
     result.size = NSMakeSize(imageSize, imageSize);
     
     return result;
     else
         result.origin.y += PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
     
-    result.size.width = round(NSMaxX(bounds) - result.origin.x - PADDING_HORIZONTAL - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
+    result.size.width = round(NSMaxX(bounds) - result.origin.x - PADDING_HORIZONTAL - 2.0f * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
     
     return result;
 }
     NSRect result = bounds;
     result.size.height = NORMAL_BUTTON_WIDTH;
     result.size.width = NORMAL_BUTTON_WIDTH;
-    result.origin.x = NSMaxX(bounds) - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
+    result.origin.x = NSMaxX(bounds) - 2.0f * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
     
-    result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5;
+    result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f;
     if ([fDefaults boolForKey: @"SmallView"])
         result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN;
     else
     result.size.width = NORMAL_BUTTON_WIDTH;
     result.origin.x = NSMaxX(bounds) - (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
     
-    result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5;
+    result.origin.y += PADDING_ABOVE_TITLE + HEIGHT_TITLE - (NORMAL_BUTTON_WIDTH - BAR_HEIGHT) * 0.5f;
     if ([fDefaults boolForKey: @"SmallView"])
         result.origin.y += PADDING_BETWEEN_TITLE_AND_BAR_MIN;
     else
     NSRect result = [self iconRectForBounds: bounds];
     if (![fDefaults boolForKey: @"SmallView"])
     {
-        result.origin.x += (result.size.width - ACTION_BUTTON_WIDTH) * 0.5;
-        result.origin.y += (result.size.height - ACTION_BUTTON_WIDTH) * 0.5;
+        result.origin.x += (result.size.width - ACTION_BUTTON_WIDTH) * 0.5f;
+        result.origin.y += (result.size.height - ACTION_BUTTON_WIDTH) * 0.5f;
         result.size.width = ACTION_BUTTON_WIDTH;
         result.size.height = ACTION_BUTTON_WIDTH;
     }
     //group coloring
     NSRect iconRect = [self iconRectForBounds: cellFrame];
     
-    int groupValue = [torrent groupValue];
+    NSInteger groupValue = [torrent groupValue];
     if (groupValue != -1)
     {
-        NSRect groupRect = NSInsetRect(iconRect, -1.0, -2.0);
+        NSRect groupRect = NSInsetRect(iconRect, -1.0f, -2.0f);
         if (!minimal)
         {
             groupRect.size.height--;
             groupRect.origin.y--;
         }
-        float radius = minimal ? 3.0 : 6.0;
+        CGFloat radius = minimal ? 3.0f : 6.0f;
         
         NSColor * groupColor = [[GroupsController groups] colorForIndex: groupValue],
-                * darkGroupColor = [groupColor blendedColorWithFraction: 0.2 ofColor: [NSColor whiteColor]];
+                * darkGroupColor = [groupColor blendedColorWithFraction: 0.2f ofColor: [NSColor whiteColor]];
         
         //border
         NSBezierPath * bp = [NSBezierPath bezierPathWithRoundedRect: groupRect radius: radius];
         [darkGroupColor set];
-        [bp setLineWidth: 2.0];
+        [bp setLineWidth: 2.0f];
         [bp stroke];
         
         //inside
         bp = [NSBezierPath bezierPathWithRoundedRect: groupRect radius: radius];
-        CTGradient * gradient = [CTGradient gradientWithBeginningColor: [groupColor blendedColorWithFraction: 0.7
+        CTGradient * gradient = [CTGradient gradientWithBeginningColor: [groupColor blendedColorWithFraction: 0.7f
                                     ofColor: [NSColor whiteColor]] endingColor: darkGroupColor];
-        [gradient fillBezierPath: bp angle: 90.0];
+        [gradient fillBezierPath: bp angle: 90.0f];
     }
     
     //error image
     if (!minimal || !(!fTracking && fHoverAction)) //don't show in minimal mode when hovered over
     {
         NSImage * icon = (minimal && error) ? fErrorImage : [torrent icon];
-        [icon drawInRect: iconRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
+        [icon drawInRect: iconRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0f];
     }
     
     if (error && !minimal)
     {
         NSRect errorRect = NSMakeRect(NSMaxX(iconRect) - IMAGE_SIZE_MIN, NSMaxY(iconRect) - IMAGE_SIZE_MIN,
                                         IMAGE_SIZE_MIN, IMAGE_SIZE_MIN);
-        [fErrorImage drawInRect: errorRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
+        [fErrorImage drawInRect: errorRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0f];
     }
     
     //text color
     
     [controlImage setFlipped: YES];
     [controlImage drawInRect: [self controlButtonRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver
-        fraction: 1.0];
+        fraction: 1.0f];
     
     //reveal button
     NSString * revealImageString;
     NSImage * revealImage = [NSImage imageNamed: revealImageString];
     [revealImage setFlipped: YES];
     [revealImage drawInRect: [self revealButtonRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver
-        fraction: 1.0];
+        fraction: 1.0f];
     
     //action button
     NSString * actionImageString;
         NSImage * actionImage = [NSImage imageNamed: actionImageString];
         [actionImage setFlipped: YES];
         [actionImage drawInRect: [self actionButtonRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver
-            fraction: 1.0];
+            fraction: 1.0f];
     }
     
     //status
 
 - (void) drawBar: (NSRect) barRect
 {
-    float piecesBarPercent = [(TorrentTableView *)[self controlView] piecesBarPercent];
-    if (piecesBarPercent > 0.0)
+    CGFloat piecesBarPercent = [(TorrentTableView *)[self controlView] piecesBarPercent];
+    if (piecesBarPercent > 0.0f)
     {
         NSRect regularBarRect = barRect, piecesBarRect = barRect;
         piecesBarRect.size.height *= PIECES_TOTAL_PERCENT * piecesBarPercent;
     }
     
     [fBarBorderColor set];
-    [NSBezierPath strokeRect: NSInsetRect(barRect, 0.5, 0.5)];
+    [NSBezierPath strokeRect: NSInsetRect(barRect, 0.5f, 0.5f)];
 }
 
 - (void) drawRegularBar: (NSRect) barRect
 {
     Torrent * torrent = [self representedObject];
     
-    int leftWidth = barRect.size.width;
-    float progress = [torrent progress];
+    NSInteger leftWidth = barRect.size.width;
+    CGFloat progress = [torrent progress];
     
-    if (progress < 1.0)
+    if (progress < 1.0f)
     {
-        float rightProgress = 1.0 - progress, progressLeft = [torrent progressLeft];
-        int rightWidth = leftWidth * rightProgress;
+        CGFloat rightProgress = 1.0f - progress, progressLeft = [torrent progressLeft];
+        NSInteger rightWidth = leftWidth * rightProgress;
         leftWidth -= rightWidth;
         
         if (progressLeft < rightProgress)
         {
-            int rightNoIncludeWidth = rightWidth * ((rightProgress - progressLeft) / rightProgress);
+            NSInteger rightNoIncludeWidth = rightWidth * ((rightProgress - progressLeft) / rightProgress);
             rightWidth -= rightNoIncludeWidth;
             
             NSRect noIncludeRect = barRect;
             if ([torrent isActive] && ![torrent allDownloaded] && ![torrent isChecking]
                 && [fDefaults boolForKey: @"DisplayProgressBarAvailable"])
             {
-                int notAvailableWidth = ceil(rightWidth * [torrent notAvailableDesired]);
+                NSInteger notAvailableWidth = ceil(rightWidth * [torrent notAvailableDesired]);
                 if (notAvailableWidth > 0)
                 {
                     rightWidth -= notAvailableWidth;
                 [[CTGradient progressYellowGradient] fillRect: completeRect angle: 90];
             else if ([torrent isSeeding])
             {
-                int ratioLeftWidth = leftWidth * (1.0 - [torrent progressStopRatio]);
+                NSInteger ratioLeftWidth = leftWidth * (1.0f - [torrent progressStopRatio]);
                 leftWidth -= ratioLeftWidth;
                 
                 if (ratioLeftWidth > 0)
         {
             if ([torrent waitingToStart])
             {
-                if ([torrent progressLeft] <= 0.0)
+                if ([torrent progressLeft] <= 0.0f)
                     [[CTGradient progressDarkGreenGradient] fillRect: completeRect angle: 90];
                 else
                     [[CTGradient progressDarkBlueGradient] fillRect: completeRect angle: 90];
 {
     Torrent * torrent = [self representedObject];
     
-    int pieceCount = MIN([torrent pieceCount], MAX_PIECES);
-    float * piecesPercent = malloc(pieceCount * sizeof(float));
+    NSInteger pieceCount = MIN([torrent pieceCount], MAX_PIECES);
+    CGFloat * piecesPercent = malloc(pieceCount * sizeof(CGFloat));
     [torrent getAmountFinished: piecesPercent size: pieceCount];
     
     NSBitmapImageRep * bitmap = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes: nil
     for (NSInteger i = 0; i < pieceCount; i++)
     {
         NSColor * pieceColor;
-        if (piecesPercent[i] == 1.0)
+        if (piecesPercent[i] == 1.0f)
         {
             if (previousFinishedIndexes && ![previousFinishedIndexes containsIndex: i])
                 pieceColor = [NSColor orangeColor];