Bug 1117635 - Declare that MacApplicationDelegate implements NSFileManagerDelegate protocol to fix -Wincompatible-pointer-types warning. r=smichaud
authorChris Peterson <cpeterson@mozilla.com>
Sun, 04 Jan 2015 20:00:42 -0800
changeset 248177 143ddd8eded99c6ef815efec3bfe3dc41d7b8acf
parent 248176 e6ab639384733a120a7cedfcaee0ffd44ea8db56
child 248178 bdf7e46a6165cbecce3efb123d854aa36df29008
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs1117635
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1117635 - Declare that MacApplicationDelegate implements NSFileManagerDelegate protocol to fix -Wincompatible-pointer-types warning. r=smichaud
toolkit/xre/MacApplicationDelegate.mm
--- a/toolkit/xre/MacApplicationDelegate.mm
+++ b/toolkit/xre/MacApplicationDelegate.mm
@@ -41,17 +41,17 @@ public:
   ~AutoAutoreleasePool()
   {
     [mLocalPool release];
   }
 private:
   NSAutoreleasePool *mLocalPool;
 };
 
-@interface MacApplicationDelegate : NSObject
+@interface MacApplicationDelegate : NSObject<NSApplicationDelegate>
 {
 }
 
 @end
 
 static bool sProcessedGetURLEvent = false;
 
 @class GeckoNSApplication;
@@ -84,17 +84,17 @@ SetupMacApplicationDelegate()
 
   // This call makes it so that application:openFile: doesn't get bogus calls
   // from Cocoa doing its own parsing of the argument string. And yes, we need
   // to use a string with a boolean value in it. That's just how it works.
   [[NSUserDefaults standardUserDefaults] setObject:@"NO"
                                             forKey:@"NSTreatUnknownArgumentsAsOpen"];
 
   // Create the delegate. This should be around for the lifetime of the app.
-  MacApplicationDelegate *delegate = [[MacApplicationDelegate alloc] init];
+  id<NSApplicationDelegate> delegate = [[MacApplicationDelegate alloc] init];
   [NSApp setDelegate:delegate];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 // Indirectly make the OS process any pending GetURL Apple events.  This is
 // done via _DPSNextEvent() (an undocumented AppKit function called from
 // [NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]).  Apple