Skip to content

Commit 39ea9fe

Browse files
authored
Remove trailing semicolons between method parameters and body (TextureGroup#1973)
Having a semi-colon between a method parameters list and a method body is not not correct and is usually caused by a copy and paste error while creating the method definition from its declaration. Fixes the following compilation warnings when building with -Wsemicolon-before-method-body (which is part of -Wextra): ASPINRemoteImageDownloader.mm:230:85: error: semicolon before method body is ignored [-Werror,-Wsemicolon-before-method-body] - (id <ASImageContainerProtocol>)synchronouslyFetchedCachedImageWithURL:(NSURL *)URL; ^ ASPINRemoteImageDownloader.mm:275:76: error: semicolon before method body is ignored [-Werror,-Wsemicolon-before-method-body] completion:(ASImageDownloaderCompletion)completion; ^ 2 errors generated. Fixes applied to both code, examples and samples in documentation.
1 parent dca5a22 commit 39ea9fe

24 files changed

+37
-37
lines changed

Source/ASCellNode.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ - (void)setHighlighted:(BOOL)highlighted
159159
}
160160
}
161161

162-
- (void)__setSelectedFromUIKit:(BOOL)selected;
162+
- (void)__setSelectedFromUIKit:(BOOL)selected
163163
{
164164
// Note: Race condition could mean redundant sets. Risk is low.
165165
if (ASLockedSelf(_selected != selected)) {
@@ -169,7 +169,7 @@ - (void)__setSelectedFromUIKit:(BOOL)selected;
169169
}
170170
}
171171

