When trying to compile the following CorePlot 1.1 examples in Xcode 4.6, I get an compiler error.
DatePlot
CPTTestApp - iPad
Compiler error in CPTUtilities.m
: Operand of ? changes signedness: 'int' to 'NSUInteger' (aka 'unsigned int')
NSRange CPTExpandedRange(NSRange range, NSInteger expandBy)
{
NSUInteger loc = MAX(0, (NSInteger)range.location - expandBy);
NSUInteger lowerExpsion = range.location - loc; // Here is the error
NSUInteger length = (NSUInteger)( (NSInteger)(range.length + lowerExpansion) + expandBy);
return NSMakeRange(loc, length);
}
Yes, the answer is placed there, simply only changes the function, I left a copy that how is the right code:
NSRange CPTExpandedRange(NSRange range, NSInteger expandBy)
//NSUInteger loc = MAX(0, (NSInteger)range.location - expandBy);
//NSUInteger lowerExpansion = range.location - loc;
//NSUInteger length = (NSUInteger)( (NSInteger)(range.length + lowerExpansion) + expandBy );
NSInteger loc = MAX(0, (NSInteger)range.location - expandBy);
NSInteger lowerExpansion = (NSInteger)range.location - loc;
NSInteger length = MAX(0, (NSInteger)range.length + lowerExpansion + expandBy);
//return NSMakeRange(loc, length);
return NSMakeRange( (NSUInteger)loc, (NSUInteger)length );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With