Commits

Stephen Holt  committed b477c95

fix some implicit conversions and off-by-half-pixel errors in the adium tabs

  • Participants
  • Parent commits 646a982

Comments (0)

Files changed (11)

File PSMTabBarControl.xcodeproj/project.pbxproj

 		A251BEA40959BB5C0058BC7F /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ARCHS = "$(NATIVE_ARCH_ACTUAL)";
 				COPY_PHASE_STRIP = NO;
 				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_DYNAMIC_NO_PIC = NO;
 		C056398008A954F8003078D8 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				ARCHS = "$(NATIVE_ARCH_ACTUAL)";
 				COPY_PHASE_STRIP = NO;
 				DYLIB_COMPATIBILITY_VERSION = 1;
 				DYLIB_CURRENT_VERSION = 1;

File source/NSBezierPath_AMShading.m

 static void bilinearShadedColor(void *info, const CGFloat *in, CGFloat *out)
 {
 	CGFloat *colors = (CGFloat *)info;
-	CGFloat factor = (*in)*2.0;
+	CGFloat factor = (*in)*2.0f;
 	if (*in > 0.5) {
 		factor = 2-factor;
 	}

File source/PSMAdiumTabStyle.m

 
 #define Adium_CellPadding 2
 #define Adium_MARGIN_X 4
-#define kPSMAdiumCounterPadding 3.0
-#define kPSMAdiumObjectCounterRadius 7.0
+#define kPSMAdiumCounterPadding 3.0f
+#define kPSMAdiumObjectCounterRadius 7.0f
 #define kPSMAdiumCounterMinWidth 20
 
 #define kPSMTabBarControlSourceListHeight	28
 		_drawsRight = NO;
         
         _objectCountStringAttributes = [[NSDictionary alloc] initWithObjectsAndKeys:[[NSFontManager sharedFontManager] convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask], NSFontAttributeName,
-																					[[NSColor whiteColor] colorWithAlphaComponent:0.85], NSForegroundColorAttributeName,
+																					[[NSColor whiteColor] colorWithAlphaComponent:0.85f], NSForegroundColorAttributeName,
 																					nil, nil];
     }
     return self;
 		case PSMTabBarHorizontalOrientation:
 		{
 			result.origin.x = cellFrame.origin.x + Adium_MARGIN_X;
-			result.origin.y = cellFrame.origin.y + MARGIN_Y + 2.0;
+			result.origin.y = cellFrame.origin.y + MARGIN_Y + 2.0f;
 			if ([cell state] == NSOnState) {
 				result.origin.y -= 1;
 			}
 	cellFrame = [cell frame];
 	result.size = [self sizeForObjectCounterRectForTabCell:cell];
 	result.origin.x = NSMaxX(cellFrame) - Adium_MARGIN_X - result.size.width;
-	result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0;
+	result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0f;
 
 	if (![[cell indicator] isHidden]) {
 		result.origin.x -= kPSMTabBarIndicatorWidth + Adium_CellPadding;
 	// right margin
 	resultWidth += Adium_MARGIN_X;
 
-	return ceil(resultWidth);
+	return (CGFloat)ceil(resultWidth);
 }
 
 - (CGFloat)desiredWidthOfTabCell:(PSMTabBarCell *)cell
 	// right margin
 	resultWidth += Adium_MARGIN_X;
 
-	return ceil(resultWidth);
+	return (CGFloat)ceil(resultWidth);
 }
 
 - (CGFloat)tabCellHeight
 		[cache removeAllObjects];
 	NSNumber *cachedHeight = [cache objectForKey:inAttributedString];
 	if (cachedHeight)
