Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing NS_NOESCAPE attributes in overwritten methods #trivial #1139

Merged
merged 1 commit into from
Oct 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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