From f90bcf3263b80b96754977ddbd5309704cf817fb Mon Sep 17 00:00:00 2001 From: thomasvl Date: Fri, 9 May 2008 18:53:09 +0000 Subject: Flush out suppport for 64bit, GC support. Added some more xcode configs related to the above. Removed some classes that the unittesting doesn't need (and aren't able to support 64bit). add base64, httpfetcher, and progress monitor stream. --- Foundation/GTMGeometryUtils.h | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'Foundation/GTMGeometryUtils.h') diff --git a/Foundation/GTMGeometryUtils.h b/Foundation/GTMGeometryUtils.h index 32c8745..a58ac13 100644 --- a/Foundation/GTMGeometryUtils.h +++ b/Foundation/GTMGeometryUtils.h @@ -19,15 +19,17 @@ // the License. // -#include +#import +#import "GTMDefines.h" -typedef enum { +enum { GTMScaleProportionally = 0, // Fit proportionally GTMScaleToFit, // Forced fit (distort if necessary) GTMScaleNone // Don't scale (clip) -} GTMScaling; +}; +typedef NSUInteger GTMScaling; -typedef enum { +enum { GTMRectAlignCenter = 0, GTMRectAlignTop, GTMRectAlignTopLeft, @@ -37,7 +39,8 @@ typedef enum { GTMRectAlignBottomLeft, GTMRectAlignBottomRight, GTMRectAlignRight -} GTMRectAlignment; +}; +typedef NSUInteger GTMRectAlignment; #pragma mark Miscellaneous @@ -49,10 +52,14 @@ typedef enum { // // Returns: // Distance -CG_INLINE float GTMDistanceBetweenPoints(NSPoint pt1, NSPoint pt2) { - float dX = pt1.x - pt2.x; - float dY = pt1.y - pt2.y; +CG_INLINE CGFloat GTMDistanceBetweenPoints(NSPoint pt1, NSPoint pt2) { + CGFloat dX = pt1.x - pt2.x; + CGFloat dY = pt1.y - pt2.y; +#if CGFLOAT_IS_DOUBLE + return sqrt(dX * dX + dY * dY); +#else return sqrtf(dX * dX + dY * dY); +#endif } #pragma mark - @@ -314,7 +321,7 @@ CG_INLINE CGRect GTMCGRectOfSize(CGSize size) { // // Returns: // Converted Rect -CG_INLINE NSRect GTMNSRectScale(NSRect inRect, float xScale, float yScale) { +CG_INLINE NSRect GTMNSRectScale(NSRect inRect, CGFloat xScale, CGFloat yScale) { return NSMakeRect(inRect.origin.x, inRect.origin.y, inRect.size.width * xScale, inRect.size.height * yScale); } @@ -328,7 +335,7 @@ CG_INLINE NSRect GTMNSRectScale(NSRect inRect, float xScale, float yScale) { // // Returns: // Converted Rect -CG_INLINE CGRect GTMCGRectScale(CGRect inRect, float xScale, float yScale) { +CG_INLINE CGRect GTMCGRectScale(CGRect inRect, CGFloat xScale, CGFloat yScale) { return CGRectMake(inRect.origin.x, inRect.origin.y, inRect.size.width * xScale, inRect.size.height * yScale); } -- cgit v1.2.3