-		return [cachedHeight doubleValue];
+		return [cachedHeight floatValue];
 	else {
 		NSTextStorage		*textStorage = [[NSTextStorage alloc] initWithAttributedString:inAttributedString];
 		NSTextContainer 	*textContainer = [[NSTextContainer alloc] initWithContainerSize:NSMakeSize(width, 1e7)];
 		NSLayoutManager 	*layoutManager = [[NSLayoutManager alloc] init];
 		
 		//Configure
-		[textContainer setLineFragmentPadding:0.0];
+		[textContainer setLineFragmentPadding:0.0f];
 		[layoutManager addTextContainer:textContainer];
 		[textStorage addLayoutManager:layoutManager];
 		
     myRect.size.width -= kPSMAdiumCounterPadding;
     myRect.origin.x += kPSMAdiumCounterPadding;
     
-	[[cell countColor] ?: [NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set];
+	[[cell countColor] ?: [NSColor colorWithCalibratedWhite:0.3f alpha:0.6f] set];
 	NSBezierPath *path = [NSBezierPath bezierPath];
-	[path setLineWidth:1.0];
+	[path setLineWidth:1.0f];
 	
 	if ([cell state] == NSOnState) {
-		myRect.origin.y -= 1.0;
+		myRect.origin.y -= 1.0f;
 	}
 	
 	[path moveToPoint:NSMakePoint(NSMinX(myRect) + kPSMAdiumObjectCounterRadius, NSMinY(myRect))];
 	[path lineToPoint:NSMakePoint(NSMaxX(myRect) - kPSMAdiumObjectCounterRadius, NSMinY(myRect))];
 	[path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(myRect) - kPSMAdiumObjectCounterRadius, NSMinY(myRect) + kPSMAdiumObjectCounterRadius) 
 									 radius:kPSMAdiumObjectCounterRadius
-								 startAngle:270.0
-								   endAngle:90.0];
+								 startAngle:270.0f
+								   endAngle:90.0f];
 	[path lineToPoint:NSMakePoint(NSMinX(myRect) + kPSMAdiumObjectCounterRadius, NSMaxY(myRect))];
 	[path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(myRect) + kPSMAdiumObjectCounterRadius, NSMinY(myRect) + kPSMAdiumObjectCounterRadius) 
 									 radius:kPSMAdiumObjectCounterRadius
-								 startAngle:90.0
-								   endAngle:270.0];
+								 startAngle:90.0f
+								   endAngle:270.0f];
 	[path fill];
 	
 	// draw attributed string centered in area
 	NSRect counterStringRect;
 	NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell];
 	counterStringRect.size = [counterString size];
-	counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25;
-	counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5;
+	counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0f) + 0.25f;
+	counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0f) + 0.5f;
 	[counterString drawInRect:counterStringRect];
 }
 
 		//Use a transform to draw an arbitrary image in our flipped view
 		NSAffineTransform *transform = [NSAffineTransform transform];
 		[transform translateXBy:imageDrawingRect.origin.x yBy:(imageDrawingRect.origin.y + imageDrawingRect.size.height)];
-		[transform scaleXBy:1.0 yBy:-1.0];
+		[transform scaleXBy:1.0f yBy:-1.0f];
 		[transform concat];
 
 		imageDrawingRect.origin = NSMakePoint(0,0);
 		
 		//Create Rounding.
-		CGFloat userIconRoundingRadius = (kPSMTabBarLargeImageWidth / 4.0);
+		CGFloat userIconRoundingRadius = (kPSMTabBarLargeImageWidth / 4.0f);
 		if (userIconRoundingRadius > 3) userIconRoundingRadius = 3;
 		NSBezierPath	*clipPath = [self bezierPathWithRoundedRect:imageDrawingRect radius:userIconRoundingRadius];
 		[clipPath addClip];
 		[image drawInRect:imageDrawingRect
 				 fromRect:NSMakeRect(0, 0, [image size].width, [image size].height)
 				operation:NSCompositeSourceOver
-				 fraction:1.0];
+				 fraction:1.0f];
 
 		[NSGraphicsContext restoreGraphicsState];
 
 	switch (orientation)
 	{
 		case PSMTabBarHorizontalOrientation:
-			labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0;
+			labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0f;
 			break;
 		case PSMTabBarVerticalOrientation:
 			labelRect.origin.y = cellFrame.origin.y;
 			drawingRect.origin.y += drawingRect.size.height;
 		}
 
