adium 3061:191c377fb84d: Enable a number of stricter compiler wa...

commits at adium.im commits at adium.im
Wed Dec 23 20:11:38 UTC 2009


details:	http://hg.adium.im/adium/rev/191c377fb84d
revision:	3061:191c377fb84d
author:		Stephen Holt <sholt at adium.im>
date:		Wed Dec 23 09:51:14 2009 -0500

Enable a number of stricter compiler warnings.  "Hoseyifying," is you will.

Some things (automatic static analysis, warnings as errors) are still off.  We should aim to enable these.
Sure, this looks ugly now, but hopefully it helps prevent subtle bugs and sloppy code in the future.
Subject: adium 3062:e04a00f58ce6: Fixing implicit 64->32 bit casts in AIUtilities.

details:	http://hg.adium.im/adium/rev/e04a00f58ce6
revision:	3062:e04a00f58ce6
author:		Stephen Holt <sholt at adium.im>
date:		Wed Dec 23 12:42:51 2009 -0500

Fixing implicit 64->32 bit casts in AIUtilities.

Some of this includes throwing an assertion if a length (which can be a long on LP64) is larger than a UInt32 it's getting passed to (I'm looking at you, keychain).

diffs (truncated from 2743 to 1000 lines):

diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.m
--- a/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.m	Wed Dec 23 12:42:51 2009 -0500
@@ -129,10 +129,10 @@
 	unsigned	rectNumber = 0;
 	
 	//Setup
-	unsigned numberOfRows = [self numberOfRows];
-	unsigned rowHeight = [self rowHeight];
+	NSInteger numberOfRows = [self numberOfRows];
+	CGFloat rowHeight = [self rowHeight];
     
