From 4b6c4f048dd8e1bb3536585eef9e1f44b702fcd8 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 10 Nov 2013 12:41:10 -0500 Subject: [PATCH] Fixed compilation warnings on OS X --- cocoa/base/AppDelegateBase.m | 6 +++--- cocoa/base/DirectoryPanel.m | 4 ++-- cocoa/base/ResultWindowBase.m | 4 ++-- cocoalib/cocoa/CocoaProxy.m | 7 +------ core_pe/modules/block_osx.m | 2 +- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/cocoa/base/AppDelegateBase.m b/cocoa/base/AppDelegateBase.m index 7c906390..b9940156 100644 --- a/cocoa/base/AppDelegateBase.m +++ b/cocoa/base/AppDelegateBase.m @@ -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; diff --git a/cocoa/base/DirectoryPanel.m b/cocoa/base/DirectoryPanel.m index 8a156208..f21b421e 100644 --- a/cocoa/base/DirectoryPanel.m +++ b/cocoa/base/DirectoryPanel.m @@ -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]]; } } } diff --git a/cocoa/base/ResultWindowBase.m b/cocoa/base/ResultWindowBase.m index 08a43c1a..51c8c0fa 100644 --- a/cocoa/base/ResultWindowBase.m +++ b/cocoa/base/ResultWindowBase.m @@ -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]]; } } diff --git a/cocoalib/cocoa/CocoaProxy.m b/cocoalib/cocoa/CocoaProxy.m index 31702dba..6610dbed 100644 --- a/cocoalib/cocoa/CocoaProxy.m +++ b/cocoalib/cocoa/CocoaProxy.m @@ -1,5 +1,4 @@ #import "CocoaProxy.h" -#import #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 diff --git a/core_pe/modules/block_osx.m b/core_pe/modules/block_osx.m index f4280dae..e94117ad 100644 --- a/core_pe/modules/block_osx.m +++ b/core_pe/modules/block_osx.m @@ -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!");