-		[closeButtonOrIcon compositeToPoint:drawingRect.origin operation:NSCompositeSourceOver fraction:1.0];
+		[closeButtonOrIcon compositeToPoint:drawingRect.origin operation:NSCompositeSourceOver fraction:1.0f];
 		
 		// scoot label over
 		switch (orientation)
 			iconRect.origin.y += iconRect.size.height;
 		}
 
-		[icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0];
+		[icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0f];
 		
 		// scoot label over by the size of the standard close button
 		switch (orientation)
 		//Calculate the centered rect
 		CGFloat stringHeight = [self heightOfAttributedString:attributedString withWidth:NSWidth(labelRect)];
 		if (stringHeight < labelRect.size.height) {
-			labelRect.origin.y += (NSHeight(labelRect) - stringHeight) / 2.0;
+			labelRect.origin.y += (NSHeight(labelRect) - stringHeight) / 2.0f;
 		}		
 	}
 
 	[[NSGraphicsContext currentContext] setShouldAntialias:NO];
 	
 	NSShadow *shadow = [[NSShadow alloc] init];
-	[shadow setShadowOffset:NSMakeSize(-2, -2)];
+	[shadow setShadowOffset:NSMakeSize(-1.5f, -1.5f)];
 	[shadow setShadowBlurRadius:2];
-	[shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.6 alpha:1.0]];
+	[shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.6f alpha:1.0f]];
 
 	if ([cell state] == NSOnState) {
 		// selected tab
 		if (orientation == PSMTabBarHorizontalOrientation) {
-			NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, NSWidth(cellFrame), cellFrame.size.height - 2.5);
+			NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, NSWidth(cellFrame), cellFrame.size.height - 2.5f);
 			
 			// background
 			if (_drawsUnified) {
 				if ([[[tabBar tabView] window] isKeyWindow]) {
 					NSBezierPath *path = [NSBezierPath bezierPathWithRect:aRect];
-					[path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0]
-												endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]];
+					[path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835f alpha:1.0f]
+												endColor:[NSColor colorWithCalibratedWhite:0.843f alpha:1.0f]];
 				} else {
 					[[NSColor windowBackgroundColor] set];
 					NSRectFill(aRect);
 				}
 			} else {
-				[_gradientImage drawInRect:NSMakeRect(NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)) fromRect:NSMakeRect(0, 0, [_gradientImage size].width, [_gradientImage size].height) operation:NSCompositeSourceOver fraction:1.0];
+				[_gradientImage drawInRect:NSMakeRect(NSMinX(aRect), NSMinY(aRect), NSWidth(aRect), NSHeight(aRect)) fromRect:NSMakeRect(0, 0, [_gradientImage size].width, [_gradientImage size].height) operation:NSCompositeSourceOver fraction:1.0f];
 			}
 			
 			// frame
 			[lineColor set];
-			[bezier setLineWidth:1.0];
+			[bezier setLineWidth:1.0f];
 			[bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)];
 			[bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y + aRect.size.height)];
 			
-			[shadow setShadowOffset:NSMakeSize(-2, -2)];
+			[shadow setShadowOffset:NSMakeSize(-1.5f, -1.5f)];
 			[shadow set];
 			[bezier stroke];
 			
 			bezier = [NSBezierPath bezierPath];
-			[bezier setLineWidth:1.0];
+			[bezier setLineWidth:1.0f];
 			[bezier moveToPoint:NSMakePoint(NSMinX(aRect), NSMaxY(aRect))];
 			[bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect))];
 			[bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMinY(aRect))];
 			
 			if ([[cell controlView] frame].size.height < 2) {
 				// special case of hidden control; need line across top of cell
-				[bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y + 0.5)];
-				[bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y + 0.5)];
+				[bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y + 0.5f)];
+				[bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y + 0.5f)];
 			}
 			
-			[shadow setShadowOffset:NSMakeSize(2, -2)];
+			[shadow setShadowOffset:NSMakeSize(1.5f, -1.5f)];
 			[shadow set];
 			[bezier stroke];
 		} else {
 			if (_drawsUnified) {
 				if ([[[tabBar tabView] window] isKeyWindow]) {
 					NSBezierPath *path = [NSBezierPath bezierPathWithRect:aRect];
-					[path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0]
-												endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]];
+					[path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835f alpha:1.0f]
+												endColor:[NSColor colorWithCalibratedWhite:0.843f alpha:1.0f]];
 				} else {
 					[[NSColor windowBackgroundColor] set];
 					NSRectFill(aRect);
 			} else {
 				NSBezierPath *path = [NSBezierPath bezierPathWithRect:aRect];
 				if (_drawsRight) {
-					[path linearVerticalGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.92 alpha:1.0]
-														  endColor:[NSColor colorWithCalibratedWhite:0.98 alpha:1.0]];
+					[path linearVerticalGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.92f alpha:1.0f]
+														  endColor:[NSColor colorWithCalibratedWhite:0.98f alpha:1.0f]];
 				} else {
-					[path linearVerticalGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.98 alpha:1.0]
-														  endColor:[NSColor colorWithCalibratedWhite:0.92 alpha:1.0]];					
+					[path linearVerticalGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.98f alpha:1.0]
+														  endColor:[NSColor colorWithCalibratedWhite:0.92f alpha:1.0f]];					
 				}
 			}
 			
 				//Bottom
 				[bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect))];
 			}
-			[shadow setShadowOffset:NSMakeSize((_drawsRight ? 2 : -2), -2)];
+			[shadow setShadowOffset:NSMakeSize((_drawsRight ? 1.5f : -1.5f), -1.5f)];
 			[shadow set];
 			[bezier stroke];
 		}
 		
 		// rollover
 		if ([cell isHighlighted]) {
-			[[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set];
+			[[NSColor colorWithCalibratedWhite:0.0f alpha:0.1f] set];
 			NSRectFillUsingOperation(aRect, NSCompositeSourceAtop);
 		}
 		
 			if (_drawsUnified && [[[tabBar tabView] window] isKeyWindow]) {
 				if ([[[tabBar tabView] window] isKeyWindow]) {
 					NSBezierPath *backgroundPath = [NSBezierPath bezierPathWithRect:rect];
-					[backgroundPath linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835 alpha:1.0]
-															endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]];
+					[backgroundPath linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.835f alpha:1.0f]
+															endColor:[NSColor colorWithCalibratedWhite:0.843f alpha:1.0f]];
 				} else {
 					[[NSColor windowBackgroundColor] set];
 					NSRectFill(rect);
 				}
 			} else {
-				[[NSColor colorWithCalibratedWhite:0.85 alpha:0.6] set];
+				[[NSColor colorWithCalibratedWhite:0.85f alpha:0.6f] set];
 				[NSBezierPath fillRect:rect];
 			}
 			break;
 
 		case PSMTabBarVerticalOrientation:
 			//This is the Mail.app source list background color... which differs from the iTunes one.
-			[[NSColor colorWithCalibratedRed:.9059
-									   green:.9294
-										blue:.9647
-									   alpha:1.0] set];
+			[[NSColor colorWithCalibratedRed:.9059f
+									   green:.9294f
+										blue:.9647f
+									   alpha:1.0f] set];
 			NSRectFill(rect);
 			break;
 	}			
 
 	NSShadow *shadow = [[NSShadow alloc] init];
 	[shadow setShadowBlurRadius:2];
-	[shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.6 alpha:1.0]];
+	[shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.6f alpha:1.0f]];
 	
 	[[NSColor grayColor] set];
 	
 	NSBezierPath *path = [NSBezierPath bezierPath];
