mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
cast implicit int to CGFloat conversions [3/3]
Summary: Insert casts for implicit int -> CGFloat conversions. This warning category is generally benign and explicitly casting will preserve existing behavior. Reviewed By: NSProgrammer Differential Revision: D33303887 fbshipit-source-id: b21adbcf754e707adfe3f8eaa0fe9c3a65380cc5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a7104b03e7
commit
e60f0f5034
@@ -97,18 +97,18 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
||||
self->_label.text = [NSString stringWithFormat:@"%lu", (unsigned long)self->_FPS];
|
||||
});
|
||||
|
||||
CGFloat scale = 60.0 / _height;
|
||||
CGFloat scale = 60.0 / (CGFloat)_height;
|
||||
for (NSUInteger i = 0; i < _length - 1; i++) {
|
||||
_frames[i] = _frames[i + 1];
|
||||
}
|
||||
_frames[_length - 1] = _FPS / scale;
|
||||
|
||||
CGMutablePathRef path = CGPathCreateMutable();
|
||||
CGPathMoveToPoint(path, NULL, 0, _height);
|
||||
CGPathMoveToPoint(path, NULL, 0, (CGFloat)_height);
|
||||
for (NSUInteger i = 0; i < _length; i++) {
|
||||
CGPathAddLineToPoint(path, NULL, i, _height - _frames[i]);
|
||||
CGPathAddLineToPoint(path, NULL, (CGFloat)i, _height - _frames[i]);
|
||||
}
|
||||
CGPathAddLineToPoint(path, NULL, _length - 1, _height);
|
||||
CGPathAddLineToPoint(path, NULL, (CGFloat)_length - 1, (CGFloat)_height);
|
||||
|
||||
_graph.path = path;
|
||||
CGPathRelease(path);
|
||||
|
||||
@@ -138,8 +138,8 @@
|
||||
selector:@selector(showExtraDataViewController)
|
||||
block:nil];
|
||||
|
||||
CGFloat buttonWidth = frame.size.width / (4 + [customButtonTitles count]);
|
||||
CGFloat bottomButtonHeight = frame.size.height - buttonHeight - [self bottomSafeViewHeight];
|
||||
CGFloat buttonWidth = frame.size.width / (CGFloat)(4 + [customButtonTitles count]);
|
||||
CGFloat bottomButtonHeight = frame.size.height - buttonHeight - (CGFloat)[self bottomSafeViewHeight];
|
||||
dismissButton.frame = CGRectMake(0, bottomButtonHeight, buttonWidth, buttonHeight);
|
||||
reloadButton.frame = CGRectMake(buttonWidth, bottomButtonHeight, buttonWidth, buttonHeight);
|
||||
copyButton.frame = CGRectMake(buttonWidth * 2, bottomButtonHeight, buttonWidth, buttonHeight);
|
||||
@@ -168,7 +168,7 @@
|
||||
UIView *bottomSafeView = [UIView new];
|
||||
bottomSafeView.backgroundColor = [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:1];
|
||||
bottomSafeView.frame =
|
||||
CGRectMake(0, frame.size.height - [self bottomSafeViewHeight], frame.size.width, [self bottomSafeViewHeight]);
|
||||
CGRectMake(0, frame.size.height - (CGFloat)[self bottomSafeViewHeight], frame.size.width, (CGFloat)[self bottomSafeViewHeight]);
|
||||
|
||||
[rootView addSubview:bottomSafeView];
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
NSInteger snapIndex = velocityAlongAxis > 0.0 ? ceil(fractionalIndex)
|
||||
: velocityAlongAxis < 0.0 ? floor(fractionalIndex)
|
||||
: round(fractionalIndex);
|
||||
CGFloat newTargetContentOffset = (snapIndex * snapToIntervalF) - alignmentOffset;
|
||||
CGFloat newTargetContentOffset = ((CGFloat)snapIndex * snapToIntervalF) - alignmentOffset;
|
||||
|
||||
// Set new targetContentOffset
|
||||
if (isHorizontal) {
|
||||
|
||||
Reference in New Issue
Block a user