From 8e989a70e0bd74e7f5b23dbe44e90b25c9bd73ac Mon Sep 17 00:00:00 2001 From: Gavin McKenzie Date: Wed, 2 Mar 2011 13:05:17 -0500 Subject: [PATCH] Wrapped the idiomatic "if (self = [super init])" code everywhere with additional parentheses "if ((self = [super init]))" to quiet the llvm/clang static analysis that issues warning about such code. --- ATMHud.m | 4 ++-- ATMHudQueueItem.m | 2 +- ATMHudView.m | 2 +- ATMTextLayer.m | 2 +- Classes/DemoViewController.m | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ATMHud.m b/ATMHud.m index 61c7f6b..1c32026 100644 --- a/ATMHud.m +++ b/ATMHud.m @@ -31,14 +31,14 @@ @implementation ATMHud @synthesize __view, sound, displayQueue, queuePosition; - (id)init { - if (self = [super init]) { + if ((self = [super init])) { [self construct]; } return self; } - (id)initWithDelegate:(id)hudDelegate { - if (self = [super init]) { + if ((self = [super init])) { delegate = hudDelegate; [self construct]; } diff --git a/ATMHudQueueItem.m b/ATMHudQueueItem.m index 7b8df77..6eef7dd 100644 --- a/ATMHudQueueItem.m +++ b/ATMHudQueueItem.m @@ -15,7 +15,7 @@ @implementation ATMHudQueueItem @synthesize caption, image, showActivity, accessoryPosition, activityStyle; - (id)init { - if (self = [super init]) { + if ((self = [super init])) { caption = @""; image = nil; showActivity = NO; diff --git a/ATMHudView.m b/ATMHudView.m index 5b7177b..dc8d679 100644 --- a/ATMHudView.m +++ b/ATMHudView.m @@ -41,7 +41,7 @@ - (CGPoint)sharpPoint:(CGPoint)point { } - (id)initWithFrame:(CGRect)frame andController:(ATMHud *)c { - if (self = [super initWithFrame:frame]) { + if ((self = [super initWithFrame:frame])) { self.p = c; self.backgroundColor = [UIColor clearColor]; self.opaque = NO; diff --git a/ATMTextLayer.m b/ATMTextLayer.m index 6bc7512..9d7be5f 100644 --- a/ATMTextLayer.m +++ b/ATMTextLayer.m @@ -15,7 +15,7 @@ @implementation ATMTextLayer @synthesize caption; - (id)initWithLayer:(id)layer { - if (self = [super init]) { + if ((self = [super init])) { caption = @""; } return self; diff --git a/Classes/DemoViewController.m b/Classes/DemoViewController.m index d0859a4..70de809 100644 --- a/Classes/DemoViewController.m +++ b/Classes/DemoViewController.m @@ -39,7 +39,7 @@ @implementation DemoViewController #pragma mark - #pragma mark View lifecycle - (id)init { - if (self = [super init]) { + if ((self = [super init])) { NSArray *section0 = [NSArray arrayWithObjects:@"Show with caption only", @"Show with caption and activity", @"Show with caption and image", @"Show activity only", @"Play sound on show", nil]; NSArray *section1 = [NSArray arrayWithObjects:@"Show and auto-hide", @"Show, update and auto-hide", @"Show progress bar", @"Show queued HUD", nil]; NSArray *section2 = [NSArray arrayWithObjects:@"Accessory top", @"Accessory right", @"Accessory bottom", @"Accessory left", nil];