Revision: 5314
http://skim-app.svn.sourceforge.net/skim-app/?rev=5314&view=rev
Author: hofman
Date: 2009-04-16 15:35:46 +0000 (Thu, 16 Apr 2009)
Log Message:
-----------
Use 64-bit safe string specifiers for integers
Modified Paths:
--------------
trunk/BDSKDragImageView.m
trunk/NSData_SKExtensions.m
trunk/NSNumber_SKExtensions.m
trunk/NSString_SKExtensions.m
trunk/PDFPage_SKExtensions.m
trunk/SKBookmark.m
trunk/SKBookmarkController.m
trunk/SKCFCallBacks.m
trunk/SKConversionProgressController.m
trunk/SKFontWell.m
trunk/SKInfoWindowController.m
trunk/SKLineWell.m
trunk/SKMainWindowController.m
trunk/SKMainWindowController_UI.m
trunk/SKNote.m
trunk/SKNoteWindowController.m
trunk/SKNotesDocument.m
trunk/SKPDFDocument.m
trunk/SKPDFOutline.m
trunk/SKSnapshotWindowController.m
trunk/SKVersionNumber.m
Modified: trunk/BDSKDragImageView.m
===================================================================
--- trunk/BDSKDragImageView.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/BDSKDragImageView.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -64,7 +64,7 @@
NSInteger i = 0;
while ([fm fileExistsAtPath:path])
- path = [[basePath stringByAppendingFormat:@"-%i", ++i]
stringByAppendingPathExtension:@"tiff"];
+ path = [[basePath stringByAppendingFormat:@"-%ld", (long)++i]
stringByAppendingPathExtension:@"tiff"];
[[image TIFFRepresentation] writeToFile:path atomically:YES];
[[NSWorkspace sharedWorkspace] openTempFile:path];
Modified: trunk/NSData_SKExtensions.m
===================================================================
--- trunk/NSData_SKExtensions.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/NSData_SKExtensions.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -54,7 +54,7 @@
- (NSUInteger)indexOfBytes:(const void *)patternBytes
length:(NSUInteger)patternLength options:(NSInteger)mask
range:(NSRange)searchRange {
NSUInteger selfLength = [self length];
if (searchRange.location > selfLength || NSMaxRange(searchRange) >
selfLength)
- [NSException raise:NSRangeException format:@"Range {%u,%u} exceeds
length %u", searchRange.location, searchRange.length, selfLength];
+ [NSException raise:NSRangeException format:@"Range {%lu,%lu} exceeds
length %lu", (unsigned long)searchRange.location, (unsigned
long)searchRange.length, (unsigned long)selfLength];
const unsigned char *selfBufferStart, *selfPtr, *selfPtrEnd, *selfPtrMax;
const unsigned char firstPatternByte = *(const char *)patternBytes;
Modified: trunk/NSNumber_SKExtensions.m
===================================================================
--- trunk/NSNumber_SKExtensions.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/NSNumber_SKExtensions.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -74,7 +74,7 @@
NSUInteger digit, offset, number = [self unsignedIntValue];
if (number >= 5000)
- [NSException raise:@"Roman Numeral Exception" format:@"The number %i
is too big to represent as a roman numeral.", number];
+ [NSException raise:@"Roman Numeral Exception" format:@"The number %lu
is too big to represent as a roman numeral.", (unsigned long)number];
for (offset = 0; number > 0 && offset < 7; offset += 2) {
digit = number % 10;
Modified: trunk/NSString_SKExtensions.m
===================================================================
--- trunk/NSString_SKExtensions.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/NSString_SKExtensions.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -75,7 +75,7 @@
buffer = stackBuffer;
}
- NSCAssert1(buffer != NULL, @"failed to allocate memory for string of
length %d", length);
+ NSCAssert1(buffer != NULL, @"failed to allocate memory for string of
length %ld", (long)length);
BOOL isFirst = NO, wasHyphen = NO;
CFIndex bufCnt = 0;
Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/PDFPage_SKExtensions.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -246,7 +246,7 @@
NSImage *image = [self thumbnailWithSize:size
forBox:kPDFDisplayBoxCropBox];
NSFileWrapper *wrapper = [[NSFileWrapper alloc]
initRegularFileWithContents:[image TIFFRepresentation]];
- NSString *filename = [NSString stringWithFormat:@"page_%u.tiff", [self
pageIndex] + 1];
+ NSString *filename = [NSString stringWithFormat:@"page_%lu.tiff",
(unsigned long)([self pageIndex] + 1)];
[wrapper setFilename:filename];
[wrapper setPreferredFilename:filename];
@@ -405,7 +405,7 @@
}
- (NSString *)sequentialLabel {
- return [NSString stringWithFormat:@"%u", [self pageIndex] + 1];
+ return [NSString stringWithFormat:@"%lu", (unsigned long)([self pageIndex]
+ 1)];
}
- (NSString *)displayLabel {
Modified: trunk/SKBookmark.m
===================================================================
--- trunk/SKBookmark.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKBookmark.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -320,7 +320,7 @@
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<%@: label=%@, path=%@, page=%i>",
[self class], label, [self path], pageIndex];
+ return [NSString stringWithFormat:@"<%@: label=%@, path=%@, page=%lu>",
[self class], label, [self path], (unsigned long)pageIndex];
}
- (NSDictionary *)properties {
Modified: trunk/SKBookmarkController.m
===================================================================
--- trunk/SKBookmarkController.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKBookmarkController.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -207,7 +207,7 @@
message = [bookmark path];
} else if ([bookmark bookmarkType] == SKBookmarkTypeFolder) {
NSInteger count = [bookmark countOfChildren];
- message = count == 1 ? NSLocalizedString(@"1 item", @"Bookmark
folder description") : [NSString stringWithFormat:NSLocalizedString(@"%i
items", @"Bookmark folder description"), count];
+ message = count == 1 ? NSLocalizedString(@"1 item", @"Bookmark
folder description") : [NSString stringWithFormat:NSLocalizedString(@"%ld
items", @"Bookmark folder description"), (long)count];
}
}
[statusBar setLeftStringValue:message ?: @""];
@@ -621,7 +621,7 @@
} else if ([tcID isEqualToString:FILE_COLUMNID]) {
if ([item bookmarkType] == SKBookmarkTypeFolder || [item bookmarkType]
== SKBookmarkTypeSession) {
NSInteger count = [item countOfChildren];
- return count == 1 ? NSLocalizedString(@"1 item", @"Bookmark folder
description") : [NSString stringWithFormat:NSLocalizedString(@"%i items",
@"Bookmark folder description"), count];
+ return count == 1 ? NSLocalizedString(@"1 item", @"Bookmark folder
description") : [NSString stringWithFormat:NSLocalizedString(@"%ld items",
@"Bookmark folder description"), (long)count];
} else {
return [item path];
}
Modified: trunk/SKCFCallBacks.m
===================================================================
--- trunk/SKCFCallBacks.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKCFCallBacks.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -129,7 +129,7 @@
}
CFStringRef SKNSRangeCopyDescription(const void *value) {
- return CFStringCreateWithFormat(NULL, NULL, CFSTR("(%u, %u)"), ((NSRange
*)value)->location, ((NSRange *)value)->length);
+ return CFStringCreateWithFormat(NULL, NULL, CFSTR("(%lu, %lu)"), (unsigned
long)(((NSRange *)value)->location), (unsigned long)(((NSRange
*)value)->length));
}
Boolean SKNSRangeEqual(const void *value1, const void *value2) {
Modified: trunk/SKConversionProgressController.m
===================================================================
--- trunk/SKConversionProgressController.m 2009-04-16 15:22:33 UTC (rev
5313)
+++ trunk/SKConversionProgressController.m 2009-04-16 15:35:46 UTC (rev
5314)
@@ -277,7 +277,7 @@
- (void)processingPostScriptPage:(NSNumber *)page;
{
- [textField setStringValue:[[NSString
stringWithFormat:NSLocalizedString(@"Processing page %d", @"PS conversion
progress message"), [page intValue]] stringByAppendingEllipsis]];
+ [textField setStringValue:[[NSString
stringWithFormat:NSLocalizedString(@"Processing page %ld", @"PS conversion
progress message"), (long)[page intValue]] stringByAppendingEllipsis]];
}
- (void)showPostScriptConversionMessage:(NSString *)message;
Modified: trunk/SKFontWell.m
===================================================================
--- trunk/SKFontWell.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKFontWell.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -243,7 +243,7 @@
- (void)fontChanged {
if ([self isActive])
[[NSFontManager sharedFontManager] setSelectedFont:[self font]
isMultiple:NO];
- [self setTitle:[NSString stringWithFormat:@"%@ %i", [[self font]
displayName], (NSInteger)[self fontSize]]];
+ [self setTitle:[NSString stringWithFormat:@"%@ %li", [[self font]
displayName], (long)[self fontSize]]];
[self setNeedsDisplay:YES];
}
Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKInfoWindowController.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -214,7 +214,7 @@
if ([doc respondsToSelector:@selector(pdfDocument)] && (pdfDoc =
[(SKPDFDocument *)doc pdfDocument])) {
[dictionary addEntriesFromDictionary:[pdfDoc documentAttributes]];
- [dictionary setValue:[NSString stringWithFormat: @"%d.%d", [pdfDoc
majorVersion], [pdfDoc minorVersion]] forKey:SKInfoVersionKey];
+ [dictionary setValue:[NSString stringWithFormat: @"%ld.%ld",
(long)[pdfDoc majorVersion], (long)[pdfDoc minorVersion]]
forKey:SKInfoVersionKey];
[dictionary setValue:[NSNumber numberWithInt:[pdfDoc pageCount]]
forKey:SKInfoPageCountKey];
if ([pdfDoc pageCount]) {
NSSize cropSize = [[pdfDoc pageAtIndex:0]
boundsForBox:kPDFDisplayBoxCropBox].size;
Modified: trunk/SKLineWell.m
===================================================================
--- trunk/SKLineWell.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKLineWell.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -739,7 +739,7 @@
} else if ([attribute isEqualToString:NSAccessibilityValueAttribute]) {
return [NSNumber numberWithInt:[self isActive]];
} else if ([attribute isEqualToString:NSAccessibilityTitleAttribute]) {
- return [NSString stringWithFormat:@"%@ %i", NSLocalizedString(@"line
width", @"Accessibility description"), (NSInteger)[self lineWidth]];
+ return [NSString stringWithFormat:@"%@ %ld", NSLocalizedString(@"line
width", @"Accessibility description"), (long)[self lineWidth]];
} else if ([attribute isEqualToString:NSAccessibilityHelpAttribute]) {
return [self toolTip];
} else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKMainWindowController.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -601,7 +601,7 @@
#pragma mark UI updating
- (void)updateLeftStatus {
- NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Page %i
of %i", @"Status message"), [self pageNumber], [[pdfView document] pageCount]];
+ NSString *message = [NSString stringWithFormat:NSLocalizedString(@"Page
%ld of %ld", @"Status message"), (long)[self pageNumber], (long)[[pdfView
document] pageCount]];
[statusBar setLeftStringValue:message];
}
@@ -622,7 +622,7 @@
CGFloat factor = useMetric ? 0.035277778 : 0.013888889;
message = [NSString stringWithFormat:@"%.2f %C %.2f @ (%.2f, %.2f)
%@", NSWidth(selRect) * factor, MULTIPLICATION_SIGN_CHARACTER,
NSHeight(selRect) * factor, NSMinX(selRect) * factor, NSMinY(selRect) * factor,
units];
} else {
- message = [NSString stringWithFormat:@"%i %C %i @ (%i, %i) pt",
(NSInteger)NSWidth(selRect), MULTIPLICATION_SIGN_CHARACTER,
(NSInteger)NSHeight(selRect), (NSInteger)NSMinX(selRect),
(NSInteger)NSMinY(selRect)];
+ message = [NSString stringWithFormat:@"%ld %C %ld @ (%ld, %ld)
pt", (long)NSWidth(selRect), MULTIPLICATION_SIGN_CHARACTER,
(long)NSHeight(selRect), (long)NSMinX(selRect), (long)NSMinY(selRect)];
}
}
[statusBar setRightStringValue:message];
@@ -1954,7 +1954,7 @@
- (void)documentDidEndDocumentFind:(NSNotification *)note {
if (findPanelFind == NO) {
- NSString *message = [NSString stringWithFormat:NSLocalizedString(@"%i
Results", @"Message in search table header"), [searchResults count]];
+ NSString *message = [NSString stringWithFormat:NSLocalizedString(@"%ld
Results", @"Message in search table header"), (long)[searchResults count]];
[self didChangeValueForKey:GROUPEDSEARCHRESULTS_KEY];
[self didChangeValueForKey:SEARCHRESULTS_KEY];
[[[findTableView tableColumnWithIdentifier:RESULTS_COLUMNID]
headerCell] setStringValue:message];
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKMainWindowController_UI.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -213,7 +213,7 @@
- (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName {
if ([pdfView document])
- return [NSString stringWithFormat:NSLocalizedString(@"%@ (page %i of
%i)", @"Window title format"), displayName, [self pageNumber], [[pdfView
document] pageCount]];
+ return [NSString stringWithFormat:NSLocalizedString(@"%@ (page %ld of
%ld)", @"Window title format"), displayName, (long)[self pageNumber],
(long)[[pdfView document] pageCount]];
else
return displayName;
}
@@ -414,7 +414,7 @@
[string appendString:@"* "];
[string appendFormat:NSLocalizedString(@"Page %@", @""), [[result
page] displayLabel]];
[string appendString:@": "];
- [string appendFormat:NSLocalizedString(@"%i Results", @""),
[matches count]];
+ [string appendFormat:NSLocalizedString(@"%ld Results", @""),
(long)[matches count]];
[string appendFormat:@":\n...@\n", [[matches
valueForKeyPath:@"contextString.string"] componentsJoinedByString:@"\n\t"]];
idx = [rowIndexes indexGreaterThanIndex:idx];
}
Modified: trunk/SKNote.m
===================================================================
--- trunk/SKNote.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKNote.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -73,7 +73,7 @@
- (id)page {
NSUInteger pageIndex = [self pageIndex];
- return [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber
numberWithUnsignedInt:pageIndex], @"pageIndex", [NSString
stringWithFormat:@"%u", pageIndex + 1], @"label", nil];
+ return [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber
numberWithUnsignedInt:pageIndex], @"pageIndex", [NSString
stringWithFormat:@"%lu", (unsigned long)(pageIndex + 1)], @"label", nil];
}
- (NSArray *)texts {
Modified: trunk/SKNoteWindowController.m
===================================================================
--- trunk/SKNoteWindowController.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKNoteWindowController.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -129,7 +129,7 @@
- (void)updateStatusMessage {
NSRect bounds = [note bounds];
- [statusBar setLeftStringValue:[NSString
stringWithFormat:NSLocalizedString(@"Page %@ at (%i, %i)", @"Status message"),
[[note page] displayLabel], (NSInteger)NSMidX(bounds),
(NSInteger)NSMidY(bounds)]];
+ [statusBar setLeftStringValue:[NSString
stringWithFormat:NSLocalizedString(@"Page %@ at (%ld, %ld)", @"Status
message"), [[note page] displayLabel], (long)NSMidX(bounds),
(long)NSMidY(bounds)]];
}
- (void)windowDidLoad {
@@ -305,7 +305,7 @@
NSInteger i = 0;
NSFileManager *fm = [NSFileManager defaultManager];
while ([fm fileExistsAtPath:path])
- path = [[basePath stringByAppendingFormat:@"-%i", ++i]
stringByAppendingPathExtension:@"tiff"];
+ path = [[basePath stringByAppendingFormat:@"-%ld", (long)++i]
stringByAppendingPathExtension:@"tiff"];
if ([[image TIFFRepresentation] writeToFile:path atomically:YES])
return [NSArray arrayWithObjects:[path lastPathComponent], nil];
}
Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKNotesDocument.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -444,7 +444,7 @@
} else if([tcID isEqualToString:TYPE_COLUMNID]) {
return [NSDictionary dictionaryWithObjectsAndKeys:[item type],
SKAnnotationTypeImageCellTypeKey, nil];
} else if ([tcID isEqualToString:PAGE_COLUMNID]) {
- return [item type] ? [NSString stringWithFormat:@"%u", [item
pageIndex] + 1] : nil;
+ return [item type] ? [NSString stringWithFormat:@"%lu", (unsigned
long)([item pageIndex] + 1)] : nil;
}
return nil;
}
Modified: trunk/SKPDFDocument.m
===================================================================
--- trunk/SKPDFDocument.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKPDFDocument.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -808,10 +808,10 @@
NSMutableString *string = [NSMutableString
stringWithFormat:@"%%FDF-1.2\n%%%C%C%C%C\n", 0xe2, 0xe3, 0xcf, 0xd3];
NSMutableString *annots = [NSMutableString string];
for (i = 0; i < count; i++) {
- [string appendFormat:@"%i 0 obj<<%@>>\nendobj\n", i + 1, [[[self
notes] objectAtIndex:i] fdfString]];
- [annots appendFormat:@"%i 0 R ", i + 1];
+ [string appendFormat:@"%ld 0 obj<<%@>>\nendobj\n", (long)(i + 1),
[[[self notes] objectAtIndex:i] fdfString]];
+ [annots appendFormat:@"%ld 0 R ", (long)(i + 1)];
}
- [string appendFormat:@"%i 0 obj<<", i + 1];
+ [string appendFormat:@"%ld 0 obj<<", (long)(i + 1)];
[string appendFDFName:SKFDFFDFKey];
[string appendString:@"<<"];
[string appendFDFName:SKFDFAnnotationsKey];
@@ -829,7 +829,7 @@
[string appendString:@">>\nendobj\n"];
[string appendString:@"trailer\n<<"];
[string appendFDFName:SKFDFRootKey];
- [string appendFormat:@" %i 0 R", i + 1];
+ [string appendFormat:@" %ld 0 R", (long)(i + 1)];
[string appendString:@">>\n"];
[string appendString:@"%%EOF\n"];
return string;
@@ -1559,7 +1559,7 @@
break;
nextChar = NSMaxRange(range) < [cmdString length] ? [cmdString
characterAtIndex:NSMaxRange(range)] : 0;
if ([[NSCharacterSet letterCharacterSet]
characterIsMember:nextChar] == NO) {
- NSString *lineString = [NSString stringWithFormat:@"%d", line
+ 1];
+ NSString *lineString = [NSString stringWithFormat:@"%ld",
(long)(line + 1)];
[cmdString replaceCharactersInRange:range
withString:lineString];
range.length = [lineString length];
}
Modified: trunk/SKPDFOutline.m
===================================================================
--- trunk/SKPDFOutline.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKPDFOutline.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -118,7 +118,7 @@
if (page)
return [page displayLabel];
else if ([outline respondsToSelector:@selector(action)] && [[outline
action] respondsToSelector:@selector(pageIndex)])
- return [NSString stringWithFormat:@"%u", [(PDFActionRemoteGoTo
*)[outline action] pageIndex] + 1];
+ return [NSString stringWithFormat:@"%lu", (unsigned
long)([(PDFActionRemoteGoTo *)[outline action] pageIndex] + 1)];
else
return nil;
}
Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKSnapshotWindowController.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -465,7 +465,7 @@
NSImage *image = [self thumbnailWithSize:size];
NSFileWrapper *wrapper = [[NSFileWrapper alloc]
initRegularFileWithContents:[image TIFFRepresentation]];
- NSString *filename = [NSString stringWithFormat:@"snapshot_page_%u.tiff",
[self pageIndex] + 1];
+ NSString *filename = [NSString
stringWithFormat:@"snapshot_page_%lu.tiff",(unsigned long)( [self pageIndex] +
1)];
[wrapper setFilename:filename];
[wrapper setPreferredFilename:filename];
Modified: trunk/SKVersionNumber.m
===================================================================
--- trunk/SKVersionNumber.m 2009-04-16 15:22:33 UTC (rev 5313)
+++ trunk/SKVersionNumber.m 2009-04-16 15:35:46 UTC (rev 5314)
@@ -52,7 +52,7 @@
if ([scanner scanInt:&component] && component >= 0) {
- [mutableVersionString appendFormat:@"%...@%i", sep, component];
+ [mutableVersionString appendFormat:@"%...@%ld", sep,
(long)component];
componentCount++;
components = realloc(components, sizeof(*components) *
componentCount);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today.
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit