diff options
author | rowanbeentje <rowan@beent.je> | 2013-05-22 00:00:32 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2013-05-22 00:00:32 +0000 |
commit | 09db04621e284c109391efe3b0bbc70b26b043b4 (patch) | |
tree | b3d81290c99d96eb207a0b0352c2481b7bfb6839 /Source | |
parent | 2737ac00c38513d976fda08104a5014221b0c99c (diff) | |
download | sequelpro-09db04621e284c109391efe3b0bbc70b26b043b4.tar.gz sequelpro-09db04621e284c109391efe3b0bbc70b26b043b4.tar.bz2 sequelpro-09db04621e284c109391efe3b0bbc70b26b043b4.zip |
- Address further Release/Distribution build warnings
Diffstat (limited to 'Source')
-rw-r--r-- | Source/NoodleLineNumberView.m | 2 | ||||
-rw-r--r-- | Source/SPActivityTextFieldCell.m | 2 | ||||
-rw-r--r-- | Source/SPAppController.m | 14 | ||||
-rw-r--r-- | Source/SPBundleEditorController.m | 4 | ||||
-rw-r--r-- | Source/SPBundleHTMLOutputController.m | 4 | ||||
-rw-r--r-- | Source/SPCopyTable.m | 14 | ||||
-rw-r--r-- | Source/SPDataAdditions.m | 2 | ||||
-rw-r--r-- | Source/SPDataImport.m | 2 | ||||
-rw-r--r-- | Source/SPDatabaseDocument.m | 4 | ||||
-rw-r--r-- | Source/SPFieldEditorController.m | 56 | ||||
-rw-r--r-- | Source/SPFieldMapperController.m | 18 | ||||
-rw-r--r-- | Source/SPSSHTunnel.m | 2 |
12 files changed, 62 insertions, 62 deletions
diff --git a/Source/NoodleLineNumberView.m b/Source/NoodleLineNumberView.m index 8307367f..39b435f7 100644 --- a/Source/NoodleLineNumberView.m +++ b/Source/NoodleLineNumberView.m @@ -350,7 +350,7 @@ typedef NSRange (*RangeOfLineIMP)(id object, SEL selector, NSRange range); // portion. Need to compensate for the clipview's coordinates. // Line numbers are internally stored starting at 0 - labelText = [NSString stringWithFormat:@"%lu", (NSUInteger)(line + 1)]; + labelText = [NSString stringWithFormat:@"%llu", (unsigned long long)(line + 1)]; // How many digits has the current line number? NSUInteger idx = line + 1; diff --git a/Source/SPActivityTextFieldCell.m b/Source/SPActivityTextFieldCell.m index f2cfbdba..d5ef9906 100644 --- a/Source/SPActivityTextFieldCell.m +++ b/Source/SPActivityTextFieldCell.m @@ -256,7 +256,7 @@ static inline NSRect SPTextLinkRectFromCellRect(NSRect inRect) NSTask *killTask = [[NSTask alloc] init]; [killTask setLaunchPath:@"/bin/sh"]; // [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"kill -9 -%ld", pid], nil]]; - [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"[[ `ps -ax | egrep '%ld.*%@' | wc -l` -eq \"4\" ]] && kill -9 -%ld 2&> /tmp/sp_kill_error.txt", pid, SPBundleTaskScriptCommandFilePath, pid], nil]]; + [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"[[ `ps -ax | egrep '%ld.*%@' | wc -l` -eq \"4\" ]] && kill -9 -%ld 2&> /tmp/sp_kill_error.txt", (long)pid, SPBundleTaskScriptCommandFilePath, (long)pid], nil]]; [killTask launch]; [killTask waitUntilExit]; status = [killTask terminationStatus]; diff --git a/Source/SPAppController.m b/Source/SPAppController.m index f08762e6..eb5c0241 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -1174,7 +1174,7 @@ NSIndexSet *selectedRows = [firstResponder selectedRowIndexes]; NSUInteger rowIndex = [selectedRows firstIndex]; while ( rowIndex != NSNotFound ) { - [sel addObject:[NSString stringWithFormat:@"%ld", rowIndex]]; + [sel addObject:[NSString stringWithFormat:@"%ld", (long)rowIndex]]; rowIndex = [selectedRows indexGreaterThanIndex:rowIndex]; } [env setObject:[sel componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableSelectedRowIndices]; @@ -1567,7 +1567,7 @@ if([cmdDataOld objectForKey:SPBundleFileDefaultBundleWasModifiedKey]) { // Duplicate Bundle, change the UUID and rename the menu label - NSString *duplicatedBundle = [NSString stringWithFormat:@"%@/%@_%ld.%@", [bundlePaths objectAtIndex:0], [bundle substringToIndex:([bundle length] - [SPUserBundleFileExtension length] - 1)], (NSUInteger)(random() % 35000), SPUserBundleFileExtension]; + NSString *duplicatedBundle = [NSString stringWithFormat:@"%@/%@_%ld.%@", [bundlePaths objectAtIndex:0], [bundle substringToIndex:([bundle length] - [SPUserBundleFileExtension length] - 1)], (long)(random() % 35000), SPUserBundleFileExtension]; if(![[NSFileManager defaultManager] copyItemAtPath:oldBundle toPath:duplicatedBundle error:nil]) { NSLog(@"Couldn't copy “%@” to update it", bundle); NSBeep(); @@ -1629,7 +1629,7 @@ NSString *orgPath = [NSString stringWithFormat:@"%@/%@", [bundlePaths objectAtIndex:1], bundle]; NSString *newPath = [NSString stringWithFormat:@"%@/%@", [bundlePaths objectAtIndex:0], bundle]; if([fm fileExistsAtPath:newPath isDirectory:&isDir] && isDir) - newPath = [NSString stringWithFormat:@"%@_%ld", newPath, (NSUInteger)(random() % 35000)]; + newPath = [NSString stringWithFormat:@"%@_%ld", newPath, (long)(random() % 35000)]; error = nil; [fm copyItemAtPath:orgPath toPath:newPath error:&error]; if(error != nil) { @@ -2150,11 +2150,11 @@ // Kill any BASH commands which are currently active for (NSDictionary* cmd in [doc runningActivities]) { - NSInteger pid = [[cmd objectForKey:@"pid"] intValue]; + NSInteger pid = [[cmd objectForKey:@"pid"] integerValue]; NSTask *killTask = [[NSTask alloc] init]; [killTask setLaunchPath:@"/bin/sh"]; - [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"kill -9 -%ld", pid], nil]]; + [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"kill -9 -%ld", (long)pid], nil]]; [killTask launch]; [killTask waitUntilExit]; [killTask release]; @@ -2169,11 +2169,11 @@ for (NSDictionary* cmd in [self runningActivities]) { - NSInteger pid = [[cmd objectForKey:@"pid"] intValue]; + NSInteger pid = [[cmd objectForKey:@"pid"] integerValue]; NSTask *killTask = [[NSTask alloc] init]; [killTask setLaunchPath:@"/bin/sh"]; - [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"kill -9 -%ld", pid], nil]]; + [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"kill -9 -%ld", (long)pid], nil]]; [killTask launch]; [killTask waitUntilExit]; [killTask release]; diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index e12931f3..87abe4a4 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -583,7 +583,7 @@ } if(!copyingWasSuccessful) { // try again with new name - newFileName = [NSString stringWithFormat:@"%@_%ld", newFileName, (NSUInteger)(random() % 35000)]; + newFileName = [NSString stringWithFormat:@"%@_%ld", newFileName, (long)(random() % 35000)]; newBundleFilePath = [NSString stringWithFormat:@"%@/%@.%@", bundlePath, newFileName, SPUserBundleFileExtension]; if([[NSFileManager defaultManager] fileExistsAtPath:possibleExisitingBundleFilePath isDirectory:&isDir] && isDir) { if([[NSFileManager defaultManager] copyItemAtPath:possibleExisitingBundleFilePath toPath:newBundleFilePath error:nil]) @@ -852,7 +852,7 @@ NSInteger idx = 0; for(id item in allBundles) { if([allNames objectForKey:[item objectForKey:kBundleNameKey]]) { - NSString *newName = [NSString stringWithFormat:@"%@_%ld", [item objectForKey:kBundleNameKey], (NSUInteger)(random() % 35000)]; + NSString *newName = [NSString stringWithFormat:@"%@_%ld", [item objectForKey:kBundleNameKey], (long)(random() % 35000)]; [[allBundles objectAtIndex:idx] setObject:newName forKey:kBundleNameKey]; } else { [allNames setObject:@"" forKey:[item objectForKey:kBundleNameKey]]; diff --git a/Source/SPBundleHTMLOutputController.m b/Source/SPBundleHTMLOutputController.m index d938f0e2..32afd22c 100644 --- a/Source/SPBundleHTMLOutputController.m +++ b/Source/SPBundleHTMLOutputController.m @@ -514,7 +514,7 @@ - (void)webView:(WebView *)webView failedToParseSource:(NSString *)source baseLineNumber:(NSUInteger)lineNumber fromURL:(NSURL *)url withError:(NSError *)error forWebFrame:(WebFrame *)webFrame { - NSString *mes = [NSString stringWithFormat:@"Failed to parse JavaScript source:\nline = %ld\nerror = %@ with\n%@\nfor source = \n%@", lineNumber, [error localizedDescription], [error userInfo], source]; + NSString *mes = [NSString stringWithFormat:@"Failed to parse JavaScript source:\nline = %lu\nerror = %@ with\n%@\nfor source = \n%@", (unsigned long)lineNumber, [error localizedDescription], [error userInfo], source]; NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"JavaScript Parsing Error", @"javascript parsing error") defaultButton:NSLocalizedString(@"OK", @"OK button") @@ -529,7 +529,7 @@ - (void)webView:(WebView *)webView exceptionWasRaised:(WebScriptCallFrame *)frame sourceId:(NSInteger)sid line:(NSInteger)lineno forWebFrame:(WebFrame *)webFrame { - NSString *mes = [NSString stringWithFormat:@"Exception:\nline = %ld\nfunction = %@\ncaller = %@\nuserinfo = %@\nexception = %@", lineno, [frame functionName], [frame caller], [frame userInfo], [frame exception]]; + NSString *mes = [NSString stringWithFormat:@"Exception:\nline = %lu\nfunction = %@\ncaller = %@\nuserinfo = %@\nexception = %@", (unsigned long)lineno, [frame functionName], [frame caller], [frame userInfo], [frame exception]]; if([self suppressExceptionAlerting]) { NSLog(@"%@", mes); diff --git a/Source/SPCopyTable.m b/Source/SPCopyTable.m index 1b414170..212a545c 100644 --- a/Source/SPCopyTable.m +++ b/Source/SPCopyTable.m @@ -210,12 +210,12 @@ static const NSInteger kBlobAsImageFile = 4; } } else if(withBlobHandling == kBlobAsFile && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", tmpBlobFileDirectory, rowCounter, c]; + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", tmpBlobFileDirectory, (long)rowCounter, (long)c]; [cellData writeToFile:fp atomically:NO]; [result appendFormat:@"%@\t", fp]; } else if(withBlobHandling == kBlobAsImageFile && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", tmpBlobFileDirectory, rowCounter, c]; + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", tmpBlobFileDirectory, (long)rowCounter, (long)c]; NSImage *image = [[NSImage alloc] initWithData:cellData]; if (image) { NSData *d = [[NSData alloc] initWithData:[image TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:1]]; @@ -234,7 +234,7 @@ static const NSInteger kBlobAsImageFile = 4; } else if ([cellData isKindOfClass:spmysqlGeometryData]) { if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", tmpBlobFileDirectory, rowCounter, c]; + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", tmpBlobFileDirectory, (long)rowCounter, (long)c]; SPGeometryDataView *v = [[SPGeometryDataView alloc] initWithCoordinates:[cellData coordinates]]; NSData *thePDF = [v pdfData]; if(thePDF) { @@ -349,12 +349,12 @@ static const NSInteger kBlobAsImageFile = 4; } } else if(withBlobHandling == kBlobAsFile && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", tmpBlobFileDirectory, rowCounter, c]; + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.dat", tmpBlobFileDirectory, (long)rowCounter, (long)c]; [cellData writeToFile:fp atomically:NO]; [result appendFormat:@"\"%@\",", fp]; } else if(withBlobHandling == kBlobAsImageFile && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", tmpBlobFileDirectory, rowCounter, c]; + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.tif", tmpBlobFileDirectory, (long)rowCounter, (long)c]; NSImage *image = [[NSImage alloc] initWithData:cellData]; if (image) { NSData *d = [[NSData alloc] initWithData:[image TIFFRepresentationUsingCompression:NSTIFFCompressionLZW factor:1]]; @@ -373,7 +373,7 @@ static const NSInteger kBlobAsImageFile = 4; } else if ([cellData isKindOfClass:spmysqlGeometryData]) { if((withBlobHandling == kBlobAsFile || withBlobHandling == kBlobAsImageFile) && tmpBlobFileDirectory && [tmpBlobFileDirectory length]) { - NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", tmpBlobFileDirectory, rowCounter, c]; + NSString *fp = [NSString stringWithFormat:@"%@/%ld_%ld.pdf", tmpBlobFileDirectory, (long)rowCounter, (long)c]; SPGeometryDataView *v = [[SPGeometryDataView alloc] initWithCoordinates:[cellData coordinates]]; NSData *thePDF = [v pdfData]; if(thePDF) { @@ -1290,7 +1290,7 @@ static const NSInteger kBlobAsImageFile = 4; NSIndexSet *selectedRows = [self selectedRowIndexes]; NSUInteger rowIndex = [selectedRows firstIndex]; while ( rowIndex != NSNotFound ) { - [sel addObject:[NSString stringWithFormat:@"%ld", rowIndex]]; + [sel addObject:[NSString stringWithFormat:@"%llu", (unsigned long long)rowIndex]]; rowIndex = [selectedRows indexGreaterThanIndex:rowIndex]; } [env setObject:[sel componentsJoinedByString:@"\t"] forKey:SPBundleShellVariableSelectedRowIndices]; diff --git a/Source/SPDataAdditions.m b/Source/SPDataAdditions.m index 9f973b8e..401ffbc8 100644 --- a/Source/SPDataAdditions.m +++ b/Source/SPDataAdditions.m @@ -224,7 +224,7 @@ NSMutableString *retVal = [NSMutableString string]; // get the length of the longest location - NSUInteger longest = [(NSString *)[NSString stringWithFormat:@"%lX", totalLength - ( totalLength % bytesPerLine )] length]; + NSUInteger longest = [(NSString *)[NSString stringWithFormat:@"%lX", (unsigned long)(totalLength - ( totalLength % bytesPerLine ))] length]; for ( i = 0; i < totalLength; i += bytesPerLine ) { diff --git a/Source/SPDataImport.m b/Source/SPDataImport.m index 729a7139..34c535c0 100644 --- a/Source/SPDataImport.m +++ b/Source/SPDataImport.m @@ -1261,7 +1261,7 @@ fieldMappingArrayHasGlobalVariables = NO; // Init the field mapper controller - fieldMapperController = [[SPFieldMapperController alloc] initWithDelegate:self]; + fieldMapperController = [(SPFieldMapperController *)[SPFieldMapperController alloc] initWithDelegate:self]; [fieldMapperController setConnection:mySQLConnection]; [fieldMapperController setSourcePath:filename]; [fieldMapperController setImportDataArray:fieldMappingImportArray hasHeader:[importFieldNamesSwitch state] isPreview:fieldMappingImportArrayIsPreview]; diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 10325374..3a887662 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -4152,10 +4152,10 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Terminate all running BASH commands for(NSDictionary* cmd in [self runningActivities]) { - NSInteger pid = [[cmd objectForKey:@"pid"] intValue]; + NSInteger pid = [[cmd objectForKey:@"pid"] integerValue]; NSTask *killTask = [[NSTask alloc] init]; [killTask setLaunchPath:@"/bin/sh"]; - [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"kill -9 -%ld", pid], nil]]; + [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"kill -9 -%ld", (long)pid], nil]]; [killTask launch]; [killTask waitUntilExit]; [killTask release]; diff --git a/Source/SPFieldEditorController.m b/Source/SPFieldEditorController.m index 386cdd0a..1efe7705 100644 --- a/Source/SPFieldEditorController.m +++ b/Source/SPFieldEditorController.m @@ -249,10 +249,10 @@ NSUInteger maxBit = (NSUInteger)((maxTextLength > 64) ? 64 : maxTextLength); if([bitSheetNULLButton state] == NSOffState && maxBit <= [(NSString*)sheetEditData length]) for( i = 0; i<maxBit; i++ ) - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", (long)i]] setState:([(NSString*)sheetEditData characterAtIndex:(maxBit-i-1)] == '1') ? NSOnState : NSOffState]; for( i = maxBit; i<64; i++ ) - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setEnabled:NO]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", (long)i]] setEnabled:NO]; [self updateBitSheet]; @@ -809,7 +809,7 @@ // since QuickLook only works on files. // Alternate the file name to suppress caching by using counter%2. if (tmpFileName) [tmpFileName release]; - tmpFileName = [[NSString alloc] initWithFormat:@"%@SequelProQuickLook%ld.%@", tmpDirPath, counter%2, type]; + tmpFileName = [[NSString alloc] initWithFormat:@"%@SequelProQuickLook%ld.%@", tmpDirPath, (long)(counter%2), type]; // if data are binary if ( [sheetEditData isKindOfClass:[NSData class]] && !isText) { @@ -1146,7 +1146,7 @@ NSUInteger bitValue = 0x1; for(i=0; i<maxBit; i++) { - if([(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] state] == NSOnState) { + if([(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", (unsigned long)i]] state] == NSOnState) { intValue += bitValue; [bitString replaceCharactersInRange:NSMakeRange((NSUInteger)maxTextLength-i-1, 1) withString:@"1"]; } @@ -1154,7 +1154,7 @@ } [bitSheetIntegerTextField setStringValue:[[NSNumber numberWithUnsignedLongLong:intValue] stringValue]]; [bitSheetHexTextField setStringValue:[NSString stringWithFormat:@"%lX", (unsigned long)intValue]]; - [bitSheetOctalTextField setStringValue:[NSString stringWithFormat:@"%jO", intValue]]; + [bitSheetOctalTextField setStringValue:[NSString stringWithFormat:@"%llO", (unsigned long long)intValue]]; // free old data if ( sheetEditData != nil ) { [sheetEditData release]; @@ -1170,48 +1170,48 @@ */ - (IBAction)bitSheetOperatorButtonWasClicked:(id)sender { - NSUInteger i = 0; - NSUInteger aBit; - NSUInteger maxBit = (NSUInteger)((maxTextLength > 64) ? 64 : maxTextLength); + unsigned long i = 0; + unsigned long aBit; + unsigned long maxBit = (unsigned long)((maxTextLength > 64) ? 64 : maxTextLength); switch([sender tag]) { case 0: // all to 1 for(i=0; i<maxBit; i++) - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:NSOnState]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setState:NSOnState]; break; case 1: // all to 0 for(i=0; i<maxBit; i++) - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:NSOffState]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setState:NSOffState]; break; case 2: // negate for(i=0; i<maxBit; i++) - [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:![(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] state]]; + [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setState:![(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] state]]; break; case 3: // shift left for(i=maxBit-1; i>0; i--) { - [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:[(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i-1]] state]]; + [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setState:[(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i-1]] state]]; } [[self valueForKeyPath:@"bitSheetBitButton0"] setState:NSOffState]; break; case 4: // shift right for(i=0; i<maxBit-1; i++) { - [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:[(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i+1]] state]]; + [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setState:[(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i+1]] state]]; } - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", maxBit-1]] setState:NSOffState]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", maxBit-1]] setState:NSOffState]; break; case 5: // rotate left aBit = [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", maxBit-1]] state]; for(i=maxBit-1; i>0; i--) { - [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:[(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i-1]] state]]; + [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setState:[(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i-1]] state]]; } [[self valueForKeyPath:@"bitSheetBitButton0"] setState:aBit]; break; case 6: // rotate right aBit = [(NSButton*)[self valueForKeyPath:@"bitSheetBitButton0"] state]; for(i=0; i<maxBit-1; i++) { - [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:[(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i+1]] state]]; + [(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setState:[(NSButton*)[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i+1]] state]]; } - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", maxBit-1]] setState:aBit]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", maxBit-1]] setState:aBit]; break; } [self updateBitSheet]; @@ -1232,18 +1232,18 @@ - (IBAction)setToNull:(id)sender { - NSUInteger i; - NSUInteger maxBit = (NSUInteger)((maxTextLength > 64) ? 64 : maxTextLength); + unsigned long i; + unsigned long maxBit = (unsigned long)((maxTextLength > 64) ? 64 : maxTextLength); if([(NSButton*)sender state] == NSOnState) { for(i=0; i<maxBit; i++) - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setEnabled:NO]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setEnabled:NO]; [bitSheetHexTextField setEnabled:NO]; [bitSheetIntegerTextField setEnabled:NO]; [bitSheetOctalTextField setEnabled:NO]; } else { for(i=0; i<maxBit; i++) - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setEnabled:YES]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setEnabled:YES]; [bitSheetHexTextField setEnabled:YES]; [bitSheetIntegerTextField setEnabled:YES]; [bitSheetOctalTextField setEnabled:YES]; @@ -1275,21 +1275,21 @@ if (object == bitSheetIntegerTextField) { - NSUInteger i = 0; - NSUInteger maxBit = (NSUInteger)((maxTextLength > 64) ? 64 : maxTextLength); + unsigned long i = 0; + unsigned long maxBit = (NSUInteger)((maxTextLength > 64) ? 64 : maxTextLength); NSUInteger intValue = (NSUInteger)strtoull([[bitSheetIntegerTextField stringValue] UTF8String], NULL, 0); for(i=0; i<maxBit; i++) - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:NSOffState]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setState:NSOffState]; [bitSheetHexTextField setStringValue:[NSString stringWithFormat:@"%lX", (unsigned long)intValue]]; - [bitSheetOctalTextField setStringValue:[NSString stringWithFormat:@"%jO", intValue]]; + [bitSheetOctalTextField setStringValue:[NSString stringWithFormat:@"%llO", (long long)intValue]]; i = 0; while( intValue && i < maxBit ) { - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:( (intValue & 0x1) == 0) ? NSOffState : NSOnState]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%lu", i]] setState:( (intValue & 0x1) == 0) ? NSOffState : NSOnState]; intValue >>= 1; i++; } @@ -1305,7 +1305,7 @@ [[NSScanner scannerWithString:[bitSheetHexTextField stringValue]] scanHexLongLong: &intValue]; for(i=0; i<maxBit; i++) - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:NSOffState]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", (long)i]] setState:NSOffState]; [bitSheetHexTextField setStringValue:[NSString stringWithFormat:@"%qX", intValue]]; [bitSheetOctalTextField setStringValue:[NSString stringWithFormat:@"%llO", intValue]]; @@ -1313,7 +1313,7 @@ i = 0; while( intValue && i < maxBit ) { - [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", i]] setState:( (intValue & 0x1) == 0) ? NSOffState : NSOnState]; + [[self valueForKeyPath:[NSString stringWithFormat:@"bitSheetBitButton%ld", (long)i]] setState:( (intValue & 0x1) == 0) ? NSOffState : NSOnState]; intValue >>= 1; i++; } diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 2e517852..5b289a01 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -783,7 +783,7 @@ static NSString *SPTableViewSqlColumnID = @"sql"; } else { NSInteger i = 0; for(id h in NSArrayObjectAtIndex(fieldMappingImportArray, 0)) { - [fieldMappingTableColumnNames addObject:[NSString stringWithFormat:@"col_%ld", i++]]; + [fieldMappingTableColumnNames addObject:[NSString stringWithFormat:@"col_%ld", (long)i++]]; } } [fieldMapperTableView reloadData]; @@ -897,7 +897,7 @@ static NSString *SPTableViewSqlColumnID = @"sql"; } else { NSInteger i = 0; for(id h in NSArrayObjectAtIndex(fieldMappingImportArray, 0)) { - [fieldMappingTableColumnNames addObject:[NSString stringWithFormat:@"col_%ld", i++]]; + [fieldMappingTableColumnNames addObject:[NSString stringWithFormat:@"col_%ld", (long)i++]]; [fieldMappingTableDefaultValues addObject:@""]; if(typeOfSourceColumns[columnCounter] == 1) { // integer type if(maxLengthOfSourceColumns[columnCounter] < 9) @@ -1308,7 +1308,7 @@ static NSString *SPTableViewSqlColumnID = @"sql"; NSInteger selectedIndex = [sender indexOfItem:[sender selectedItem]] - 4; if ([[[NSApp keyWindow] firstResponder] respondsToSelector:@selector(insertText:)]) { - [[[NSApp keyWindow] firstResponder] insertText:[NSString stringWithFormat:@"$%ld", selectedIndex]]; + [[[NSApp keyWindow] firstResponder] insertText:[NSString stringWithFormat:@"$%ld", (long)selectedIndex]]; } } @@ -1513,20 +1513,20 @@ static NSString *SPTableViewSqlColumnID = @"sql"; [fieldMappingButtonOptions setArray:[fieldMappingImportArray objectAtIndex:fieldMappingCurrentRow]]; for (i = 0; i < [fieldMappingButtonOptions count]; i++) { if ([[fieldMappingButtonOptions objectAtIndex:i] isNSNull]) - [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%li. <%@>", i+1, [prefs objectForKey:SPNullValue]]]; + [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%li. <%@>", (long)i+1, [prefs objectForKey:SPNullValue]]]; else if ([[fieldMappingButtonOptions objectAtIndex:i] isSPNotLoaded]) - [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%li. <%@>", i+1, @"DEFAULT"]]; + [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%li. <%@>", (long)i+1, @"DEFAULT"]]; else - [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%li. %@", i+1, NSArrayObjectAtIndex(fieldMappingButtonOptions, i)]]; + [fieldMappingButtonOptions replaceObjectAtIndex:i withObject:[NSString stringWithFormat:@"%li. %@", (long)i+1, NSArrayObjectAtIndex(fieldMappingButtonOptions, i)]]; } // Add global values if any if((NSInteger)[fieldMappingGlobalValues count]>numberOfImportColumns) for( ; i < [fieldMappingGlobalValues count]; i++) { if ([NSArrayObjectAtIndex(fieldMappingGlobalValues, i) isNSNull]) - [fieldMappingButtonOptions addObject:[NSString stringWithFormat:@"%li. <%@>", i+1, [prefs objectForKey:SPNullValue]]]; + [fieldMappingButtonOptions addObject:[NSString stringWithFormat:@"%li. <%@>", (long)i+1, [prefs objectForKey:SPNullValue]]]; else - [fieldMappingButtonOptions addObject:[NSString stringWithFormat:@"%li. %@", i+1, NSArrayObjectAtIndex(fieldMappingGlobalValues, i)]]; + [fieldMappingButtonOptions addObject:[NSString stringWithFormat:@"%li. %@", (long)i+1, NSArrayObjectAtIndex(fieldMappingGlobalValues, i)]]; } [fieldMapperTableView reloadData]; @@ -1830,7 +1830,7 @@ static NSString *SPTableViewSqlColumnID = @"sql"; else if(aTableView == globalValuesTableView) { if ([[aTableColumn identifier] isEqualToString:SPTableViewValueIndexColumnID]) { - return [NSString stringWithFormat:@"%ld.", numberOfImportColumns + rowIndex + 1]; + return [NSString stringWithFormat:@"%ld.", (long)(numberOfImportColumns + rowIndex + 1)]; } else if ([[aTableColumn identifier] isEqualToString:SPTableViewGlobalValueColumnID]) { diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m index 536f2f43..beeca225 100644 --- a/Source/SPSSHTunnel.m +++ b/Source/SPSSHTunnel.m @@ -333,7 +333,7 @@ // existing masters without forwarding enabled and to isolate from interactive sessions. Use a short // hashed path to aid length limit issues. unsigned char hashedPathResult[16]; - NSString *pathString = [NSString stringWithFormat:@"%@@%@:%ld", sshLogin?sshLogin:@"", sshHost, sshPort?sshPort:0]; + NSString *pathString = [NSString stringWithFormat:@"%@@%@:%ld", sshLogin?sshLogin:@"", sshHost, (long)(sshPort?sshPort:0)]; CC_MD5([pathString UTF8String], (unsigned int)strlen([pathString UTF8String]), hashedPathResult); [taskArguments addObject:[NSString stringWithFormat:@"-o ControlPath=%@/SPSSH-%@", [NSFileManager temporaryDirectory], [[[NSData dataWithBytes:hashedPathResult length:16] dataToHexString] substringToIndex:8]]]; } else { |