-	[path setLineWidth:1.0];
+	[path setLineWidth:1.0f];
 				
 	switch (orientation) {
 		case PSMTabBarHorizontalOrientation:
 			rect.origin.y++;
 			[path moveToPoint:NSMakePoint(rect.origin.x, rect.origin.y)];
 			[path lineToPoint:NSMakePoint(rect.origin.x + rect.size.width, rect.origin.y)];
-			[shadow setShadowOffset:NSMakeSize(2, -2)];
+			[shadow setShadowOffset:NSMakeSize(2, -1.5f)];
 			
 			[shadow set];
 			[path stroke];
 			if (_drawsRight) {
 				startPoint = NSMakePoint(NSMinX(rect), NSMinY(rect));
 				endPoint = NSMakePoint(NSMinX(rect), NSMaxY(rect));
-				shadowOffset = NSMakeSize(2, -2);
+				shadowOffset = NSMakeSize(1.5f, -1.5f);
 			} else {
 				startPoint = NSMakePoint(NSMaxX(rect) - 1, NSMinY(rect));
 				endPoint = NSMakePoint(NSMaxX(rect) - 1, NSMaxY(rect));
-				shadowOffset = NSMakeSize(-2, -2);
+				shadowOffset = NSMakeSize(-1.5f, -1.5f);
 			}
 				
 			[path moveToPoint:startPoint];
 			//Draw top horizontal shadow
 			startPoint = NSMakePoint(NSMinX(rect), NSMinY(rect));
 			endPoint = NSMakePoint(NSMaxX(rect), NSMinY(rect));
-			shadowOffset = NSMakeSize(0, -1);
+			shadowOffset = NSMakeSize(0, -1.5f);
 			
 			[path moveToPoint:startPoint];
 			[path lineToPoint:endPoint];

File source/PSMOverflowPopUpButton.m

 			drawPoint.y += altImageSize.height;
 		}
 		
-		[[self alternateImage] compositeToPoint:drawPoint operation:NSCompositeSourceOver fraction:sin(_animationValue * M_PI)];
+		[[self alternateImage] compositeToPoint:drawPoint operation:NSCompositeSourceOver fraction:(CGFloat)sin(_animationValue * M_PI)];
 	}
 }
 

