Skip to content

Commit

Permalink
Remove trailing semicolons between method parameters and body (#1973)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sdefresne committed Mar 26, 2021
1 parent dca5a22 commit 39ea9fe
Show file tree
Hide file tree
Showing 24 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Source/ASCellNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ - (void)setHighlighted:(BOOL)highlighted
}
}

- (void)__setSelectedFromUIKit:(BOOL)selected;
- (void)__setSelectedFromUIKit:(BOOL)selected
{
// Note: Race condition could mean redundant sets. Risk is low.
if (ASLockedSelf(_selected != selected)) {
Expand All @@ -169,7 +169,7 @@ - (void)__setSelectedFromUIKit:(BOOL)selected;
}
}

- (void)__setHighlightedFromUIKit:(BOOL)highlighted;
- (void)__setHighlightedFromUIKit:(BOOL)highlighted
{
// Note: Race condition could mean redundant sets. Risk is low.
if (ASLockedSelf(_highlighted != highlighted)) {
Expand Down
2 changes: 1 addition & 1 deletion Source/ASCollectionNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ - (void)moveItemAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)

#pragma mark - ASRangeControllerUpdateRangeProtocol

- (void)updateCurrentRangeWithMode:(ASLayoutRangeMode)rangeMode;
- (void)updateCurrentRangeWithMode:(ASLayoutRangeMode)rangeMode
{
if ([self pendingState]) {
_pendingState.rangeMode = rangeMode;
Expand Down
2 changes: 1 addition & 1 deletion Source/ASPagerNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ - (instancetype)init
return [self initWithCollectionViewLayout:flowLayout];
}

- (instancetype)initWithCollectionViewLayout:(ASPagerFlowLayout *)flowLayout;
- (instancetype)initWithCollectionViewLayout:(ASPagerFlowLayout *)flowLayout
{
ASDisplayNodeAssert([flowLayout isKindOfClass:[ASPagerFlowLayout class]], @"ASPagerNode requires a flow layout.");
ASDisplayNodeAssertTrue(flowLayout.scrollDirection == UICollectionViewScrollDirectionHorizontal);
Expand Down
4 changes: 2 additions & 2 deletions Source/Debug/AsyncDisplayKit+Debug.mm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

@implementation ASImageNode (Debugging)

+ (void)setShouldShowImageScalingOverlay:(BOOL)show;
+ (void)setShouldShowImageScalingOverlay:(BOOL)show
{
__shouldShowImageScalingOverlay = show;
}
Expand Down Expand Up @@ -437,7 +437,7 @@ - (void)updateRangeController:(ASRangeController *)controller
rangeMode:(ASLayoutRangeMode)rangeMode
displayTuningParameters:(ASRangeTuningParameters)displayTuningParameters
preloadTuningParameters:(ASRangeTuningParameters)preloadTuningParameters
interfaceState:(ASInterfaceState)interfaceState;
interfaceState:(ASInterfaceState)interfaceState
{
_ASRangeDebugBarView *viewToUpdate = [self barViewForRangeController:controller];

Expand Down
4 changes: 2 additions & 2 deletions Source/Details/ASPINRemoteImageDownloader.mm
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ - (BOOL)sharedImageManagerSupportsMemoryRemoval
}
#endif

- (id <ASImageContainerProtocol>)synchronouslyFetchedCachedImageWithURL:(NSURL *)URL;
- (id <ASImageContainerProtocol>)synchronouslyFetchedCachedImageWithURL:(NSURL *)URL
{
PINRemoteImageManager *manager = [self sharedPINRemoteImageManager];
PINRemoteImageManagerResult *result = [manager synchronousImageFromCacheWithURL:URL processorKey:nil options:PINRemoteImageManagerDownloadOptionsSkipDecode];
Expand Down Expand Up @@ -258,7 +258,7 @@ - (nullable id)downloadImageWithURL:(NSURL *)URL
shouldRetry:(BOOL)shouldRetry
callbackQueue:(dispatch_queue_t)callbackQueue
downloadProgress:(ASImageDownloaderProgress)downloadProgress
completion:(ASImageDownloaderCompletion)completion;
completion:(ASImageDownloaderCompletion)completion
{
return [self downloadImageWithURL:URL
shouldRetry:shouldRetry
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/Transactions/_ASAsyncTransaction.mm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ - (void)dealloc
NSAssert(_operationCompletionBlock == nil, @"Should have been called and released before -dealloc");
}

- (void)callAndReleaseCompletionBlock:(BOOL)canceled;
- (void)callAndReleaseCompletionBlock:(BOOL)canceled
{
ASDisplayNodeAssertMainThread();
if (_operationCompletionBlock) {
Expand Down
2 changes: 1 addition & 1 deletion Source/Layout/ASCenterLayoutSpec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ @implementation ASCenterLayoutSpec

- (instancetype)initWithCenteringOptions:(ASCenterLayoutSpecCenteringOptions)centeringOptions
sizingOptions:(ASCenterLayoutSpecSizingOptions)sizingOptions
child:(id<ASLayoutElement>)child;
child:(id<ASLayoutElement>)child
{
ASRelativeLayoutSpecPosition verticalPosition = [self verticalPositionFromCenteringOptions:centeringOptions];
ASRelativeLayoutSpecPosition horizontalPosition = [self horizontalPositionFromCenteringOptions:centeringOptions];
Expand Down
2 changes: 1 addition & 1 deletion Source/Layout/ASInsetLayoutSpec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static CGFloat centerInset(CGFloat outer, CGFloat inner)

@implementation ASInsetLayoutSpec

- (instancetype)initWithInsets:(UIEdgeInsets)insets child:(id<ASLayoutElement>)child;
- (instancetype)initWithInsets:(UIEdgeInsets)insets child:(id<ASLayoutElement>)child
{
if (!(self = [super init])) {
return nil;
Expand Down
2 changes: 1 addition & 1 deletion Source/Layout/ASRatioLayoutSpec.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ + (instancetype)ratioLayoutSpecWithRatio:(CGFloat)ratio child:(id<ASLayoutElemen
return [[self alloc] initWithRatio:ratio child:child];
}

- (instancetype)initWithRatio:(CGFloat)ratio child:(id<ASLayoutElement>)child;
- (instancetype)initWithRatio:(CGFloat)ratio child:(id<ASLayoutElement>)child
{
if (!(self = [super init])) {
return nil;
Expand Down
4 changes: 2 additions & 2 deletions Source/Private/ASCollectionViewFlowLayoutInspector.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ @implementation ASCollectionViewFlowLayoutInspector {

#pragma mark Lifecycle

- (instancetype)initWithFlowLayout:(UICollectionViewFlowLayout *)flowLayout;
- (instancetype)initWithFlowLayout:(UICollectionViewFlowLayout *)flowLayout
{
NSParameterAssert(flowLayout);

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

#pragma mark ASCollectionViewLayoutInspecting

- (void)didChangeCollectionViewDelegate:(id<ASCollectionDelegate>)delegate;
- (void)didChangeCollectionViewDelegate:(id<ASCollectionDelegate>)delegate
{
if (delegate == nil) {
memset(&_delegateFlags, 0, sizeof(_delegateFlags));
Expand Down
2 changes: 1 addition & 1 deletion Source/Private/ASDisplayNode+AsyncDisplay.mm
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ - (void)setWillDisplayNodeContentWithRenderingContext:(ASDisplayNodeContextModif
_willDisplayNodeContentWithRenderingContext = contextModifier;
}

- (void)setDidDisplayNodeContentWithRenderingContext:(ASDisplayNodeContextModifier)contextModifier;
- (void)setDidDisplayNodeContentWithRenderingContext:(ASDisplayNodeContextModifier)contextModifier
{
MutexLocker l(__instanceLock__);
_didDisplayNodeContentWithRenderingContext = contextModifier;
Expand Down
2 changes: 1 addition & 1 deletion Source/TextKit/ASTextKitFontSizeAdjuster.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ @implementation ASTextKitFontSizeAdjuster

- (instancetype)initWithContext:(ASTextKitContext *)context
constrainedSize:(CGSize)constrainedSize
textKitAttributes:(const ASTextKitAttributes &)textComponentAttributes;
textKitAttributes:(const ASTextKitAttributes &)textComponentAttributes
{
if (self = [super init]) {
_context = context;
Expand Down
2 changes: 1 addition & 1 deletion Source/TextKit/ASTextKitRenderer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ - (BOOL)canUseFastPath

#pragma mark - Drawing

- (void)drawInContext:(CGContextRef)context bounds:(CGRect)bounds;
- (void)drawInContext:(CGContextRef)context bounds:(CGRect)bounds
{
// We add an assertion so we can track the rare conditions where a graphics context is not present
ASDisplayNodeAssertNotNil(context, @"This is no good without a context.");
Expand Down
4 changes: 2 additions & 2 deletions docs/_docs/automatic-subnode-mgmt.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ By setting `.automaticallyManagesSubnodes` to `YES` on the `ASCellNode`, we _no
</span>
<div class = "code">
<pre lang="objc" class="objcCode">
- (instancetype)initWithPhotoObject:(PhotoModel *)photo;
- (instancetype)initWithPhotoObject:(PhotoModel *)photo
{
self = [super init];

Expand Down Expand Up @@ -103,7 +103,7 @@ class PhotoCellNode {
</span>
<div class = "code">
<pre lang="objc" class="objcCode">
- (instancetype)initWithPhotoObject:(PhotoModel *)photo;
- (instancetype)initWithPhotoObject:(PhotoModel *)photo
{
self = [super init];

Expand Down
2 changes: 1 addition & 1 deletion docs/_docs/multiplex-image-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ For example, in the case that you want to react to the fact that a new image arr
didUpdateImage:(UIImage *)image
withIdentifier:(id)imageIdentifier
fromImage:(UIImage *)previousImage
withIdentifier:(id)previousImageIdentifier;
withIdentifier:(id)previousImageIdentifier
{
// this is optional, in case you want to react to the fact that a new image came in
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ASCollectionView/Sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ - (void)handleLongPress

#pragma mark - ASCollectionDataSource

- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath;
- (ASCellNodeBlock)collectionNode:(ASCollectionNode *)collectionNode nodeBlockForItemAtIndexPath:(NSIndexPath *)indexPath
{
NSString *text = self.data[indexPath.section][indexPath.item];
return ^{
Expand Down
2 changes: 1 addition & 1 deletion examples/ASDKTube/Sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ - (ASCellNode *)tableNode:(ASTableNode *)tableNode nodeForRowAtIndexPath:(NSInde
return cellNode;
}

- (ASVideoPlayerNode *)videoPlayerNode;
- (ASVideoPlayerNode *)videoPlayerNode
{
if (_videoPlayerNode) {
return _videoPlayerNode;
Expand Down
2 changes: 1 addition & 1 deletion examples/ASDKgram/Sample/PhotoCellNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ @implementation PhotoCellNode

#pragma mark - Lifecycle

- (instancetype)initWithPhotoObject:(PhotoModel *)photo;
- (instancetype)initWithPhotoObject:(PhotoModel *)photo
{
self = [super init];

Expand Down
2 changes: 1 addition & 1 deletion examples/ASDKgram/Sample/PhotoTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ @implementation PhotoTableViewCell

#pragma mark - Class Methods

+ (CGFloat)heightForPhotoModel:(PhotoModel *)photo withWidth:(CGFloat)width;
+ (CGFloat)heightForPhotoModel:(PhotoModel *)photo withWidth:(CGFloat)width
{
CGFloat photoHeight = width;

Expand Down
2 changes: 1 addition & 1 deletion examples/ASDKgram/Sample/UserModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ - (void)fetchAvatarImageWithCompletionBlock:(void(^)(UserModel *, UIImage *))blo
});
}

- (void)downloadCompleteUserDataWithCompletionBlock:(void(^)(UserModel *))block;
- (void)downloadCompleteUserDataWithCompletionBlock:(void(^)(UserModel *))block
{
if (_fullUserInfoFetchDone) {
NSAssert(!_fullUserInfoCompletionBlock, @"Should not have a waiting block at this point");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ - (ASCellNodeBlock)pagerNode:(ASPagerNode *)pagerNode nodeBlockAtIndex:(NSIntege
};
}

- (ASSizeRange)pagerNode:(ASPagerNode *)pagerNode constrainedSizeForNodeAtIndex:(NSInteger)index;
- (ASSizeRange)pagerNode:(ASPagerNode *)pagerNode constrainedSizeForNodeAtIndex:(NSInteger)index
{
return ASSizeRangeMake(pagerNode.bounds.size);
}
Expand Down
12 changes: 6 additions & 6 deletions examples/Videos/Sample/ASVideoNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ @interface ASVideoNode ()

@implementation ASVideoNode

- (instancetype)initWithURL:(NSURL *)URL;
- (instancetype)initWithURL:(NSURL *)URL
{
return [self initWithURL:URL videoGravity:ASVideoGravityResizeAspect];
}

- (instancetype)initWithURL:(NSURL *)URL videoGravity:(ASVideoGravity)gravity;
- (instancetype)initWithURL:(NSURL *)URL videoGravity:(ASVideoGravity)gravity
{
if (!(self = [super initWithLayerBlock:^CALayer *{
AVPlayerLayer *layer = [[AVPlayerLayer alloc] init];
Expand All @@ -37,7 +37,7 @@ - (instancetype)initWithURL:(NSURL *)URL videoGravity:(ASVideoGravity)gravity;
return self;
}

- (void)setGravity:(ASVideoGravity)gravity;
- (void)setGravity:(ASVideoGravity)gravity
{
switch (gravity) {
case ASVideoGravityResize:
Expand All @@ -55,7 +55,7 @@ - (void)setGravity:(ASVideoGravity)gravity;
}
}

- (ASVideoGravity)gravity;
- (ASVideoGravity)gravity
{
if ([((AVPlayerLayer *)self.layer).contentsGravity isEqualToString:AVLayerVideoGravityResize]) {
return ASVideoGravityResize;
Expand All @@ -67,12 +67,12 @@ - (ASVideoGravity)gravity;
return ASVideoGravityResizeAspect;
}

- (void)play;
- (void)play
{
[[((AVPlayerLayer *)self.layer) player] play];
}

- (void)pause;
- (void)pause
{
[[((AVPlayerLayer *)self.layer) player] pause];
}
Expand Down
8 changes: 4 additions & 4 deletions examples/Videos/Sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ - (void)viewDidLoad

#pragma mark - Getter / Setter

- (ASVideoNode *)guitarVideoNode;
- (ASVideoNode *)guitarVideoNode
{
if (_guitarVideoNode) {
return _guitarVideoNode;
Expand All @@ -88,7 +88,7 @@ - (ASVideoNode *)guitarVideoNode;
return _guitarVideoNode;
}

- (ASVideoNode *)nicCageVideoNode;
- (ASVideoNode *)nicCageVideoNode
{
ASVideoNode *nicCageVideoNode = [[ASVideoNode alloc] init];
nicCageVideoNode.delegate = self;
Expand Down Expand Up @@ -117,7 +117,7 @@ - (ASVideoNode *)simonVideoNode
return simonVideoNode;
}

- (ASVideoNode *)hlsVideoNode;
- (ASVideoNode *)hlsVideoNode
{
ASVideoNode *hlsVideoNode = [[ASVideoNode alloc] init];

Expand All @@ -134,7 +134,7 @@ - (ASVideoNode *)hlsVideoNode;
return hlsVideoNode;
}

- (ASButtonNode *)playButton;
- (ASButtonNode *)playButton
{
ASButtonNode *playButtonNode = [[ASButtonNode alloc] init];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ - (void)viewDidLoad {
self.imageView.contentMode = UIViewContentModeScaleAspectFill;
}

- (void)tapped;
- (void)tapped
{
NSLog(@"tapped!");
}
Expand Down

0 comments on commit 39ea9fe

Please sign in to comment.