Skip to content

Commit 16feabf

Browse files
Amy Leefacebook-github-bot
authored andcommitted
Address some RN build warnings
Summary: Addresses build warnings for some additional compiler flags. Changelog: [Internal] Reviewed By: nlutsenko Differential Revision: D34299822 fbshipit-source-id: d3d873fb600990a869cb0e6fbe9fff4ebc8c5d0e
1 parent c1db41f commit 16feabf

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

BUCK

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ RCTCXXBRIDGE_PUBLIC_HEADERS = {
3636
"JSCExecutorFactory.h",
3737
"NSDataBigString.h",
3838
"RCTCxxBridgeDelegate.h",
39+
"RCTJSIExecutorRuntimeInstaller.h",
3940
"RCTMessageThread.h",
4041
]
4142
}

Libraries/Image/RCTImageLoader.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void RCTEnableImageLoadingPerfInstrumentation(BOOL enabled)
4040

4141
static NSInteger RCTImageBytesForImage(UIImage *image)
4242
{
43-
NSInteger singleImageBytes = image.size.width * image.size.height * image.scale * image.scale * 4;
43+
NSInteger singleImageBytes = (NSInteger)(image.size.width * image.size.height * image.scale * image.scale * 4);
4444
return image.images ? image.images.count * singleImageBytes : singleImageBytes;
4545
}
4646

@@ -614,7 +614,7 @@ - (RCTImageURLLoaderRequest *)_loadImageOrDataWithURLRequest:(NSURLRequest *)req
614614
});
615615

616616
return [[RCTImageURLLoaderRequest alloc] initWithRequestId:requestId imageURL:request.URL cancellationBlock:^{
617-
BOOL alreadyCancelled = atomic_fetch_or(cancelled.get(), 1);
617+
BOOL alreadyCancelled = atomic_fetch_or(cancelled.get(), 1) ? YES : NO;
618618
if (alreadyCancelled) {
619619
return;
620620
}
@@ -754,7 +754,7 @@ - (RCTImageURLLoaderRequest *)loadImageWithURLRequest:(NSURLRequest *)imageURLRe
754754
__block dispatch_block_t cancelLoad = nil;
755755
__block NSLock *cancelLoadLock = [NSLock new];
756756
dispatch_block_t cancellationBlock = ^{
757-
BOOL alreadyCancelled = atomic_fetch_or(cancelled.get(), 1);
757+
BOOL alreadyCancelled = atomic_fetch_or(cancelled.get(), 1) ? YES : NO;
758758
if (alreadyCancelled) {
759759
return;
760760
}
@@ -904,7 +904,7 @@ - (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)data
904904
} else {
905905
dispatch_block_t decodeBlock = ^{
906906
// Calculate the size, in bytes, that the decompressed image will require
907-
NSInteger decodedImageBytes = (size.width * scale) * (size.height * scale) * 4;
907+
NSInteger decodedImageBytes = (NSInteger)((size.width * scale) * (size.height * scale) * 4);
908908

909909
// Mark these bytes as in-use
910910
self->_activeBytes += decodedImageBytes;

Libraries/PushNotificationIOS/RCTPushNotificationManager.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ + (UILocalNotification *)UILocalNotification:(id)json
7676

7777
@end
7878
#else
79-
@interface RCTPushNotificationManager () <NativePushNotificationManagerIOS>
79+
@interface RCTPushNotificationManager () <NativePushNotificationManagerIOSSpec>
8080
@end
8181
#endif // TARGET_OS_UIKITFORMAC
8282

React/Base/Surface/RCTSurface.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ - (BOOL)synchronouslyWaitForStage:(RCTSurfaceStage)stage timeout:(NSTimeInterval
481481
@"Only waiting for `RCTSurfaceStageSurfaceDidInitialRendering`, `RCTSurfaceStageSurfaceDidInitialLayout` and `RCTSurfaceStageSurfaceDidInitialMounting` stages are supported.");
482482
}
483483

484-
BOOL timeoutOccurred = dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_SEC));
484+
auto timeoutOccurred = dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, timeout * NSEC_PER_SEC));
485485

486486
// Atomic equivalent of `_waitingForMountingStageOnMainQueue = NO;`.
487487
atomic_fetch_and(&_waitingForMountingStageOnMainQueue, 0);

0 commit comments

Comments
 (0)