-	NSRectArray gridRects = (NSRectArray)alloca(sizeof(NSRect) * (numberOfRows + ((int)round(((rect.size.height / rowHeight) / 2) + 0.5))));
+	NSRectArray gridRects = (NSRectArray)alloca(sizeof(NSRect) * (numberOfRows + ((NSInteger)round(((rect.size.height / rowHeight) / 2) + 0.5))));
 	for (unsigned row = 0; row < numberOfRows; row += 2) {
 		if (row < numberOfRows) {
 			NSRect	thisRect = [self rectOfRow:row];
@@ -167,9 +167,9 @@
 
 	if (drawsGradientSelection && [[self window] isKeyWindow] && ([[self window] firstResponder] == self)) {
 		NSIndexSet *indices = [self selectedRowIndexes];
-		unsigned int bufSize = [indices count];
+		NSUInteger bufSize = [indices count];
 		NSUInteger *buf = malloc(bufSize * sizeof(NSUInteger));
-		unsigned int i = 0, j = 0;
+		NSUInteger i = 0, j = 0;
 
 		NSGradient *gradient = [NSGradient selectedControlGradient];
 		
@@ -179,8 +179,8 @@
 		NSRect *selectionLineRects = (NSRect *)malloc(sizeof(NSRect) * bufSize);
 		
 		while (i < bufSize) {
-			int startIndex = buf[i];
-			int lastIndex = buf[i];
+			NSUInteger startIndex = buf[i];
+			NSUInteger lastIndex = buf[i];
 
 			while ((i + 1 < bufSize) &&
 				   (buf[i + 1] == lastIndex + 1)){
@@ -252,8 +252,8 @@
 {
     NSEnumerator	*enumerator;
     NSTableColumn	*column;
-    float		xPos = 0.5;
-    int			intercellWidth = [self intercellSpacing].width;
+    CGFloat		xPos = 0.5;
+    CGFloat			intercellWidth = [self intercellSpacing].width;
     
     [[self gridColor] set];
     [NSBezierPath setDefaultLineWidth:1.0];
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIArrayAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.m	Wed Dec 23 12:42:51 2009 -0500
@@ -99,7 +99,7 @@
 
 - (void)moveObject:(id)object toIndex:(unsigned)newIndex
 {
-	unsigned	currentIndex = [self indexOfObject:object];
+	NSUInteger	currentIndex = [self indexOfObject:object];
 	
 	//if we're already there, do no work
 	if (currentIndex == newIndex) 
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.h	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.h	Wed Dec 23 12:42:51 2009 -0500
@@ -44,7 +44,7 @@
  * @param searchRange The range in which to search
  * @return Returns the number of replacements made
  */
-- (unsigned int)replaceOccurrencesOfString:(NSString *)target withString:(NSString*)replacement options:(unsigned)opts range:(NSRange)searchRange;
+- (NSUInteger)replaceOccurrencesOfString:(NSString *)target withString:(NSString*)replacement options:(NSStringCompareOptions)opts range:(NSRange)searchRange;
 
 /*!
  * @brief Find and replace on an attributed string setting the attributes of the replacements
@@ -57,7 +57,7 @@
  * @param searchRange The range in which to search
  * @return Returns the number of replacements made
  */
-- (unsigned int)replaceOccurrencesOfString:(NSString *)target withString:(NSString*)replacement attributes:(NSDictionary*)attributes options:(unsigned)opts range:(NSRange)searchRange;
+- (NSUInteger)replaceOccurrencesOfString:(NSString *)target withString:(NSString*)replacement attributes:(NSDictionary*)attributes options:(NSStringCompareOptions)opts range:(NSRange)searchRange;
 
 /*!
  * @brief Apply color adjustments for a background
@@ -154,7 +154,7 @@
  * @param attributes An <tt>NSDictionary</tt> of attributes
  * @return The needed height, as a float
  */
-+ (float)stringHeightForAttributes:(NSDictionary *)attributes;
++ (CGFloat)stringHeightForAttributes:(NSDictionary *)attributes;
 
 /*!
  * @brief Determine the height needed for display at a width
@@ -163,7 +163,7 @@
  * @param width The available width for display
  * @return The needed height, as a float
  */
-- (float)heightWithWidth:(float)width;
+- (CGFloat)heightWithWidth:(CGFloat)width;
 
 /*!
  * @brief Encode to <tt>NSData</tt>
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.m	Wed Dec 23 12:42:51 2009 -0500
@@ -45,10 +45,10 @@
     [tempString release];
 }
 
-- (unsigned int)replaceOccurrencesOfString:(NSString *)target withString:(NSString*)replacement options:(unsigned)opts range:(NSRange)searchRange
+- (NSUInteger)replaceOccurrencesOfString:(NSString *)target withString:(NSString*)replacement options:(NSStringCompareOptions)opts range:(NSRange)searchRange
 {
     NSRange		theRange;
-    unsigned	numberOfReplacements = 0, replacementLength = [replacement length];
+    NSUInteger	numberOfReplacements = 0, replacementLength = [replacement length];
 
     while ( (theRange = [[self string] rangeOfString:target 
 											 options:opts
@@ -64,10 +64,10 @@
     return numberOfReplacements;
 }
 
-- (unsigned int)replaceOccurrencesOfString:(NSString *)target withString:(NSString*)replacement attributes:(NSDictionary*)attributes options:(unsigned)opts range:(NSRange)searchRange
+- (NSUInteger)replaceOccurrencesOfString:(NSString *)target withString:(NSString*)replacement attributes:(NSDictionary*)attributes options:(NSStringCompareOptions)opts range:(NSRange)searchRange
 {
     NSRange				theRange;
-    unsigned			numberOfReplacements = 0, replacementLength = [replacement length];
+    NSUInteger			numberOfReplacements = 0, replacementLength = [replacement length];
     NSAttributedString	*replacementString = [[NSAttributedString alloc] initWithString:replacement 
 																			 attributes:attributes];
     
@@ -94,9 +94,9 @@
 //adjust the colors in the string so they're visible on the background
 - (void)adjustColorsToShowOnBackground:(NSColor *)backgroundColor
 {
-    int		index = 0;
-    int		stringLength = [self length];
-    float	backgroundBrightness, backgroundSum;
+    NSUInteger		index = 0;
+    NSUInteger		stringLength = [self length];
+    CGFloat	backgroundBrightness, backgroundSum;
     
     //--get the brightness of our background--
     backgroundColor = [backgroundColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
@@ -106,8 +106,8 @@
     while (index < stringLength) {
         NSColor		*fontColor;
         NSRange		effectiveRange;
-        float		brightness, sum;
-        float		deltaBrightness, deltaSum;
+        CGFloat		brightness, sum;
+        CGFloat		deltaBrightness, deltaSum;
         BOOL		colorChanged = NO;
         
         //--get the font color--
@@ -156,9 +156,9 @@
 //adjust the colors in the string so they're visible on the background, adjusting brightness in proportion to the original background
 - (void)adjustColorsToShowOnBackgroundRelativeToOriginalBackground:(NSColor *)backgroundColor
 {
-    int             index = 0;
-    int             stringLength = [self length];
-    float           backgroundBrightness=0.0f;
+    NSUInteger      index = 0;
+    NSUInteger      stringLength = [self length];
+    CGFloat         backgroundBrightness=0.0f;
     NSColor         *backColor=nil;
     //--get the brightness of our background--
     if (backgroundColor) {
@@ -172,8 +172,8 @@
         NSColor         *fontBackColor;
 
         NSRange		effectiveRange, backgroundRange;
-        float		brightness, newBrightness;
-        float		deltaBrightness, deltaSum;
+        CGFloat		brightness, newBrightness;
+        CGFloat		deltaBrightness, deltaSum;
         BOOL		colorChanged = NO, backgroundIsDark, fontBackIsDark;
         
         //--get the font color--
@@ -269,7 +269,7 @@
 - (void)addFormattingForLinks
 {
 	NSRange		searchRange;
-	unsigned	length = [self length];
+	NSUInteger	length = [self length];
 	
 	searchRange = NSMakeRange(0,0);
 	while (searchRange.location < length) {
@@ -285,7 +285,7 @@
 - (void)convertAttachmentsToStringsUsingPlaceholder:(NSString *)placeholder
 {
     if ([self length] && [self containsAttachments]) {
-        int							currentLocation = 0;
+        NSInteger							currentLocation = 0;
         NSRange						attachmentRange;
 		NSString					*attachmentCharacterString = [NSString stringWithFormat:@"%C",NSAttachmentCharacter];
 		
@@ -409,7 +409,7 @@
 
 //Height of a string
 #define FONT_HEIGHT_STRING		@"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789()"
-+ (float)stringHeightForAttributes:(NSDictionary *)attributes
++ (CGFloat)stringHeightForAttributes:(NSDictionary *)attributes
 {
 	NSAttributedString	*string = [[[NSAttributedString alloc] initWithString:FONT_HEIGHT_STRING
 																   attributes:attributes] autorelease];
@@ -452,7 +452,7 @@
     return [[[self alloc] initWithString:inString attributes:attributes] autorelease];
 }
 
-- (float)heightWithWidth:(float)width
+- (CGFloat)heightWithWidth:(CGFloat)width
 {	
     //Setup the layout manager and text container
     NSTextStorage *textStorage = [[NSTextStorage alloc] initWithAttributedString:self];
@@ -467,7 +467,7 @@
     //Force the layout manager to layout its text
     (void)[layoutManager glyphRangeForTextContainer:textContainer];
 
-	float height = [layoutManager usedRectForTextContainer:textContainer].size.height;
+	CGFloat height = [layoutManager usedRectForTextContainer:textContainer].size.height;
 
 	[textStorage release];
 	[textContainer release];
@@ -543,7 +543,7 @@
 - (NSAttributedString *)attributedStringByConvertingLinksToStringsWithTitles:(BOOL)includeTitles
 {
 	NSMutableAttributedString	*newAttributedString = nil;
-	unsigned					length = [self length];
+	NSUInteger					length = [self length];
 
 	if (length) {
 		NSRange						searchRange = NSMakeRange(0,0);
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIBezierPathAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIBezierPathAdditions.h	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIBezierPathAdditions.h	Wed Dec 23 12:42:51 2009 -0500
@@ -23,11 +23,11 @@
 
 #pragma mark Rounded rectangles
 
-+ (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect radius:(float)radius;
++ (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect radius:(CGFloat)radius;
 + (NSBezierPath *)bezierPathRoundedRectOfSize:(NSSize)backgroundSize;
 + (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)bounds;
-+ (NSBezierPath *)bezierPathWithRoundedTopCorners:(NSRect)rect radius:(float)radius;
-+ (NSBezierPath *)bezierPathWithRoundedBottomCorners:(NSRect)rect radius:(float)radius;
++ (NSBezierPath *)bezierPathWithRoundedTopCorners:(NSRect)rect radius:(CGFloat)radius;
++ (NSBezierPath *)bezierPathWithRoundedBottomCorners:(NSRect)rect radius:(CGFloat)radius;
 
 #pragma mark Arrows
 
@@ -46,9 +46,9 @@
  *
  * the other three methods allow you to override either or both of these metrics.
  */
-+ (NSBezierPath *)bezierPathWithArrowWithShaftLengthMultiplier:(float)shaftLengthMulti shaftWidth:(float)shaftWidth;
-+ (NSBezierPath *)bezierPathWithArrowWithShaftLengthMultiplier:(float)shaftLengthMulti;
-+ (NSBezierPath *)bezierPathWithArrowWithShaftWidth:(float)shaftWidth;
++ (NSBezierPath *)bezierPathWithArrowWithShaftLengthMultiplier:(CGFloat)shaftLengthMulti shaftWidth:(CGFloat)shaftWidth;
++ (NSBezierPath *)bezierPathWithArrowWithShaftLengthMultiplier:(CGFloat)shaftLengthMulti;
++ (NSBezierPath *)bezierPathWithArrowWithShaftWidth:(CGFloat)shaftWidth;
 + (NSBezierPath *)bezierPathWithArrow;
 
 #pragma mark Nifty things
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIBezierPathAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIBezierPathAdditions.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIBezierPathAdditions.m	Wed Dec 23 12:42:51 2009 -0500
@@ -44,12 +44,12 @@
 	return [self bezierPathWithRoundedRect:bounds radius:MIN(bounds.size.width, bounds.size.height) / 2.0];
 }
 
-+ (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect radius:(float)radius
++ (NSBezierPath *)bezierPathWithRoundedRect:(NSRect)rect radius:(CGFloat)radius
 {
 	return [NSBezierPath bezierPathWithRoundedRect:rect xRadius:radius yRadius:radius];
 }
 
-+ (NSBezierPath *)bezierPathWithRoundedTopCorners:(NSRect)rect radius:(float)radius
++ (NSBezierPath *)bezierPathWithRoundedTopCorners:(NSRect)rect radius:(CGFloat)radius
 {
     NSBezierPath	*path = [NSBezierPath bezierPath];
     NSPoint 		topLeft, topRight, bottomLeft, bottomRight;
@@ -80,7 +80,7 @@
     return path;
 }
 
-+ (NSBezierPath *)bezierPathWithRoundedBottomCorners:(NSRect)rect radius:(float)radius
++ (NSBezierPath *)bezierPathWithRoundedBottomCorners:(NSRect)rect radius:(CGFloat)radius
 {
     NSBezierPath	*path = [NSBezierPath bezierPath];
     NSPoint 		topLeft, topRight, bottomLeft, bottomRight;
@@ -113,7 +113,7 @@
 
 #pragma mark Arrows
 
-+ (NSBezierPath *)bezierPathWithArrowWithShaftLengthMultiplier:(float)shaftLengthMulti shaftWidth:(float)shaftWidth {
++ (NSBezierPath *)bezierPathWithArrowWithShaftLengthMultiplier:(CGFloat)shaftLengthMulti shaftWidth:(CGFloat)shaftWidth {
 	NSBezierPath *arrowPath = [NSBezierPath bezierPath];
 
 	/*   5
@@ -124,10 +124,10 @@
 	 *  1-2
 	 */
 
-	const float shaftLength = ONE_HALF * shaftLengthMulti;
-	const float shaftEndY = -(shaftLength - ONE_HALF); //the end of the arrow shaft (points 1-2).
+	const CGFloat shaftLength = ONE_HALF * shaftLengthMulti;
+	const CGFloat shaftEndY = -(shaftLength - ONE_HALF); //the end of the arrow shaft (points 1-2).
 	//wing width = the distance between 6 and 7 and 3 and 4.
-	const float wingWidth = (1.0 - shaftWidth) * 0.5;
+	const CGFloat wingWidth = (1.0 - shaftWidth) * 0.5;
 
 	//start with the bottom vertex.
 	[arrowPath moveToPoint:NSMakePoint(wingWidth,  shaftEndY)]; //1
@@ -148,11 +148,11 @@
 	return arrowPath;
 }
 
-+ (NSBezierPath *)bezierPathWithArrowWithShaftLengthMultiplier:(float)shaftLengthMulti {
++ (NSBezierPath *)bezierPathWithArrowWithShaftLengthMultiplier:(CGFloat)shaftLengthMulti {
 	return [self bezierPathWithArrowWithShaftLengthMultiplier:shaftLengthMulti
 	                                               shaftWidth:DEFAULT_SHAFT_WIDTH];
 }
-+ (NSBezierPath *)bezierPathWithArrowWithShaftWidth:(float)shaftWidth {
++ (NSBezierPath *)bezierPathWithArrowWithShaftWidth:(CGFloat)shaftWidth {
 	return [self bezierPathWithArrowWithShaftLengthMultiplier:DEFAULT_SHAFT_LENGTH_MULTI
 	                                               shaftWidth:shaftWidth];
 }
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIBorderlessWindow.m
--- a/Frameworks/AIUtilities Framework/Source/AIBorderlessWindow.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIBorderlessWindow.m	Wed Dec 23 12:42:51 2009 -0500
@@ -154,25 +154,25 @@
 	BOOL	changed = NO;
 	
 	//Left
-	if ((abs(NSMinX((*inWindowFrame)) - NSMinX(inScreenFrame)) < BORDERLESS_WINDOW_DOCKING_DISTANCE)) {
+	if ((labs(NSMinX((*inWindowFrame)) - NSMinX(inScreenFrame)) < BORDERLESS_WINDOW_DOCKING_DISTANCE)) {
 		(*inWindowFrame).origin.x = inScreenFrame.origin.x;
 		changed = YES;
 	}
 	
 	//Bottom
-	if ((abs(NSMinY(*inWindowFrame) - NSMinY(inScreenFrame)) < BORDERLESS_WINDOW_DOCKING_DISTANCE)) {
+	if ((labs(NSMinY(*inWindowFrame) - NSMinY(inScreenFrame)) < BORDERLESS_WINDOW_DOCKING_DISTANCE)) {
 		(*inWindowFrame).origin.y = inScreenFrame.origin.y;
 		changed = YES;
 	}
 	
 	//Right
-	if ((abs(NSMaxX(*inWindowFrame) - NSMaxX(inScreenFrame)) < BORDERLESS_WINDOW_DOCKING_DISTANCE)) {
+	if ((labs(NSMaxX(*inWindowFrame) - NSMaxX(inScreenFrame)) < BORDERLESS_WINDOW_DOCKING_DISTANCE)) {
 		(*inWindowFrame).origin.x -= NSMaxX(*inWindowFrame) - NSMaxX(inScreenFrame);
 		changed = YES;
 	}
 	
 	//Top
-	if ((abs(NSMaxY(*inWindowFrame) - NSMaxY(inScreenFrame)) < BORDERLESS_WINDOW_DOCKING_DISTANCE)) {
+	if ((labs(NSMaxY(*inWindowFrame) - NSMaxY(inScreenFrame)) < BORDERLESS_WINDOW_DOCKING_DISTANCE)) {
 		(*inWindowFrame).origin.y -= NSMaxY(*inWindowFrame) - NSMaxY(inScreenFrame);
 		changed = YES;
 	}
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIColorAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIColorAdditions.h	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIColorAdditions.h	Wed Dec 23 12:42:51 2009 -0500
@@ -85,7 +85,7 @@
  *	@param	amount The amount (greater than 0.0 and at most 1.0) to subtract from the receiver's brightness.
  *	@return	A new, darker color, in the calibrated-RGB color space.
  */
-- (NSColor *)darkenBy:(float)amount;
+- (NSColor *)darkenBy:(CGFloat)amount;
 /*!	@brief	Returns a new color, darker than the receiver and more saturated, both by a single fixed amount.
  *
  *	@par	This method subtracts \a amount from the brightness of the receiver (as measured using <code>-[NSColor brightnessComponent]</code>) and adds \a amount to its saturation (as measured using <code>-[NSColor saturationComponent]</code>), and returns a new \c NSColor created with the unchanged other component values and the new saturation and brightness values.
@@ -97,7 +97,7 @@
  *	@param	amount The amount (greater than 0.0 and at most 1.0) to subtract from the receiver's brightness and add to the receiver's saturation.
  *	@return	A new, darker, more saturated color, in the calibrated-RGB color space.
  */
-- (NSColor *)darkenAndAdjustSaturationBy:(float)amount;
+- (NSColor *)darkenAndAdjustSaturationBy:(CGFloat)amount;
 /*!	@brief	Inverts a color's brightness without affecting the hue.
  *
  *	@par	The naïve method for inverting a color is to subtract all of its color components from 1.0, but this moves colors not in the center of the color wheel to the opposite side of the wheel—for example, it changes orange into light blue. In other words, it inverts not the brightness (except for shades of gray), but the hue.
@@ -130,7 +130,7 @@
  *	@param	g	The green component of the color to convert.
  *	@param	b	The blue component of the color to convert. 
  */
-void getHueLuminanceSaturationFromRGB(float *hue, float *luminance, float *saturation, float r, float g, float b);
+void getHueLuminanceSaturationFromRGB(CGFloat *hue, CGFloat *luminance, CGFloat *saturation, CGFloat r, CGFloat g, CGFloat b);
 /*!	@brief	Computes the red, green, and blue of a given hue, saturation, and brightness triplet.
  *
  *	@par	This function exists to help you compute RGB values without first creating an \c NSColor instance. It also gets the job done in only one function call, rather than at least two Objective-C messages.
@@ -144,7 +144,7 @@
  *	@param	saturation	The saturation component of the color to convert.
  *	@param	luminance	The luminance (brightness) component of the color to convert. 
  */
-void getRGBFromHueLuminanceSaturation(float *r, float *g, float *b, float hue, float luminance, float saturation);
+void getRGBFromHueLuminanceSaturation(CGFloat *r, CGFloat *g, CGFloat *b, CGFloat hue, CGFloat luminance, CGFloat saturation);
 
 @interface NSColor (AIColorAdditions_HLS)
 
@@ -216,7 +216,7 @@
  *
  *	@return	A lowercase character, encoded in ASCII, representing the number in hexadecimal.
  */
-char intToHex(int digit);
+char intToHex(NSInteger digit);
 
 @interface NSString (AIColorAdditions_RepresentingColors)
 
@@ -245,7 +245,7 @@
  *
  *	@return	A color in the calibrated-RGB color space, or \c nil.
  */
-- (NSColor *)representedColorWithAlpha:(float)alpha;
+- (NSColor *)representedColorWithAlpha:(CGFloat)alpha;
 
 @end
 
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIColorAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIColorAdditions.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIColorAdditions.m	Wed Dec 23 12:42:51 2009 -0500
@@ -24,9 +24,9 @@
 static NSArray *defaultValidColors = nil;
 #define VALID_COLORS_ARRAY [[NSArray alloc] initWithObjects:@"aqua", @"aquamarine", @"blue", @"blueviolet", @"brown", @"burlywood", @"cadetblue", @"chartreuse", @"chocolate", @"coral", @"cornflowerblue", @"crimson", @"cyan", @"darkblue", @"darkcyan", @"darkgoldenrod", @"darkgreen", @"darkgrey", @"darkkhaki", @"darkmagenta", @"darkolivegreen", @"darkorange", @"darkorchid", @"darkred", @"darksalmon", @"darkseagreen", @"darkslateblue", @"darkslategrey", @"darkturquoise", @"darkviolet", @"deeppink", @"deepskyblue", @"dimgrey", @"dodgerblue", @"firebrick", @"forestgreen", @"fuchsia", @"gold", @"goldenrod", @"green", @"greenyellow", @"grey", @"hotpink", @"indianred", @"indigo", @"lawngreen", @"lightblue", @"lightcoral", @"lightgreen", @"lightgrey", @"lightpink", @"lightsalmon", @"lightseagreen", @"lightskyblue", @"lightslategrey", @"lightsteelblue", @"lime", @"limegreen", @"magenta", @"maroon", @"mediumaquamarine", @"mediumblue", @"mediumorchid", @"mediumpurple", @"mediumseagreen", @"mediumslateblue", @"mediumspringgreen", @"mediumturquoise", @"mediumvioletred", @"midnightblue", @"navy", @"olive", @"olivedrab", @"orange", @"orangered", @"orchid", @"palegreen", @"paleturquoise", @"palevioletred", @"peru", @"pink", @"plum", @"powderblue", @"purple", @"red", @"rosybrown", @"royalblue", @"saddlebrown", @"salmon", @"sandybrown", @"seagreen", @"sienna", @"silver", @"skyblue", @"slateblue", @"slategrey", @"springgreen", @"steelblue", @"tan", @"teal", @"thistle", @"tomato", @"turquoise", @"violet", @"yellowgreen", nil]
 
-static const float ONE_THIRD = 1.0/3.0;
-static const float ONE_SIXTH = 1.0/6.0;
-static const float TWO_THIRD = 2.0/3.0;
+static const CGFloat ONE_THIRD = 1.0/3.0;
+static const CGFloat ONE_SIXTH = 1.0/6.0;
+static const CGFloat TWO_THIRD = 2.0/3.0;
 
 static NSMutableDictionary *RGBColorValues = nil;
 
@@ -52,7 +52,7 @@
 	if (!data) return nil;
 	
 	char *ch = [data mutableBytes]; //we use mutable bytes because we want to tokenise the string by replacing separators with '\0'.
-	unsigned length = [data length];
+	NSUInteger length = [data length];
 	struct {
 		const char *redStart, *greenStart, *blueStart, *nameStart;
 		const char *redEnd,   *greenEnd,   *blueEnd;
@@ -214,12 +214,12 @@
 
 - (BOOL)colorIsMedium
 {
-	float brightness = [[self colorUsingColorSpaceName:NSCalibratedRGBColorSpace] brightnessComponent];
+	CGFloat brightness = [[self colorUsingColorSpaceName:NSCalibratedRGBColorSpace] brightnessComponent];
 	return (0.35 < brightness && brightness < 0.65);
 }
 
 //Percent should be -1.0 to 1.0 (negatives will make the color brighter)
-- (NSColor *)darkenBy:(float)amount
+- (NSColor *)darkenBy:(CGFloat)amount
 {
     NSColor	*convertedColor = [self colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
     
@@ -229,7 +229,7 @@
                                      alpha:[convertedColor alphaComponent]];
 }
 
-- (NSColor *)darkenAndAdjustSaturationBy:(float)amount
+- (NSColor *)darkenAndAdjustSaturationBy:(CGFloat)amount
 {
     NSColor	*convertedColor = [self colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
     
@@ -287,7 +287,7 @@
     [self getHue:&hue saturation:&sat brightness:&brit alpha:&alpha];
 
 	//For some reason, redColor's hue is 1.0f, not 0.0f, as of Mac OS X 10.4.10 and 10.5.2. Therefore, we must normalize any multiple of 1.0 to 0.0. We do this by taking the remainder of hue ÷ 1.
-	hue = fmodf(hue, 1.0f);
+	hue = fmod(hue, 1.0);
 
     hue += dHue;
     cap(hue);
@@ -307,21 +307,21 @@
 {
     CGFloat 	red,green,blue;
     char	hexString[7];
-    int		tempNum;
+    NSInteger		tempNum;
     NSColor	*convertedColor;
 
     convertedColor = [self colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
     [convertedColor getRed:&red green:&green blue:&blue alpha:NULL];
     
-    tempNum = (red * 255.0f);
+    tempNum = (red * 255.0);
     hexString[0] = intToHex(tempNum / 16);
     hexString[1] = intToHex(tempNum % 16);
 
-    tempNum = (green * 255.0f);
+    tempNum = (green * 255.0);
     hexString[2] = intToHex(tempNum / 16);
     hexString[3] = intToHex(tempNum % 16);
 
-    tempNum = (blue * 255.0f);
+    tempNum = (blue * 255.0);
     hexString[4] = intToHex(tempNum / 16);
     hexString[5] = intToHex(tempNum % 16);
     hexString[6] = '\0';
@@ -333,7 +333,7 @@
 - (NSString *)stringRepresentation
 {
     NSColor	*tempColor = [self colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
-	float alphaComponent = [tempColor alphaComponent];
+	CGFloat alphaComponent = [tempColor alphaComponent];
 
 	if (alphaComponent == 1.0) {
 		return [NSString stringWithFormat:@"%d,%d,%d",
@@ -352,15 +352,15 @@
 
 - (NSString *)CSSRepresentation
 {
-	float alpha = [self alphaComponent];
+	CGFloat alpha = [self alphaComponent];
 	if ((1.0 - alpha) >= 0.000001) {
 		NSColor *rgb = [self colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
 		//CSS3 defines rgba() to take 0..255 for the color components, but 0..1 for the alpha component. Thus, we must multiply by 255 for the color components, but not for the alpha component.
 		return [NSString stringWithFormat:@"rgba(%@,%@,%@,%@)",
-			[NSString stringWithFloat:[rgb redComponent]   * 255.0f maxDigits:6],
-			[NSString stringWithFloat:[rgb greenComponent] * 255.0f maxDigits:6],
-			[NSString stringWithFloat:[rgb blueComponent]  * 255.0f maxDigits:6],
-			[NSString stringWithFloat:alpha                         maxDigits:6]];
+			[NSString stringWithCGFloat:[rgb redComponent]   * 255.0 maxDigits:6],
+			[NSString stringWithCGFloat:[rgb greenComponent] * 255.0 maxDigits:6],
+			[NSString stringWithCGFloat:[rgb blueComponent]  * 255.0 maxDigits:6],
+			[NSString stringWithCGFloat:alpha                         maxDigits:6]];
 	} else {
 		return [@"#" stringByAppendingString:[self hexString]];
 	}
@@ -372,8 +372,8 @@
 
 - (NSColor *)representedColor
 {
-    unsigned int	r = 255, g = 255, b = 255;
-    unsigned int	a = 255;
+    NSUInteger	r = 255, g = 255, b = 255;
+    NSUInteger	a = 255;
 
 	const char *selfUTF8 = [self UTF8String];
 	
@@ -406,11 +406,11 @@
 	return nil;
 }
 
-- (NSColor *)representedColorWithAlpha:(float)alpha
+- (NSColor *)representedColorWithAlpha:(CGFloat)alpha
 {
 	//this is the same as above, but the alpha component is overridden.
 
-    unsigned int	r, g, b;
+  NSUInteger	r, g, b;
 
 	const char *selfUTF8 = [self UTF8String];
 	
@@ -471,10 +471,10 @@
  * @param secondChar The second hex character, or 0x0 if only one character is to be used
  * @result The float value. Returns 0 as a bailout value if firstChar or secondChar are not valid hexadecimal characters ([0-9]|[A-F]|[a-f]). Also returns 0 if firstChar and secondChar equal 0.
  */
-static float hexCharsToFloat(char firstChar, char secondChar)
+static CGFloat hexCharsToFloat(char firstChar, char secondChar)
 {
-	float	hexValue;
-	int		firstDigit;
+	CGFloat				hexValue;
+	NSUInteger		firstDigit;
 	firstDigit = hexToInt(firstChar);
 	if (firstDigit != -1) {
 		hexValue = firstDigit;
@@ -499,7 +499,7 @@
 {
 	if (!str) return defaultColor;
 
-	unsigned strLength = [str length];
+	NSUInteger strLength = [str length];
 	
 	NSString *colorValue = str;
 	
@@ -554,8 +554,8 @@
 	}
 	const char *hexString = hexStringArray;
 
-	float 	red,green,blue;
-	float	alpha = 1.0;
+	CGFloat		red,green,blue;
+	CGFloat		alpha = 1.0;
 
 	//skip # if present.
 	if (*hexString == '#') {
@@ -640,7 +640,7 @@
 }
 
 //Convert int to a hex
-char intToHex(int digit)
+char intToHex(NSInteger digit)
 {
     if (digit > 9) {
 		if (digit <= 0xf) {
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AICompletingTextField.h
--- a/Frameworks/AIUtilities Framework/Source/AICompletingTextField.h	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AICompletingTextField.h	Wed Dec 23 12:42:51 2009 -0500
@@ -26,9 +26,9 @@
     NSMutableSet			*stringSet;
 	NSMutableDictionary		*impliedCompletionDictionary;
 	
-    int						minLength;
+    NSUInteger						minLength;
 	BOOL					completeAfterSeparator;
-    int						oldUserLength;
+    NSUInteger						oldUserLength;
 }
 
 /*!
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AICompletingTextField.m
--- a/Frameworks/AIUtilities Framework/Source/AICompletingTextField.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AICompletingTextField.m	Wed Dec 23 12:42:51 2009 -0500
@@ -127,7 +127,7 @@
 - (void)textDidChange:(NSNotification *)notification
 {
     NSString		*userValue, *lastValue, *completionValue;
-	unsigned int	userValueLength, lastValueLength;
+    NSUInteger	userValueLength, lastValueLength;
 	
     //Auto-complete
     userValue = [self stringValue];
@@ -196,7 +196,7 @@
     NSEnumerator	*enumerator;
 	NSString		*compString = inString;
     NSString		*autoString;
-    int				length;
+    NSUInteger				length;
     NSRange			range;
 
 	// Find only the last item in the list, if we are to autocomplete only after separators
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIDelayedTextField.m
--- a/Frameworks/AIUtilities Framework/Source/AIDelayedTextField.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIDelayedTextField.m	Wed Dec 23 12:42:51 2009 -0500
@@ -33,7 +33,7 @@
 
 - (id)_init
 {
-	delayInterval = 0.5;
+	delayInterval = 0.5f;
 	
 	return self;
 }
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIDictionaryAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIDictionaryAdditions.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIDictionaryAdditions.m	Wed Dec 23 12:42:51 2009 -0500
@@ -199,14 +199,14 @@
 	} else {
 		NSMutableSet *addedKeys = nil;
 		if (outAddedKeys) {
-			unsigned capacity = [self count];
+			NSUInteger capacity = [self count];
 			if (flag) capacity += [other count];
 			addedKeys = [NSMutableSet setWithCapacity:capacity];
 		}
 
 		NSMutableSet *removedKeys = nil;
 		if (outRemovedKeys) {
-			unsigned capacity = [other count];
+			NSUInteger capacity = [other count];
 			if (flag) capacity += [self count];
 			removedKeys = [NSMutableSet setWithCapacity:capacity];
 		}
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIDockingWindow.m
--- a/Frameworks/AIUtilities Framework/Source/AIDockingWindow.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIDockingWindow.m	Wed Dec 23 12:42:51 2009 -0500
@@ -137,22 +137,22 @@
 - (NSRect)dockWindowFrame:(NSRect)windowFrame toScreenFrame:(NSRect)screenFrame
 {
 	//Left
-	if (abs(NSMinX(windowFrame) - NSMinX(screenFrame)) < WINDOW_DOCKING_DISTANCE) {
+	if (labs(NSMinX(windowFrame) - NSMinX(screenFrame)) < WINDOW_DOCKING_DISTANCE) {
 		windowFrame.origin.x = screenFrame.origin.x;
 	}
 	
 	//Bottom
-	if (abs(NSMinY(windowFrame) - NSMinY(screenFrame)) < WINDOW_DOCKING_DISTANCE) {
+	if (labs(NSMinY(windowFrame) - NSMinY(screenFrame)) < WINDOW_DOCKING_DISTANCE) {
 		windowFrame.origin.y = screenFrame.origin.y;
 	}
 	
 	//Right
-	if (abs(NSMaxX(windowFrame) - NSMaxX(screenFrame)) < WINDOW_DOCKING_DISTANCE) {
+	if (labs(NSMaxX(windowFrame) - NSMaxX(screenFrame)) < WINDOW_DOCKING_DISTANCE) {
 		windowFrame.origin.x -= NSMaxX(windowFrame) - NSMaxX(screenFrame);
 	}
 	
 	//Top
-	if (abs(NSMaxY(windowFrame) - NSMaxY(screenFrame)) < WINDOW_DOCKING_DISTANCE) {
+	if (labs(NSMaxY(windowFrame) - NSMaxY(screenFrame)) < WINDOW_DOCKING_DISTANCE) {
 		windowFrame.origin.y -= NSMaxY(windowFrame) - NSMaxY(screenFrame);
 	}
 	
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIFloater.h
--- a/Frameworks/AIUtilities Framework/Source/AIFloater.h	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIFloater.h	Wed Dec 23 12:42:51 2009 -0500
@@ -19,7 +19,7 @@
     NSPanel				*panel;
     BOOL                windowIsVisible;
     NSViewAnimation     *fadeAnimation;
-    float               maxOpacity;
+    CGFloat               maxOpacity;
 }
 
 /*!
@@ -70,7 +70,7 @@
  *
  * @param inMaxOpacity The maximum opacity
  */
-- (void)setMaxOpacity:(float)inMaxOpacity;
+- (void)setMaxOpacity:(CGFloat)inMaxOpacity;
 
 //- (void)endFloater;
 
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIFloater.m
--- a/Frameworks/AIUtilities Framework/Source/AIFloater.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIFloater.m	Wed Dec 23 12:42:51 2009 -0500
@@ -16,7 +16,7 @@
 
 @interface AIFloater ()
 - (id)initWithImage:(NSImage *)inImage styleMask:(unsigned int)styleMask;
-- (void)_setWindowOpacity:(float)opacity;
+- (void)_setWindowOpacity:(CGFloat)opacity;
 @end
 
 @implementation AIFloater
@@ -90,7 +90,7 @@
     [self release];
 }
 
-- (void)setMaxOpacity:(float)inMaxOpacity
+- (void)setMaxOpacity:(CGFloat)inMaxOpacity
 {
     maxOpacity = inMaxOpacity;
     if (windowIsVisible) [self _setWindowOpacity:maxOpacity];
@@ -125,7 +125,7 @@
     }
 }
 
-- (void)_setWindowOpacity:(float)opacity
+- (void)_setWindowOpacity:(CGFloat)opacity
 {
     [panel setAlphaValue:opacity];
 }
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIFontAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIFontAdditions.h	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIFontAdditions.h	Wed Dec 23 12:42:51 2009 -0500
@@ -14,7 +14,7 @@
  \------------------------------------------------------------------------------------------------------ */
 
 @interface NSFont (AIFontAdditions)
-+ (NSFont *)cachedFontWithName:(NSString *)fontName size:(float)fontSize;
++ (NSFont *)cachedFontWithName:(NSString *)fontName size:(CGFloat)fontSize;
 - (NSString *)stringRepresentation;
 - (NSString *)CSSRepresentation;
 - (BOOL)supportsBold;
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIFontAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIFontAdditions.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIFontAdditions.m	Wed Dec 23 12:42:51 2009 -0500
@@ -21,7 +21,7 @@
 //Returns the requested font
 //NSFont's 'FontWithName' method leaks memory.  This wrapper attempts to minimize the leaking.
 //It appears to be leaking an NSString somehow, which isn't as bad as what NSFont does.
-+ (NSFont *)cachedFontWithName:(NSString *)fontName size:(float)fontSize
++ (NSFont *)cachedFontWithName:(NSString *)fontName size:(CGFloat)fontSize
 {
     static NSMutableDictionary	*fontDict = nil;
     NSString					*sizeString = [NSString stringWithFormat:@"%0.2f",fontSize];
@@ -80,7 +80,7 @@
 - (NSString *)CSSRepresentation
 {
 	NSMutableArray *result = [NSMutableArray arrayWithCapacity:3];
-	[result addObject:[NSString stringWithFormat:@"%@pt %@", [NSString stringWithFloat:[self pointSize] maxDigits:2], [self familyName]]];
+	[result addObject:[NSString stringWithFormat:@"%@pt %@", [NSString stringWithCGFloat:[self pointSize] maxDigits:2], [self familyName]]];
 
 	NSFontTraitMask traits = [[NSFontManager sharedFontManager] traitsOfFont:self];
 	if (traits & NSItalicFontMask) {
@@ -124,8 +124,8 @@
 - (NSFont *)representedFont
 {
     NSString	*fontName;
-    float	fontSize;
-    int		divider;
+    CGFloat		fontSize;
+    NSInteger	divider;
     
     divider = [self rangeOfString:@","].location;
     fontName = [self substringToIndex:divider];
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIFontManagerAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIFontManagerAdditions.h	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIFontManagerAdditions.h	Wed Dec 23 12:42:51 2009 -0500
@@ -16,6 +16,6 @@
 @interface NSFontManager (AIFontManagerAdditions)
 
 //find a font by family name, using case-insensitive matching.
-- (NSFont *)fontWithFamilyInsensitively:(NSString *)name traits:(NSFontTraitMask)fontTraitMask weight:(int)weight size:(float)size;
+- (NSFont *)fontWithFamilyInsensitively:(NSString *)name traits:(NSFontTraitMask)fontTraitMask weight:(NSInteger)weight size:(CGFloat)size;
 
 @end
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIFontManagerAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIFontManagerAdditions.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIFontManagerAdditions.m	Wed Dec 23 12:42:51 2009 -0500
@@ -17,7 +17,7 @@
 
 @implementation NSFontManager (AIFontManagerAdditions)
 
-- (NSFont *)fontWithFamilyInsensitively:(NSString *)name traits:(NSFontTraitMask)fontTraitMask weight:(int)weight size:(float)size
+- (NSFont *)fontWithFamilyInsensitively:(NSString *)name traits:(NSFontTraitMask)fontTraitMask weight:(NSInteger)weight size:(CGFloat)size
 {
 	NSFont			*theFont = nil;
 	NSFontManager	*fontManager = [NSFontManager sharedFontManager];
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIFunctions.h
--- a/Frameworks/AIUtilities Framework/Source/AIFunctions.h	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIFunctions.h	Wed Dec 23 12:42:51 2009 -0500
@@ -47,7 +47,7 @@
  *
  *	@return An X or Y coordinate.
  */
-float AICoordinateForRect_edge_(NSRect rect, NSRectEdge edge);
+CGFloat AICoordinateForRect_edge_(NSRect rect, NSRectEdge edge);
 
 /*!	@brief Measures a line from \a edge to \a point.
  *
@@ -57,7 +57,7 @@
  *
  *	@return The distance between the edge and the point. It is positive if the point is outside the edge, negative if it is inside the edge (even it is outside the rectangle).
  */
-float AISignedExteriorDistanceRect_edge_toPoint_(NSRect rect, NSRectEdge edge, NSPoint point);
+CGFloat AISignedExteriorDistanceRect_edge_toPoint_(NSRect rect, NSRectEdge edge, NSPoint point);
 
 /*!	@brief Returns the edge that would be across a rectangle from \a edge.
  *
@@ -81,7 +81,7 @@
 												 NSRectEdge edge1, 
 												 NSRect rect2, 
 												 NSRectEdge edge2, 
-												 float tolerance);
+												 CGFloat tolerance);
 
 // minimally translate mobileRect so that it lies within stationaryRect
 NSRect AIRectByMovingRect_intoRect_(NSRect mobileRect, NSRect stationaryRect);
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIFunctions.m
--- a/Frameworks/AIUtilities Framework/Source/AIFunctions.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIFunctions.m	Wed Dec 23 12:42:51 2009 -0500
@@ -17,9 +17,9 @@
 
 #pragma mark Rect utilities
 
-float AICoordinateForRect_edge_(const NSRect rect, const NSRectEdge edge)
+CGFloat AICoordinateForRect_edge_(const NSRect rect, const NSRectEdge edge)
 {
-	float coordinate = 0.0;
+	CGFloat coordinate = 0.0;
 	switch (edge) {
 		case NSMinXEdge : coordinate = NSMinX(rect); break;
 		case NSMinYEdge : coordinate = NSMinY(rect); break;
@@ -32,10 +32,10 @@
 
 // returns the distance that a point lies outside a rect on a particular side.  If the point lies 
 // on the interior side of the edge, the number returned will be negative
-float AISignedExteriorDistanceRect_edge_toPoint_(const NSRect rect, const NSRectEdge edge, const NSPoint point)
+CGFloat AISignedExteriorDistanceRect_edge_toPoint_(const NSRect rect, const NSRectEdge edge, const NSPoint point)
 {
-	float distanceOutside = 0.0;
-	float rectEdgeCoordinate = AICoordinateForRect_edge_(rect, edge);
+	CGFloat distanceOutside = 0.0;
+	CGFloat rectEdgeCoordinate = AICoordinateForRect_edge_(rect, edge);
 	switch (edge) {
 		case NSMinXEdge: distanceOutside = rectEdgeCoordinate - point.x; break;
 		case NSMaxXEdge: distanceOutside = point.x - rectEdgeCoordinate; break;
@@ -64,7 +64,7 @@
 // undefined if aligning left to top or something else that does not make sense
 NSRect AIRectByAligningRect_edge_toRect_edge_(NSRect mobileRect, const NSRectEdge mobileRectEdge, const NSRect stationaryRect, const NSRectEdge stationaryRectEdge)
 {
-	float alignToCoordinate = AICoordinateForRect_edge_(stationaryRect, stationaryRectEdge);
+	CGFloat alignToCoordinate = AICoordinateForRect_edge_(stationaryRect, stationaryRectEdge);
 	switch (mobileRectEdge) {
 		case NSMinXEdge: mobileRect.origin.x = alignToCoordinate; break;
 		case NSMinYEdge: mobileRect.origin.y = alignToCoordinate; break;
@@ -75,9 +75,14 @@
 	return mobileRect;
 }
 
-BOOL AIRectIsAligned_edge_toRect_edge_tolerance_(const NSRect rect1, const NSRectEdge edge1, const NSRect rect2, const NSRectEdge edge2, const float tolerance)
+BOOL AIRectIsAligned_edge_toRect_edge_tolerance_(const NSRect rect1, const NSRectEdge edge1, const NSRect rect2, const NSRectEdge edge2, const CGFloat tolerance)
 {
-	return fabsf(AICoordinateForRect_edge_(rect1, edge1) - AICoordinateForRect_edge_(rect2, edge2)) < tolerance;
+#ifdef __LP64__
+	#define AIfabs( X ) fabs((X))
+#else
+	#define AIfabs( X ) fabsf(X))
+#endif
+	return AIfabs(AICoordinateForRect_edge_(rect1, edge1) - AICoordinateForRect_edge_(rect2, edge2)) < tolerance;
 }
 
 // minimally translate mobileRect so that it lies within stationaryRect
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIHostReachabilityMonitor.m
--- a/Frameworks/AIUtilities Framework/Source/AIHostReachabilityMonitor.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIHostReachabilityMonitor.m	Wed Dec 23 12:42:51 2009 -0500
@@ -127,7 +127,7 @@
 
 	[hostAndObserverListLock lock];
 
-	unsigned numObservers = [observers count];
+	NSUInteger numObservers = [observers count];
 	for (unsigned i = 0; i < numObservers; ) {
 		BOOL removed = NO;
 		if (newObserver == [observers objectAtIndex:i]) {
@@ -164,7 +164,7 @@
 	[hostAndObserverListLock lock];
 
 	if (host && observer) {
-		unsigned numObservers = [observers count];
+		NSUInteger numObservers = [observers count];
 		for (unsigned i = 0; i < numObservers; i++) {
 			if ((observer == [observers objectAtIndex:i]) &&
 				([host isEqualToString:[hosts objectAtIndex:i]])) {
@@ -649,7 +649,7 @@
 	
 	[hostAndObserverListLock unlock];
 
-	unsigned numObservers = [oldObservers count];
+	NSUInteger numObservers = [oldObservers count];
 	for (unsigned i = 0; i < numObservers; i++) {
 		NSString						*host = [oldHosts objectAtIndex:i];
 		id<AIHostReachabilityObserver>	observer = [oldObservers objectAtIndex:i];
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIImageAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageAdditions.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIImageAdditions.m	Wed Dec 23 12:42:51 2009 -0500
@@ -99,10 +99,10 @@
 	NSBitmapImageRep *bestRep = nil;
 	NSImageRep *rep;
 	Class NSBitmapImageRepClass = [NSBitmapImageRep class];
-	float maxWidth = 0;
+	CGFloat maxWidth = 0;
 	while ((rep = [repsEnum nextObject])) {
 		if ([rep isKindOfClass:NSBitmapImageRepClass]) {
-			float thisWidth = [rep size].width;
+			CGFloat thisWidth = [rep size].width;
 			if (thisWidth >= maxWidth) {
 				//Cast explanation: GCC warns about us returning an NSImageRep here, presumably because it could be some other kind of NSImageRep if we don't check the class. Fortunately, we have such a check. This cast silences the warning.
 				bestRep = (NSBitmapImageRep *)rep;
@@ -120,7 +120,7 @@
 
 - (NSData *)JPEGRepresentation
 {	
-	return [self JPEGRepresentationWithCompressionFactor:1.0];
+	return [self JPEGRepresentationWithCompressionFactor:1.0f];
 }
 
 - (NSData *)JPEGRepresentationWithCompressionFactor:(float)compressionFactor
@@ -129,7 +129,7 @@
 	* before creating our representation or transparent parts will become black.  White is preferable.
 	*/
 	return ([[self opaqueBitmapImageRep] representationUsingType:NSJPEGFileType 
-													  properties:[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:compressionFactor] 
+													  properties:[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:(float)compressionFactor] 
 																							 forKey:NSImageCompressionFactor]]);	
 }
 - (NSData *)JPEGRepresentationWithMaximumByteSize:(NSUInteger)maxByteSize
@@ -139,7 +139,7 @@
 	 */
 	NSBitmapImageRep *opaqueBitmapImageRep = [self opaqueBitmapImageRep];
 	NSData *data = nil;
-	for (float compressionFactor = 0.99; compressionFactor > 0.4; compressionFactor -= 0.01) {
+	for (float compressionFactor = 0.99f; compressionFactor > 0.4f; compressionFactor -= 0.01f) {
 		data = [opaqueBitmapImageRep representationUsingType:NSJPEGFileType 
 												  properties:[NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:compressionFactor] 
 																						 forKey:NSImageCompressionFactor]];
@@ -190,7 +190,7 @@
 - (NSBitmapImageRep *)bitmapRepForGIFRepresentation
 {
 	NSArray *reps = [self representations];
-	int i = [reps count];
+	NSUInteger i = [reps count];
 	while (i--) {
 		NSBitmapImageRep *rep = (NSBitmapImageRep *)[reps objectAtIndex:i];
 		if ([rep isKindOfClass:[NSBitmapImageRep class]] &&
@@ -233,7 +233,7 @@
 + (AIBitmapImageFileType)fileTypeOfData:(NSData *)inData
 {
 	const char *data = [inData bytes];
-	unsigned len = [inData length];
+	NSUInteger len = [inData length];
 	AIBitmapImageFileType fileType = AIUnknownFileType;
 
 	if (len >= 4) {
diff -r da0720ca67a6 -r e04a00f58ce6 Frameworks/AIUtilities Framework/Source/AIImageButton.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageButton.m	Tue Dec 22 17:13:52 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIImageButton.m	Wed Dec 23 12:42:51 2009 -0500
@@ -44,7 +44,7 @@
 {
 	if ([self isEnabled]) {
 		NSWindow	*window = [self window];
-		float		maxXOrigin;


More information about the commits mailing list