Skip to content

Commit 2d8a287

Browse files
robhoganfacebook-github-bot
authored andcommitted
Mark params __unused or #pragma unused
Summary: Motivation: reduce build noise that might worry new users or hide real problems. This deals with four of the warnings currently in the iOS build. The `__unused` additions are standard and self-explanatory, following the style used elsewhere in RN. I've used `#pragma unused` to deal with parameters named by macros. Tested by building and running the `UIExplorer` example app in XCode 8.2 Closes facebook#11797 Differential Revision: D4396611 fbshipit-source-id: 728e9ebb94d147f7a2cbc674a25fe67e66e2e8b2
1 parent fa3c06d commit 2d8a287

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

React/Modules/JSCSamplingProfiler.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ @implementation JSCSamplingProfiler
2020
RCT_EXPORT_MODULE(JSCSamplingProfiler);
2121

2222
#ifdef RCT_PROFILE
23-
RCT_EXPORT_METHOD(operationComplete:(int)token result:(id)profileData error:(id)error)
23+
RCT_EXPORT_METHOD(operationComplete:(__unused int)token result:(id)profileData error:(id)error)
2424
{
2525
if (error) {
2626
RCTLogError(@"JSC Sampling profiler ended with error: %@", error);

React/Views/RCTMapManager.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ - (UIView *)view
104104
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
105105
RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, RCTMap)
106106
{
107+
#pragma unused (defaultView)
107108
if (json) {
108109
[view setRegion:[RCTConvert MKCoordinateRegion:json] animated:YES];
109110
}
@@ -290,15 +291,15 @@ - (MKAnnotationView *)mapView:(RCTMap *)mapView
290291
return annotationView;
291292
}
292293

293-
- (void)mapView:(RCTMap *)mapView didAddAnnotationViews:(NSArray *)views {
294+
- (void)mapView:(RCTMap *)mapView didAddAnnotationViews:(__unused NSArray *)views {
294295
if (mapView.showsAnnotationCallouts) {
295296
for (id<MKAnnotation> annotation in mapView.annotations) {
296297
[mapView selectAnnotation:annotation animated:YES];
297298
}
298299
}
299300
}
300301

301-
- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay
302+
- (MKOverlayRenderer *)mapView:(__unused MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay
302303
{
303304
RCTAssert([overlay isKindOfClass:[RCTMapOverlay class]], @"Overlay must be of type RCTMapOverlay");
304305
MKPolylineRenderer *polylineRenderer = [[MKPolylineRenderer alloc] initWithPolyline:overlay];

React/Views/RCTScrollViewManager.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ - (UIView *)view
8888
// that css-layout is always treating the contents of a scroll container as
8989
// overflow: 'scroll'.
9090
RCT_CUSTOM_SHADOW_PROPERTY(overflow, YGOverflow, RCTShadowView) {
91+
#pragma unused (json)
9192
view.overflow = YGOverflowScroll;
9293
}
9394

0 commit comments

Comments
 (0)