Fixed compilation warnings on OS X

This commit is contained in:
Virgil Dupras 2013-11-10 12:41:10 -05:00
parent 7594cccf8c
commit 4b6c4f048d
5 changed files with 9 additions and 14 deletions

View File

@ -140,7 +140,7 @@ http://www.hardcoded.net/licenses/bsd_license
[op setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
[op setTitle:NSLocalizedString(@"Select a results file to load", @"")];
if ([op runModal] == NSOKButton) {
NSString *filename = [[op filenames] objectAtIndex:0];
NSString *filename = [[[op URLs] objectAtIndex:0] path];
[model loadResultsFrom:filename];
[[self recentResults] addFile:filename];
}
@ -280,7 +280,7 @@ http://www.hardcoded.net/licenses/bsd_license
[op setAllowsMultipleSelection:NO];
[op setTitle:prompt];
if ([op runModal] == NSOKButton) {
return [[op filenames] objectAtIndex:0];
return [[[op URLs] objectAtIndex:0] path];
}
else {
return nil;
@ -294,7 +294,7 @@ http://www.hardcoded.net/licenses/bsd_license
[sp setAllowedFileTypes:[NSArray arrayWithObject:extension]];
[sp setTitle:prompt];
if ([sp runModal] == NSOKButton) {
return [sp filename];
return [[sp URL] path];
}
else {
return nil;

View File

@ -91,8 +91,8 @@ http://www.hardcoded.net/licenses/bsd_license
[op setTitle:NSLocalizedString(@"Select a folder to add to the scanning list", @"")];
[op setDelegate:self];
if ([op runModal] == NSOKButton) {
for (NSString *directory in [op filenames]) {
[self addDirectory:directory];
for (NSURL *directoryURL in [op URLs]) {
[self addDirectory:[directoryURL path]];
}
}
}

View File

@ -258,8 +258,8 @@ http://www.hardcoded.net/licenses/bsd_license
[sp setAllowedFileTypes:[NSArray arrayWithObject:@"dupeguru"]];
[sp setTitle:NSLocalizedString(@"Select a file to save your results to", @"")];
if ([sp runModal] == NSOKButton) {
[model saveResultsAs:[sp filename]];
[[app recentResults] addFile:[sp filename]];
[model saveResultsAs:[[sp URL] path]];
[[app recentResults] addFile:[[sp URL] path]];
}
}

View File

@ -1,5 +1,4 @@
#import "CocoaProxy.h"
#import <CoreServices/CoreServices.h>
#import "HSErrorReportWindow.h"
@implementation CocoaProxy
@ -99,11 +98,7 @@
- (NSString *)osxVersion
{
SInt32 major, minor, bugfix;
Gestalt(gestaltSystemVersionMajor, &major);
Gestalt(gestaltSystemVersionMinor, &minor);
Gestalt(gestaltSystemVersionBugFix, &bugfix);
return [NSString stringWithFormat:@"%d.%d.%d", major, minor, bugfix];
return [[NSProcessInfo processInfo] operatingSystemVersionString];
}
- (void)postNotification:(NSString *)name userInfo:(NSDictionary *)userInfo

View File

@ -113,7 +113,7 @@ MyCreateBitmapContext(int width, int height)
}
context = CGBitmapContextCreate(bitmapData, width, height, 8, bitmapBytesPerRow, colorSpace,
kCGImageAlphaNoneSkipLast);
(CGBitmapInfo)kCGImageAlphaNoneSkipLast);
if (context== NULL) {
free(bitmapData);
fprintf(stderr, "Context not created!");