From 769ea7847b21c4eafcb32b18045b8c6a13e08c0a Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 9 Jan 2012 23:45:35 +0000 Subject: - Expicitly cast parameters before passing into NSString formatters assuming 64-bit lengths; this addresses exceptions and hangs viewing table contents on 32-bit machines, many thanks to stuart02 for identifying and tracking down this issue --- Source/SPCopyTable.m | 2 +- Source/SPCustomQuery.m | 2 +- Source/SPTableContent.m | 4 ++-- Source/SPTableData.m | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'Source') diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index bfd00c49..e8b1533d 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -711,7 +711,7 @@ static const NSInteger kBlobAsImageFile = 4; if ([[NSThread currentThread] isCancelled]) return nil; columnWidth = [self autodetectWidthForColumnDefinition:columnDefinition maxRows:100]; - [columnWidths setObject:[NSString stringWithFormat:@"%llu", columnWidth] forKey:[columnDefinition objectForKey:@"datacolumnindex"]]; + [columnWidths setObject:[NSString stringWithFormat:@"%llu", (unsigned long long)columnWidth] forKey:[columnDefinition objectForKey:@"datacolumnindex"]]; allColumnWidths += columnWidth; } diff --git a/Source/SPCustomQuery.m b/Source/SPCustomQuery.m index 6aeca55a..3cadaba5 100644 --- a/Source/SPCustomQuery.m +++ b/Source/SPCustomQuery.m @@ -2103,7 +2103,7 @@ } } else { isDesc = NO; - [[customQueryView onMainThread] setIndicatorImage:nil inTableColumn:[customQueryView tableColumnWithIdentifier:[NSString stringWithFormat:@"%lld", [sortField integerValue]]]]; + [[customQueryView onMainThread] setIndicatorImage:nil inTableColumn:[customQueryView tableColumnWithIdentifier:[NSString stringWithFormat:@"%lld", (long long)[sortField integerValue]]]]; if (sortField) [sortField release]; sortField = [[NSNumber alloc] initWithInteger:[[tableColumn identifier] integerValue]]; } diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 7cffef85..14f07866 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -634,7 +634,7 @@ // If the table has been reloaded and the previously selected sort column is still present, reselect it. if (sortColumnNumberToRestore != NSNotFound) { - theCol = [tableContentView tableColumnWithIdentifier:[NSString stringWithFormat:@"lld", sortColumnNumberToRestore]]; + theCol = [tableContentView tableColumnWithIdentifier:[NSString stringWithFormat:@"%lld", (long long)sortColumnNumberToRestore]]; if (sortCol) [sortCol release]; sortCol = [[NSNumber alloc] initWithInteger:sortColumnNumberToRestore]; [tableContentView setHighlightedTableColumn:theCol]; @@ -4216,7 +4216,7 @@ } } else { isDesc = NO; - [[tableContentView onMainThread] setIndicatorImage:nil inTableColumn:[tableContentView tableColumnWithIdentifier:[NSString stringWithFormat:@"%lld", [sortCol integerValue]]]]; + [[tableContentView onMainThread] setIndicatorImage:nil inTableColumn:[tableContentView tableColumnWithIdentifier:[NSString stringWithFormat:@"%lld", (long long)[sortCol integerValue]]]]; if (sortCol) [sortCol release]; sortCol = [[NSNumber alloc] initWithInteger:[[tableColumn identifier] integerValue]]; } diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 554b3e36..297718b9 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -590,7 +590,7 @@ } [fieldsParser setIgnoreCommentStrings:NO]; - [tableColumn setObject:[NSString stringWithFormat:@"%llu", [tableColumns count]] forKey:@"datacolumnindex"]; + [tableColumn setObject:[NSString stringWithFormat:@"%llu", (unsigned long long)[tableColumns count]] forKey:@"datacolumnindex"]; [tableColumn setObject:fieldName forKey:@"name"]; // Split the remaining field definition string by spaces and process @@ -872,7 +872,7 @@ resultRow = [theResult fetchRowAsDictionary]; // Add the column index and name - [tableColumn setObject:[NSString stringWithFormat:@"%llu", [tableColumns count]] forKey:@"datacolumnindex"]; + [tableColumn setObject:[NSString stringWithFormat:@"%llu", (unsigned long long)[tableColumns count]] forKey:@"datacolumnindex"]; [tableColumn setObject:[NSString stringWithString:[resultRow objectForKey:@"Field"]] forKey:@"name"]; // Populate type, length, and other available details from the Type columns -- cgit v1.2.3