172-
- (void)__setHighlightedFromUIKit:(BOOL)highlighted;
172+
- (void)__setHighlightedFromUIKit:(BOOL)highlighted
173173
{
174174
// Note: Race condition could mean redundant sets. Risk is low.
175175
if (ASLockedSelf(_highlighted != highlighted)) {

Source/ASCollectionNode.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,7 @@ - (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)
11681168

11691169
#pragma mark - ASRangeControllerUpdateRangeProtocol
11701170

1171-
- (void)updateCurrentRangeWithMode:(ASLayoutRangeMode)rangeMode;
1171+
- (void)updateCurrentRangeWithMode:(ASLayoutRangeMode)rangeMode
11721172
{
11731173
if ([self pendingState]) {
11741174
_pendingState.rangeMode = rangeMode;

Source/ASPagerNode.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ - (instancetype)init
5151
return [self initWithCollectionViewLayout:flowLayout];
5252
}
5353

54-
- (instancetype)initWithCollectionViewLayout:(ASPagerFlowLayout *)flowLayout;
54+
- (instancetype)initWithCollectionViewLayout:(ASPagerFlowLayout *)flowLayout
5555
{
5656
ASDisplayNodeAssert([flowLayout isKindOfClass:[ASPagerFlowLayout class]], @"ASPagerNode requires a flow layout.");
5757
ASDisplayNodeAssertTrue(flowLayout.scrollDirection == UICollectionViewScrollDirectionHorizontal);

Source/Debug/AsyncDisplayKit+Debug.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
@implementation ASImageNode (Debugging)
2727

28-
+ (void)setShouldShowImageScalingOverlay:(BOOL)show;
28+
+ (void)setShouldShowImageScalingOverlay:(BOOL)show
2929
{
3030
__shouldShowImageScalingOverlay = show;
3131
}
@@ -437,7 +437,7 @@ - (void)updateRangeController:(ASRangeController *)controller
437437
rangeMode:(ASLayoutRangeMode)rangeMode
438438
displayTuningParameters:(ASRangeTuningParameters)displayTuningParameters
439439
preloadTuningParameters:(ASRangeTuningParameters)preloadTuningParameters
440-
interfaceState:(ASInterfaceState)interfaceState;
440+
interfaceState:(ASInterfaceState)interfaceState
441441
{
442442
_ASRangeDebugBarView *viewToUpdate = [self barViewForRangeController:controller];
443443

Source/Details/ASPINRemoteImageDownloader.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ - (BOOL)sharedImageManagerSupportsMemoryRemoval
212212
}
213213
#endif
214214

215-
- (id <ASImageContainerProtocol>)synchronouslyFetchedCachedImageWithURL:(NSURL *)URL;
215+
- (id <ASImageContainerProtocol>)synchronouslyFetchedCachedImageWithURL:(NSURL *)URL
216216
{
217217
PINRemoteImageManager *manager = [self sharedPINRemoteImageManager];
218218
PINRemoteImageManagerResult *result = [manager synchronousImageFromCacheWithURL:URL processorKey:nil options:PINRemoteImageManagerDownloadOptionsSkipDecode];
@@ -258,7 +258,7 @@ - (nullable id)downloadImageWithURL:(NSURL *)URL
258258
shouldRetry:(BOOL)shouldRetry
259259
callbackQueue:(dispatch_queue_t)callbackQueue
260260
downloadProgress:(ASImageDownloaderProgress)downloadProgress
261-
completion:(ASImageDownloaderCompletion)completion;
261+
completion:(ASImageDownloaderCompletion)completion
262262
{
263263
return [self downloadImageWithURL:URL
264264
shouldRetry:shouldRetry

Source/Details/Transactions/_ASAsyncTransaction.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ - (void)dealloc
4444
NSAssert(_operationCompletionBlock == nil, @"Should have been called and released before -dealloc");
4545
}
4646

47-
- (void)callAndReleaseCompletionBlock:(BOOL)canceled;
47+
- (void)callAndReleaseCompletionBlock:(BOOL)canceled
4848
{
4949
ASDisplayNodeAssertMainThread();
5050
if (_operationCompletionBlock) {

Source/Layout/ASCenterLayoutSpec.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ @implementation ASCenterLayoutSpec
1717

1818
- (instancetype)initWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions
1919
sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions
20-
child:(id<ASLayoutElement>)child;
20+
child:(id<ASLayoutElement>)child
2121
{
2222
ASRelativeLayoutSpecPosition verticalPosition = [self verticalPositionFromCenteringOptions:centeringOptions];
2323
ASRelativeLayoutSpecPosition horizontalPosition = [self horizontalPositionFromCenteringOptions:centeringOptions];

Source/Layout/ASInsetLayoutSpec.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner)
3939

4040
@implementation ASInsetLayoutSpec
4141

42-
- (instancetype)initWithInsets:(UIEdgeInsets)insets child:(id<ASLayoutElement>)child;
42+
- (instancetype)initWithInsets:(UIEdgeInsets)insets child:(id<ASLayoutElement>)child
4343
{
4444
if (!(self = [super init])) {
4545
return nil;

Source/Layout/ASRatioLayoutSpec.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ + (instancetype)ratioLayoutSpecWithRatio:(CGFloat)ratio child:(id<ASLayoutElemen
3131
return [[self alloc] initWithRatio:ratio child:child];
3232
}
3333

34-
- (instancetype)initWithRatio:(CGFloat)ratio child:(id<ASLayoutElement>)child;
34+
- (instancetype)initWithRatio:(CGFloat)ratio child:(id<ASLayoutElement>)child
3535
{
3636
if (!(self = [super init])) {
3737
return nil;

Source/Private/ASCollectionViewFlowLayoutInspector.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ @implementation ASCollectionViewFlowLayoutInspector {
3434

3535
#pragma mark Lifecycle
3636

37-
- (instancetype)initWithFlowLayout:(UICollectionViewFlowLayout *)flowLayout;
37+
- (instancetype)initWithFlowLayout:(UICollectionViewFlowLayout *)flowLayout
3838
{
3939
NSParameterAssert(flowLayout);
4040

@@ -47,7 +47,7 @@ - (instancetype)initWithFlowLayout:(UICollectionViewFlowLayout *)flowLayout;
4747

4848
#pragma mark ASCollectionViewLayoutInspecting
4949

50-
- (void)didChangeCollectionViewDelegate:(id<ASCollectionDelegate>)delegate;
50+
- (void)didChangeCollectionViewDelegate:(id<ASCollectionDelegate>)delegate
5151
{
5252
if (delegate == nil) {
5353
memset(&_delegateFlags, 0, sizeof(_delegateFlags));

Source/Private/ASDisplayNode+AsyncDisplay.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ - (void)setWillDisplayNodeContentWithRenderingContext:(ASDisplayNodeContextModif
485485
_willDisplayNodeContentWithRenderingContext = contextModifier;
486486
}
487487

488-
- (void)setDidDisplayNodeContentWithRenderingContext:(ASDisplayNodeContextModifier)contextModifier;
488+
- (void)setDidDisplayNodeContentWithRenderingContext:(ASDisplayNodeContextModifier)contextModifier
489489
{
490490
MutexLocker l(__instanceLock__);
491491
_didDisplayNodeContentWithRenderingContext = contextModifier;

Source/TextKit/ASTextKitFontSizeAdjuster.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ @implementation ASTextKitFontSizeAdjuster
4040

4141
- (instancetype)initWithContext:(ASTextKitContext *)context
4242
constrainedSize:(CGSize)constrainedSize
43-
textKitAttributes:(const ASTextKitAttributes &)textComponentAttributes;
43+
textKitAttributes:(const ASTextKitAttributes &)textComponentAttributes
4444
{
4545
if (self = [super init]) {
4646
_context = context;

Source/TextKit/ASTextKitRenderer.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ - (BOOL)canUseFastPath
190190

191191
#pragma mark - Drawing
192192

193-
- (void)drawInContext:(CGContextRef)context bounds:(CGRect)bounds;
193+
- (void)drawInContext:(CGContextRef)context bounds:(CGRect)bounds
194194
{
195195
// We add an assertion so we can track the rare conditions where a graphics context is not present
196196
ASDisplayNodeAssertNotNil(context, @"This is no good without a context.");

docs/_docs/automatic-subnode-mgmt.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ By setting `.automaticallyManagesSubnodes` to `YES` on the `ASCellNode`, we _no
2727
</span>
2828
<div class = "code">
2929
<pre lang="objc" class="objcCode">
30-
- (instancetype)initWithPhotoObject:(PhotoModel *)photo;
30+
- (instancetype)initWithPhotoObject:(PhotoModel *)photo
3131
{
3232
self = [super init];
3333

@@ -103,7 +103,7 @@ class PhotoCellNode {
103103
</span>
104104
<div class = "code">
105105
<pre lang="objc" class="objcCode">
106-
- (instancetype)initWithPhotoObject:(PhotoModel *)photo;
106+
- (instancetype)initWithPhotoObject:(PhotoModel *)photo
107107
{
108108
self = [super init];
109109

docs/_docs/multiplex-image-node.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ For example, in the case that you want to react to the fact that a new image arr
9090
didUpdateImage:(UIImage *)image
9191
withIdentifier:(id)imageIdentifier
9292
fromImage:(UIImage *)previousImage
93-
withIdentifier:(id)previousImageIdentifier;
93+
withIdentifier:(id)previousImageIdentifier
9494
{
9595
// this is optional, in case you want to react to the fact that a new image came in
9696
}

examples/ASCollectionView/Sample/ViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ - (void)handleLongPress
142142

143143
#pragma mark - ASCollectionDataSource
144144

145-
- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath;
145+
- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath
146146
{
147147
NSString *text = self.data[indexPath.section][indexPath.item];
148148
return ^{

examples/ASDKTube/Sample/ViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ - (ASCellNode *)tableNode:(ASTableNode *)tableNode nodeForRowAtIndexPath:(NSInde
7373
return cellNode;
7474
}
7575

76-
- (ASVideoPlayerNode *)videoPlayerNode;
76+
- (ASVideoPlayerNode *)videoPlayerNode
7777
{
7878
if (_videoPlayerNode) {
7979
return _videoPlayerNode;

examples/ASDKgram/Sample/PhotoCellNode.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ @implementation PhotoCellNode
4646

4747
#pragma mark - Lifecycle
4848

49-
- (instancetype)initWithPhotoObject:(PhotoModel *)photo;
49+
- (instancetype)initWithPhotoObject:(PhotoModel *)photo
5050
{
5151
self = [super init];
5252

examples/ASDKgram/Sample/PhotoTableViewCell.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ @implementation PhotoTableViewCell
4141

4242
#pragma mark - Class Methods
4343

44-
+ (CGFloat)heightForPhotoModel:(PhotoModel *)photo withWidth:(CGFloat)width;
44+
+ (CGFloat)heightForPhotoModel:(PhotoModel *)photo withWidth:(CGFloat)width
4545
{
4646
CGFloat photoHeight = width;
4747

examples/ASDKgram/Sample/UserModel.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ - (void)fetchAvatarImageWithCompletionBlock:(void(^)(UserModel *, UIImage *))blo
6565
});
6666
}
6767

68-
- (void)downloadCompleteUserDataWithCompletionBlock:(void(^)(UserModel *))block;
68+
- (void)downloadCompleteUserDataWithCompletionBlock:(void(^)(UserModel *))block
6969
{
7070
if (_fullUserInfoFetchDone) {
7171
NSAssert(!_fullUserInfoCompletionBlock, @"Should not have a waiting block at this point");

examples/VerticalWithinHorizontalScrolling/Sample/ViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ - (ASCellNodeBlock)pagerNode:(ASPagerNode *)pagerNode nodeBlockAtIndex:(NSIntege
7474
};
7575
}
7676

77-
- (ASSizeRange)pagerNode:(ASPagerNode *)pagerNode constrainedSizeForNodeAtIndex:(NSInteger)index;
77+
- (ASSizeRange)pagerNode:(ASPagerNode *)pagerNode constrainedSizeForNodeAtIndex:(NSInteger)index
7878
{
7979
return ASSizeRangeMake(pagerNode.bounds.size);
8080
}

examples/Videos/Sample/ASVideoNode.m

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ @interface ASVideoNode ()
1616

1717
@implementation ASVideoNode
1818

19-
- (instancetype)initWithURL:(NSURL *)URL;
19+
- (instancetype)initWithURL:(NSURL *)URL
2020
{
2121
return [self initWithURL:URL videoGravity:ASVideoGravityResizeAspect];
2222
}
2323

24-
- (instancetype)initWithURL:(NSURL *)URL videoGravity:(ASVideoGravity)gravity;
24+
- (instancetype)initWithURL:(NSURL *)URL videoGravity:(ASVideoGravity)gravity
2525
{
2626
if (!(self = [super initWithLayerBlock:^CALayer *{
2727
AVPlayerLayer *layer = [[AVPlayerLayer alloc] init];
@@ -37,7 +37,7 @@ - (instancetype)initWithURL:(NSURL *)URL videoGravity:(ASVideoGravity)gravity;
3737
return self;
3838
}
3939

40-
- (void)setGravity:(ASVideoGravity)gravity;
40+
- (void)setGravity:(ASVideoGravity)gravity
4141
{
4242
switch (gravity) {
4343
case ASVideoGravityResize:
@@ -55,7 +55,7 @@ - (void)setGravity:(ASVideoGravity)gravity;
5555
}
5656
}
5757

58-
- (ASVideoGravity)gravity;
58+
- (ASVideoGravity)gravity
5959
{
6060
if ([((AVPlayerLayer *)self.layer).contentsGravity isEqualToString:AVLayerVideoGravityResize]) {
6161
return ASVideoGravityResize;
@@ -67,12 +67,12 @@ - (ASVideoGravity)gravity;
6767
return ASVideoGravityResizeAspect;
6868
}
6969

70-
- (void)play;
70+
- (void)play
7171
{
7272
[[((AVPlayerLayer *)self.layer) player] play];
7373
}
7474

75-
- (void)pause;
75+
- (void)pause
7676
{
7777
[[((AVPlayerLayer *)self.layer) player] pause];
7878
}

examples/Videos/Sample/ViewController.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ - (void)viewDidLoad
7272

7373
#pragma mark - Getter / Setter
7474

75-
- (ASVideoNode *)guitarVideoNode;
75+
- (ASVideoNode *)guitarVideoNode
7676
{
7777
if (_guitarVideoNode) {
7878
return _guitarVideoNode;
@@ -88,7 +88,7 @@ - (ASVideoNode *)guitarVideoNode;
8888
return _guitarVideoNode;
8989
}
9090

91-
- (ASVideoNode *)nicCageVideoNode;
91+
- (ASVideoNode *)nicCageVideoNode
9292
{
9393
ASVideoNode *nicCageVideoNode = [[ASVideoNode alloc] init];
9494
nicCageVideoNode.delegate = self;
@@ -117,7 +117,7 @@ - (ASVideoNode *)simonVideoNode
117117
return simonVideoNode;
118118
}
119119

120-
- (ASVideoNode *)hlsVideoNode;
120+
- (ASVideoNode *)hlsVideoNode
121121
{
122122
ASVideoNode *hlsVideoNode = [[ASVideoNode alloc] init];
123123

@@ -134,7 +134,7 @@ - (ASVideoNode *)hlsVideoNode;
134134
return hlsVideoNode;
135135
}
136136

137-
- (ASButtonNode *)playButton;
137+
- (ASButtonNode *)playButton
138138
{
139139
ASButtonNode *playButtonNode = [[ASButtonNode alloc] init];
140140

examples_extra/CollectionViewWithViewControllerCells/Sample/ImageViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ - (void)viewDidLoad {
3535
self.imageView.contentMode = UIViewContentModeScaleAspectFill;
3636
}
3737

38-
- (void)tapped;
38+
- (void)tapped
3939
{
4040
NSLog(@"tapped!");
4141
}

0 commit comments

Comments
 (0)