File source/PSMTabBarCell.m

 - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
 {
     if (_isPlaceholder) {
-        [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set];
+        [[NSColor colorWithCalibratedWhite:0.0f alpha:0.2f] set];
         NSRectFillUsingOperation(cellFrame, NSCompositeSourceAtop);
         return;
     }

File source/PSMTabBarControl.h

 #define kPSMTabBarCellPadding 4
 // fixed size objects
 #define kPSMMinimumTitleWidth 30
-#define kPSMTabBarIndicatorWidth 16.0
-#define kPSMTabBarIconWidth 16.0
-#define kPSMHideAnimationSteps 3.0
+#define kPSMTabBarIndicatorWidth 16.0f
+#define kPSMTabBarIconWidth 16.0f
+#define kPSMHideAnimationSteps 3.0f
 
 // Value used in _currentStep to indicate that resizing operation is not in progress
 #define kPSMIsNotBeingResized -1

File source/PSMTabBarControl.m

     // moves the frame of the tab bar and window (or partner view) linearly to hide or show the tab bar
     NSRect myFrame = [self frame];
 	NSDictionary *userInfo = [timer userInfo];
-    CGFloat myCurrentOrigin = ([[userInfo objectForKey:@"myOriginalOrigin"] doubleValue] + (([[userInfo objectForKey:@"myTargetOrigin"] doubleValue] - [[userInfo objectForKey:@"myOriginalOrigin"] doubleValue]) * (_currentStep/kPSMHideAnimationSteps)));
-    CGFloat myCurrentSize = ([[userInfo objectForKey:@"myOriginalSize"] doubleValue] + (([[userInfo objectForKey:@"myTargetSize"] doubleValue] - [[userInfo objectForKey:@"myOriginalSize"] doubleValue]) * (_currentStep/kPSMHideAnimationSteps)));
-    CGFloat partnerCurrentOrigin = ([[userInfo objectForKey:@"partnerOriginalOrigin"] doubleValue] + (([[userInfo objectForKey:@"partnerTargetOrigin"] doubleValue] - [[userInfo objectForKey:@"partnerOriginalOrigin"] doubleValue]) * (_currentStep/kPSMHideAnimationSteps)));
-    CGFloat partnerCurrentSize = ([[userInfo objectForKey:@"partnerOriginalSize"] doubleValue] + (([[userInfo objectForKey:@"partnerTargetSize"] doubleValue] - [[userInfo objectForKey:@"partnerOriginalSize"] doubleValue]) * (_currentStep/kPSMHideAnimationSteps)));
+    CGFloat myCurrentOrigin = ([[userInfo objectForKey:@"myOriginalOrigin"] floatValue] + (([[userInfo objectForKey:@"myTargetOrigin"] floatValue] - [[userInfo objectForKey:@"myOriginalOrigin"] floatValue]) * (_currentStep/kPSMHideAnimationSteps)));
+    CGFloat myCurrentSize = ([[userInfo objectForKey:@"myOriginalSize"] floatValue] + (([[userInfo objectForKey:@"myTargetSize"] floatValue] - [[userInfo objectForKey:@"myOriginalSize"] floatValue]) * (_currentStep/kPSMHideAnimationSteps)));
+    CGFloat partnerCurrentOrigin = ([[userInfo objectForKey:@"partnerOriginalOrigin"] floatValue] + (([[userInfo objectForKey:@"partnerTargetOrigin"] floatValue] - [[userInfo objectForKey:@"partnerOriginalOrigin"] floatValue]) * (_currentStep/kPSMHideAnimationSteps)));
+    CGFloat partnerCurrentSize = ([[userInfo objectForKey:@"partnerOriginalSize"] floatValue] + (([[userInfo objectForKey:@"partnerTargetSize"] floatValue] - [[userInfo objectForKey:@"partnerOriginalSize"] floatValue]) * (_currentStep/kPSMHideAnimationSteps)));
     
 	NSRect myNewFrame;
 	if ([self orientation] == PSMTabBarHorizontalOrientation) {

File source/PSMTabBarController.m

         _addButtonRect.origin.x += [[cellWidths valueForKeyPath:@"@sum.floatValue"] doubleValue] + 2;
     } else {
         _addButtonRect.origin.x = 0;
-        _addButtonRect.origin.y = [[cellWidths lastObject] doubleValue];
+        _addButtonRect.origin.y = [[cellWidths lastObject] floatValue];
     }	
 }
 
 		changed = NO;
 		
 		for (NSInteger q = (count - 1); q >= 0; q--) {
-			CGFloat cellWidth = [[newWidths objectAtIndex:q] doubleValue];
+			CGFloat cellWidth = [[newWidths objectAtIndex:q] floatValue];
 			if (cellWidth - 1 >= minimum) {
 				cellWidth--;
 				totalWidths--;
 				width = [_control cellOptimumWidth];
 			}
 			
-			width = ceil(width);
+			width = (CGFloat)ceil(width);
 			
 			//check to see if there is not enough space to place all tabs as preferred
 			if (totalOccupiedWidth + width >= availableWidth) {
 				
 				//If we're not going to use the overflow menu, cram all the tab cells into the bar regardless of minimum width
 				if (![_control useOverflowMenu]) {
-					NSInteger j, averageWidth = (availableWidth / cellCount);
+					NSInteger j, averageWidth = (NSInteger)floor(availableWidth / cellCount);
 					
 					numberOfVisibleCells = cellCount;
 					[newWidths removeAllObjects];
 							/* We're not using all available space not but exceeded available width before;
 							 * stretch all cells to fully fit the bar
 							 */
-							NSInteger leftoverWidth = availableWidth - totalOccupiedWidth;
+							CGFloat leftoverWidth = availableWidth - totalOccupiedWidth;
 							if (leftoverWidth > 0) {
 								NSInteger q;
 								for (q = numberOfVisibleCells - 1; q >= 0; q--) {
 
 					} else {
 						// stretch - distribute leftover room among cells, since we can't add this cell
-						NSInteger leftoverWidth = availableWidth - totalOccupiedWidth;
+						CGFloat leftoverWidth = availableWidth - totalOccupiedWidth;
 						NSInteger q;
 						for (q = i - 1; q >= 0; q--) {
 							NSInteger desiredAddition = (NSInteger)leftoverWidth / (q + 1);
 
 				} else {
 					//We're not using size-to-fit
-					NSInteger revisedWidth = availableWidth / (i + 1);
+					CGFloat revisedWidth = availableWidth / (i + 1);
 					if (revisedWidth >= [_control cellMinWidth]) {
 						NSUInteger q;
 						totalOccupiedWidth = 0;
             
             // set cell frame
             if ([_control orientation] == PSMTabBarHorizontalOrientation) {
-                cellRect.size.width = [[widths objectAtIndex:i] doubleValue];
+                cellRect.size.width = [[widths objectAtIndex:i] floatValue];
             } else {
                 cellRect.size.width = [_control frame].size.width;
-                cellRect.origin.y = [[widths objectAtIndex:i] doubleValue];
+                cellRect.origin.y = [[widths objectAtIndex:i] floatValue];
                 cellRect.origin.x = 0;
             }
             

File source/PSMTabDragAssistant.m

         NSInteger thisWidth = (NSInteger)(cellStepSize - ((cellStepSize/2.0) + ((sin((PI/2.0) + ((CGFloat)i/(CGFloat)kPSMTabDragAnimationSteps)*PI) * cellStepSize) / 2.0)));
         [_sineCurveWidths addObject:[NSNumber numberWithInteger:thisWidth]];
     }
-	[_sineCurveWidths addObject:[NSNumber numberWithInteger:([control orientation] == PSMTabBarHorizontalOrientation) ? cellFrame.size.width : cellFrame.size.height]];
+	[_sineCurveWidths addObject:[NSNumber numberWithInteger:([control orientation] == PSMTabBarHorizontalOrientation) ? (NSInteger)cellFrame.size.width : (NSInteger)cellFrame.size.height]];
     
     // hide UI buttons
     [[control overflowPopUpButton] setHidden:YES];
 	
 	NSAnimation *animation = [[NSAnimation alloc] initWithDuration:0.25 animationCurve:NSAnimationEaseInOut];
 	[animation setAnimationBlockingMode:NSAnimationNonblocking];
-	[animation setCurrentProgress:0.1];
+	[animation setCurrentProgress:0.1f];
 	[animation startAnimation];
 	NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.0 / 30.0 target:self selector:@selector(_expandWindowTimerFired:) userInfo:[NSDictionary dictionaryWithObjectsAndKeys:window, @"Window", animation, @"Animation", nil] repeats:YES];
 	[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSEventTrackingRunLoopMode];
 	NSPoint translation;
 	NSRect winFrame = [window frame];
 	
-	translation.x = (winFrame.size.width / 2.0);
-	translation.y = (winFrame.size.height / 2.0);
+	translation.x = (winFrame.size.width / 2.0f);
+	translation.y = (winFrame.size.height / 2.0f);
 	transform = CGAffineTransformMakeTranslation(translation.x, translation.y);
-	transform = CGAffineTransformScale(transform, 1.0 / [animation currentValue], 1.0 / [animation currentValue]);
+	transform = CGAffineTransformScale(transform, 1.0f / [animation currentValue], 1.0f / [animation currentValue]);
 	transform = CGAffineTransformTranslate(transform, -translation.x, -translation.y);
 	
 	translation.x = -winFrame.origin.x;

File source/PSMTabDragWindowController.h

 #import <Cocoa/Cocoa.h>
 #import "PSMTabBarControl.h"
 
-#define kPSMTabDragWindowAlpha 0.75
-#define kPSMTabDragAlphaInterval 0.15
+#define kPSMTabDragWindowAlpha 0.75f
+#define kPSMTabDragAlphaInterval 0.15f
 
 @class PSMTabDragView;
 

File source/PSMTabDragWindowController.m

 	}
 	
 	//begin animating
-	_animation = [[NSAnimation alloc] initWithDuration:0.25 animationCurve:NSAnimationEaseInOut];
+	_animation = [[NSAnimation alloc] initWithDuration:0.25f animationCurve:NSAnimationEaseInOut];
 	[_animation setAnimationBlockingMode:NSAnimationNonblocking];
-	[_animation setCurrentProgress:progress];
+	[_animation setCurrentProgress:(float)progress];
 	[_animation startAnimation];
 	
 	_originalWindowFrame = [[self window] frame];