Reputation: 5634
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);
}
Upvotes: 4
Views: 1591
Reputation: 61
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 );
Upvotes: 6
Reputation: 23
Sorry, but i cannot found how is fixed this compiler error. I'm on the same situation as Alex. Trying to compile the examples and get the same error. Running on XCode 4.6 and Mountain Lion. CorePlot 1.1 and tried targets 5.1,6.0 and 6.1
Thanks for any help.
Upvotes: 1