kaiserfarrell / core-plot

Automatically exported from code.google.com/p/core-plot
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Error in CPTUilties.m with FIX #504

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load up CorePlot-CocoaTouch Project
2. Try to compile for iOS SDK 6.1
3. ERROR in class file CPTUtilities.m in /Source/Types and Functions/

What is the expected output? What do you see instead?
I should get a Clean Build of CorePlot-CocoaTouch for iOS 6.1
Instead I get a Compiler Error in CPTUtilities.m

What version of the product are you using? On what operating system?
V1.1 on Mac OS X 10.7.5

Please provide any additional information below.
Simple Fix, Open CPTUtilities.m and navigate to the line:

#pragma mark Ranges
in the function that follows change the line:
NSUInteger loc            = MAX(0, (NSInteger)range.location - expandBy);

to

NSUInteger loc            = (NSUInteger)MAX(0, (NSInteger)range.location - 
expandBy);

The compiler really shouldn't complain about it since we are getting the max of 
0 and any other number it will always be an unsigned number.  

Original issue reported on code.google.com by robmroc...@gmail.com on 1 Feb 2013 at 5:12

GoogleCodeExporter commented 8 years ago
Sorry the method that follows is: NSRange CPTExpandedRange(NSRange range, 
NSInteger expandBy)

This is the full source for the method, WITH THE FIX INCLUDED:

NSRange CPTExpandedRange(NSRange range, NSInteger expandBy)
{
    NSUInteger loc            = (NSUInteger)MAX(0, (NSInteger)range.location - expandBy);
    NSUInteger lowerExpansion = range.location - loc;
    NSUInteger length         = (NSUInteger)( (NSInteger)(range.length + lowerExpansion) + expandBy );

    return NSMakeRange(loc, length);
}

Original comment by robmroc...@gmail.com on 1 Feb 2013 at 5:17

GoogleCodeExporter commented 8 years ago
Related to issue 502. Already fixed.

Original comment by eskr...@mac.com on 1 Feb 2013 at 6:58