Fix Pinterest Xcode 7.3.1 Analyzer Warnings (#1988)

This commit is contained in:
Hannah Troisi
2016-07-27 08:23:16 -07:00
committed by Adlai Holler
parent aeec0b1a14
commit f5b3a282af
6 changed files with 16 additions and 13 deletions

View File

@@ -120,7 +120,7 @@ typedef NS_ENUM(NSUInteger, ASCellNodeVisibilityEvent) {
*/ */
- (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock; - (instancetype)initWithViewControllerBlock:(ASDisplayNodeViewControllerBlock)viewControllerBlock didLoadBlock:(nullable ASDisplayNodeDidLoadBlock)didLoadBlock;
- (void)cellNodeVisibilityEvent:(ASCellNodeVisibilityEvent)event inScrollView:(UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame; - (void)cellNodeVisibilityEvent:(ASCellNodeVisibilityEvent)event inScrollView:(nullable UIScrollView *)scrollView withCellFrame:(CGRect)cellFrame;
@end @end

View File

@@ -721,9 +721,10 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{ {
CGPoint contentOffset = scrollView.contentOffset;
_deceleratingVelocity = CGPointMake( _deceleratingVelocity = CGPointMake(
scrollView.contentOffset.x - ((targetContentOffset != NULL) ? targetContentOffset->x : 0), contentOffset.x - ((targetContentOffset != NULL) ? targetContentOffset->x : 0),
scrollView.contentOffset.y - ((targetContentOffset != NULL) ? targetContentOffset->y : 0) contentOffset.y - ((targetContentOffset != NULL) ? targetContentOffset->y : 0)
); );
if (targetContentOffset != NULL) { if (targetContentOffset != NULL) {
@@ -732,7 +733,7 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
} }
if (_asyncDelegateFlags.asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset) { if (_asyncDelegateFlags.asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset) {
[_asyncDelegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; [_asyncDelegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:(targetContentOffset ? : &contentOffset)];
} }
} }

View File

@@ -2071,7 +2071,8 @@ void recursivelyTriggerDisplayForLayer(CALayer *layer, BOOL shouldBlock)
return _layoutSpecBlock(self, constrainedSize); return _layoutSpecBlock(self, constrainedSize);
} }
return nil; ASDisplayNodeAssert(NO, @"-[ASDisplayNode layoutSpecThatFits:] should never fall through to return empty value");
return [[ASLayoutSpec alloc] init];
} }
- (ASLayout *)calculatedLayout - (ASLayout *)calculatedLayout

View File

@@ -704,9 +704,10 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset - (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset
{ {
CGPoint contentOffset = scrollView.contentOffset;
_deceleratingVelocity = CGPointMake( _deceleratingVelocity = CGPointMake(
scrollView.contentOffset.x - ((targetContentOffset != NULL) ? targetContentOffset->x : 0), contentOffset.x - ((targetContentOffset != NULL) ? targetContentOffset->x : 0),
scrollView.contentOffset.y - ((targetContentOffset != NULL) ? targetContentOffset->y : 0) contentOffset.y - ((targetContentOffset != NULL) ? targetContentOffset->y : 0)
); );
if (targetContentOffset != NULL) { if (targetContentOffset != NULL) {
@@ -715,7 +716,7 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
} }
if (_asyncDelegateFlags.asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset) { if (_asyncDelegateFlags.asyncDelegateScrollViewWillEndDraggingWithVelocityTargetContentOffset) {
[_asyncDelegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:targetContentOffset]; [_asyncDelegate scrollViewWillEndDragging:scrollView withVelocity:velocity targetContentOffset:(targetContentOffset ? : &contentOffset)];
} }
} }

View File

@@ -48,14 +48,14 @@ NS_ASSUME_NONNULL_BEGIN
* *
* @discussion A great time to update perform selector caches! * @discussion A great time to update perform selector caches!
*/ */
- (void)didChangeCollectionViewDelegate:(id<ASCollectionDelegate>)delegate; - (void)didChangeCollectionViewDelegate:(nullable id<ASCollectionDelegate>)delegate;
/** /**
* Allow the inspector to respond to dataSource changes. * Allow the inspector to respond to dataSource changes.
* *
* @discussion A great time to update perform selector caches! * @discussion A great time to update perform selector caches!
*/ */
- (void)didChangeCollectionViewDataSource:(id<ASCollectionDataSource>)dataSource; - (void)didChangeCollectionViewDataSource:(nullable id<ASCollectionDataSource>)dataSource;
@end @end

View File

@@ -17,8 +17,8 @@ NS_ASSUME_NONNULL_BEGIN
@protocol ASImageContainerProtocol <NSObject> @protocol ASImageContainerProtocol <NSObject>
- (UIImage *)asdk_image; - (nullable UIImage *)asdk_image;
- (NSData *)asdk_animatedImageData; - (nullable NSData *)asdk_animatedImageData;
@end @end