Skip to content

Commit

Permalink
Wrapped the idiomatic "if (self = [super init])" code everywhere with…
Browse files Browse the repository at this point in the history
… additional parentheses "if ((self = [super init]))" to quiet the llvm/clang static analysis that issues warning about such code.
  • Loading branch information
Gavin McKenzie committed Mar 2, 2011
1 parent 93b15d7 commit 8e989a7
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ATMHud.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion ATMHudQueueItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ATMHudView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ATMTextLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ @implementation ATMTextLayer
@synthesize caption;

- (id)initWithLayer:(id)layer {
if (self = [super init]) {
if ((self = [super init])) {
caption = @"";
}
return self;
Expand Down
2 changes: 1 addition & 1 deletion Classes/DemoViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 8e989a7

Please sign in to comment.