Bug 1130828 - Fix clang -Widiomatic-parentheses and -Wsemicolon-before-method-body warnings. r=smichaud
authorChris Peterson <cpeterson@mozilla.com>
Fri, 06 Feb 2015 00:09:39 -0800
changeset 228393 b9f575d77835d8d4beb3953af552187de0640bf3
parent 228392 01fb7f94f61d9f4a473501171cb0f35d4afa8098
child 228394 8b46de889f4c191321ad2728f466be51f4054edd
push id28261
push userryanvm@gmail.com
push dateTue, 10 Feb 2015 21:03:20 +0000
treeherdermozilla-central@ee093ca70666 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs1130828
milestone38.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 1130828 - Fix clang -Widiomatic-parentheses and -Wsemicolon-before-method-body warnings. r=smichaud
dom/system/mac/CoreLocationLocationProvider.mm
widget/cocoa/nsCocoaWindow.mm
widget/cocoa/nsMenuBarX.mm
--- a/dom/system/mac/CoreLocationLocationProvider.mm
+++ b/dom/system/mac/CoreLocationLocationProvider.mm
@@ -39,17 +39,17 @@ static const CLLocationAccuracy kDEFAULT
   didFailWithError:(NSError *)aError;
 - (void)locationManager:(CLLocationManager*)aManager didUpdateLocations:(NSArray*)locations;
 
 @end
 
 @implementation LocationDelegate
 - (id) init:(CoreLocationLocationProvider*) aProvider
 {
-  if (self = [super init]) {
+  if ((self = [super init])) {
     mProvider = aProvider;
   }
 
   return self;
 }
 
 - (void)shutdownHandoffTimer
 {
@@ -156,17 +156,16 @@ CoreLocationLocationProvider::MLSUpdate:
 
 NS_IMETHODIMP
 CoreLocationLocationProvider::MLSUpdate::NotifyError(uint16_t error)
 {
   mParentLocationProvider.NotifyError(error);
   return NS_OK;
 }
 
-
 class CoreLocationObjects {
 public:
   NS_METHOD Init(CoreLocationLocationProvider* aProvider) {
     mLocationManager = [[CLLocationManager alloc] init];
     NS_ENSURE_TRUE(mLocationManager, NS_ERROR_NOT_AVAILABLE);
 
     mLocationDelegate = [[LocationDelegate alloc] init:aProvider];
     NS_ENSURE_TRUE(mLocationDelegate, NS_ERROR_NOT_AVAILABLE);
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -2159,17 +2159,16 @@ nsCocoaWindow::ExecuteNativeKeyBinding(N
                                        const WidgetKeyboardEvent& aEvent,
                                        DoCommandCallback aCallback,
                                        void* aCallbackData)
 {
   NativeKeyBindings* keyBindings = NativeKeyBindings::GetInstance(aType);
   return keyBindings->Execute(aEvent, aCallback, aCallbackData);
 }
 
-
 @implementation WindowDelegate
 
 // We try to find a gecko menu bar to paint. If one does not exist, just paint
 // the application menu by itself so that a window doesn't have some other
 // window's menu bar.
 + (void)paintMenubarForWindow:(NSWindow*)aWindow
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
@@ -3341,17 +3340,17 @@ static const NSString* kStateShowsToolba
 - (void)placeFullScreenButton:(NSRect)aRect
 {
   if (!NSEqualRects(mFullScreenButtonRect, aRect)) {
     mFullScreenButtonRect = aRect;
     [self reflowTitlebarElements];
   }
 }
 
-- (NSPoint)fullScreenButtonPositionWithDefaultPosition:(NSPoint)aDefaultPosition;
+- (NSPoint)fullScreenButtonPositionWithDefaultPosition:(NSPoint)aDefaultPosition
 {
   if ([self drawsContentsIntoWindowFrame] && !NSIsEmptyRect(mFullScreenButtonRect)) {
     return NSMakePoint(std::min(mFullScreenButtonRect.origin.x, aDefaultPosition.x),
                        std::min(mFullScreenButtonRect.origin.y, aDefaultPosition.y));
   }
   return aDefaultPosition;
 }
 
--- a/widget/cocoa/nsMenuBarX.mm
+++ b/widget/cocoa/nsMenuBarX.mm
@@ -730,40 +730,39 @@ nsresult nsMenuBarX::CreateApplicationMe
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 void nsMenuBarX::SetParent(nsIWidget* aParent)
 {
   mParentWindow = aParent;
 }
 
-
 //
 // Objective-C class used to allow us to have keyboard commands
 // look like they are doing something but actually do nothing.
 // We allow mouse actions to work normally.
 //
 
 // Controls whether or not native menu items should invoke their commands.
 static BOOL gMenuItemsExecuteCommands = YES;
 
 @implementation GeckoNSMenu
 
 - (id)initWithTitle:(NSString *)aTitle
 {
-  if (self = [super initWithTitle:aTitle]) {
+  if ((self = [super initWithTitle:aTitle])) {
     mMenuBarOwner = nullptr;
     mDelayResignMainMenu = false;
   }
   return self;
 }
 
 - (id)initWithTitle:(NSString *)aTitle andMenuBarOwner:(nsMenuBarX *)aMenuBarOwner
 {
-  if (self = [super initWithTitle:aTitle]) {
+  if ((self = [super initWithTitle:aTitle])) {
     mMenuBarOwner = aMenuBarOwner;
     mDelayResignMainMenu = false;
   }
   return self;
 }
 
 - (void)resetMenuBarOwner
 {
@@ -793,17 +792,17 @@ static BOOL gMenuItemsExecuteCommands = 
     }
   }
   [self release];
 }
 
 // Undocumented method, present unchanged since OS X 10.6, used to temporarily
 // highlight a top-level menu item when an appropriate Cmd+key combination is
 // pressed.
-- (void)_performActionWithHighlightingForItemAtIndex:(NSInteger)index;
+- (void)_performActionWithHighlightingForItemAtIndex:(NSInteger)index
 {
   NSMenu *mainMenu = [NSApp mainMenu];
   if ([mainMenu isKindOfClass:[GeckoNSMenu class]]) {
     [(GeckoNSMenu *)mainMenu setDelayResignMainMenu:true];
   }
   [super _performActionWithHighlightingForItemAtIndex:index];
 }