Skip to content

Commit

Permalink
Add missing NS_NOESCAPE in overwritten methods (TextureGroup#1139)
Browse files Browse the repository at this point in the history
Fixes -Wmissing-noescape warnings
  • Loading branch information
ejensen authored and mikezucc committed Nov 7, 2018
1 parent 1872c1f commit 1ec5b11
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Source/ASCollectionNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ - (void)registerSupplementaryNodeOfKind:(NSString *)elementKind
[self.view registerSupplementaryNodeOfKind:elementKind];
}

- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion
- (void)performBatchAnimated:(BOOL)animated updates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion
{
ASDisplayNodeAssertMainThread();
if (self.nodeLoaded) {
Expand All @@ -835,7 +835,7 @@ - (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completi
}
}

- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion
- (void)performBatchUpdates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion
{
[self performBatchAnimated:UIView.areAnimationsEnabled updates:updates completion:completion];
}
Expand Down
4 changes: 2 additions & 2 deletions Source/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ - (void)endUpdatesAnimated:(BOOL)animated completion:(nullable void (^)(BOOL))co
}
}

- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion
- (void)performBatchAnimated:(BOOL)animated updates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion
{
ASDisplayNodeAssertMainThread();
[self beginUpdates];
Expand All @@ -936,7 +936,7 @@ - (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completi
[self endUpdatesAnimated:animated completion:completion];
}

- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion
- (void)performBatchUpdates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion
{
// We capture the current state of whether animations are enabled if they don't provide us with one.
[self performBatchAnimated:[UIView areAnimationsEnabled] updates:updates completion:completion];
Expand Down
2 changes: 1 addition & 1 deletion Source/ASImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ - (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer
return drawParameters;
}

+ (UIImage *)displayWithParameters:(id<NSObject>)parameter isCancelled:(asdisplaynode_iscancelled_block_t)isCancelled
+ (UIImage *)displayWithParameters:(id<NSObject>)parameter isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelled
{
ASImageNodeDrawParameters *drawParameter = (ASImageNodeDrawParameters *)parameter;

Expand Down
4 changes: 2 additions & 2 deletions Source/ASTableNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ - (void)relayoutItems
[self.view relayoutItems];
}

- (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completion:(void (^)(BOOL))completion
- (void)performBatchAnimated:(BOOL)animated updates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion
{
ASDisplayNodeAssertMainThread();
if (self.nodeLoaded) {
Expand All @@ -746,7 +746,7 @@ - (void)performBatchAnimated:(BOOL)animated updates:(void (^)())updates completi
}
}

- (void)performBatchUpdates:(void (^)())updates completion:(void (^)(BOOL))completion
- (void)performBatchUpdates:(NS_NOESCAPE void (^)())updates completion:(void (^)(BOOL))completion
{
[self performBatchAnimated:YES updates:updates completion:completion];
}
Expand Down
2 changes: 1 addition & 1 deletion Source/ASTextNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ - (NSObject *)drawParametersForAsyncLayer:(_ASDisplayLayer *)layer
textContainerInsets:_textContainerInset];
}

+ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
+ (void)drawRect:(CGRect)bounds withParameters:(id)parameters isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
{
ASTextNodeDrawParameter *drawParameter = (ASTextNodeDrawParameter *)parameters;
UIColor *backgroundColor = (isRasterizing || drawParameter == nil) ? nil : drawParameter->_backgroundColor;
Expand Down
2 changes: 1 addition & 1 deletion Source/ASTextNode2.mm
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ + (ASTextLayout *)compatibleLayoutWithContainer:(ASTextContainer *)container
return layout;
}

+ (void)drawRect:(CGRect)bounds withParameters:(NSDictionary *)layoutDict isCancelled:(asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
+ (void)drawRect:(CGRect)bounds withParameters:(NSDictionary *)layoutDict isCancelled:(NS_NOESCAPE asdisplaynode_iscancelled_block_t)isCancelledBlock isRasterizing:(BOOL)isRasterizing
{
ASTextContainer *container = layoutDict[@"container"];
NSAttributedString *text = layoutDict[@"text"];
Expand Down
6 changes: 3 additions & 3 deletions Source/TextKit/ASTextKitContext.mm
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ - (instancetype)initWithAttributedString:(NSAttributedString *)attributedString
return self;
}

- (void)performBlockWithLockedTextKitComponents:(void (^)(NSLayoutManager *,
NSTextStorage *,
NSTextContainer *))block
- (void)performBlockWithLockedTextKitComponents:(NS_NOESCAPE void (^)(NSLayoutManager *,
NSTextStorage *,
NSTextContainer *))block
{
ASDN::MutexSharedLocker l(__instanceLock__);
if (block) {
Expand Down

0 comments on commit 1ec5b11

Please sign in to comment.