Skip to content

Commit

Permalink
minor string formatting fixes to suppress XCode 4.5 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Hefner committed Sep 20, 2012
1 parent 29073d7 commit 73a498a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DDMathParser/DDMathStringToken.m
Expand Up @@ -78,7 +78,7 @@ - (NSString *)debugDescription {
[d appendFormat:@"arity:%@, ", arityNames[arity]];

NSInteger precedence = [self operatorPrecedence];
[d appendFormat:@"precedence:%ld, ", precedence];
[d appendFormat:@"precedence:%d, ", precedence];

DDOperatorAssociativity assoc = [self operatorAssociativity];
NSString *assocNames[2] = { @"LEFT", @"RIGHT" };
Expand Down
2 changes: 1 addition & 1 deletion DDMathParser/_DDFunctionUtilities.m
Expand Up @@ -442,7 +442,7 @@ + (DDMathFunction) randomFunction {

if ([upperBound integerValue] <= [lowerBound integerValue]) {
if (error != nil) {
*error = ERR(DDErrorCodeInvalidArgument, @"upper bound (%ld) of random() must be larger than lower bound (%ld)", [upperBound integerValue], [lowerBound integerValue]);
*error = ERR(DDErrorCodeInvalidArgument, @"upper bound (%d) of random() must be larger than lower bound (%d)", [upperBound integerValue], [lowerBound integerValue]);
}
return nil;
}
Expand Down

2 comments on commit 73a498a

@horaceho
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better (for 32-bit and 64-bit compatibility) fix should be:

`[d appendFormat:@"precedence:%ld, ", (long)precedence];``

source: stackoverflow

@jhefner
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Please sign in to comment.