Permalink
Browse files

Merge pull request #28 from mpakes/master

Fix for issue #15 - va_arg errors with LLVM GCC 4.2
  • Loading branch information...
2 parents 06b79c1 + b85d298 commit a80dda50758de067b35d0533dfda2bc708b1b6cf @ccgus ccgus committed Aug 17, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/FMDatabase.m
View
@@ -346,7 +346,7 @@ - (void)_extractSQL:(NSString *)sql argumentsList:(va_list)args intoString:(NSMu
case '@':
arg = va_arg(args, id); break;
case 'c':
- arg = [NSString stringWithFormat:@"%c", va_arg(args, char)]; break;
+ arg = [NSString stringWithFormat:@"%c", va_arg(args, int)]; break;
case 's':
arg = [NSString stringWithUTF8String:va_arg(args, char*)]; break;
case 'd':
@@ -359,10 +359,10 @@ - (void)_extractSQL:(NSString *)sql argumentsList:(va_list)args intoString:(NSMu
case 'h':
i++;
if (i < length && [sql characterAtIndex:i] == 'i') {
- arg = [NSNumber numberWithShort:va_arg(args, short)];
+ arg = [NSNumber numberWithInt:va_arg(args, int)];
}
else if (i < length && [sql characterAtIndex:i] == 'u') {
- arg = [NSNumber numberWithUnsignedShort:va_arg(args, unsigned short)];
+ arg = [NSNumber numberWithInt:va_arg(args, int)];
}
else {
i--;
@@ -383,7 +383,7 @@ - (void)_extractSQL:(NSString *)sql argumentsList:(va_list)args intoString:(NSMu
case 'f':
arg = [NSNumber numberWithDouble:va_arg(args, double)]; break;
case 'g':
- arg = [NSNumber numberWithFloat:va_arg(args, float)]; break;
+ arg = [NSNumber numberWithDouble:va_arg(args, double)]; break;
case 'l':
i++;
if (i < length) {

0 comments on commit a80dda5

Please sign in to comment.