Skip to content

Commit

Permalink
Mark params __unused or #pragma unused
Browse files Browse the repository at this point in the history
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 #11797

Differential Revision: D4396611

fbshipit-source-id: 728e9ebb94d147f7a2cbc674a25fe67e66e2e8b2
  • Loading branch information
robhogan authored and facebook-github-bot committed Jan 10, 2017
1 parent fa3c06d commit 2d8a287
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion React/Modules/JSCSamplingProfiler.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ @implementation JSCSamplingProfiler
RCT_EXPORT_MODULE(JSCSamplingProfiler);

#ifdef RCT_PROFILE
RCT_EXPORT_METHOD(operationComplete:(int)token result:(id)profileData error:(id)error)
RCT_EXPORT_METHOD(operationComplete:(__unused int)token result:(id)profileData error:(id)error)
{
if (error) {
RCTLogError(@"JSC Sampling profiler ended with error: %@", error);
Expand Down
5 changes: 3 additions & 2 deletions React/Views/RCTMapManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ - (UIView *)view
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, RCTMap)
{
#pragma unused (defaultView)
if (json) {
[view setRegion:[RCTConvert MKCoordinateRegion:json] animated:YES];
}
Expand Down Expand Up @@ -290,15 +291,15 @@ - (MKAnnotationView *)mapView:(RCTMap *)mapView
return annotationView;
}

- (void)mapView:(RCTMap *)mapView didAddAnnotationViews:(NSArray *)views {
- (void)mapView:(RCTMap *)mapView didAddAnnotationViews:(__unused NSArray *)views {
if (mapView.showsAnnotationCallouts) {
for (id<MKAnnotation> annotation in mapView.annotations) {
[mapView selectAnnotation:annotation animated:YES];
}
}
}

- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay
- (MKOverlayRenderer *)mapView:(__unused MKMapView *)mapView rendererForOverlay:(id<MKOverlay>)overlay
{
RCTAssert([overlay isKindOfClass:[RCTMapOverlay class]], @"Overlay must be of type RCTMapOverlay");
MKPolylineRenderer *polylineRenderer = [[MKPolylineRenderer alloc] initWithPolyline:overlay];
Expand Down
1 change: 1 addition & 0 deletions React/Views/RCTScrollViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ - (UIView *)view
// that css-layout is always treating the contents of a scroll container as
// overflow: 'scroll'.
RCT_CUSTOM_SHADOW_PROPERTY(overflow, YGOverflow, RCTShadowView) {
#pragma unused (json)
view.overflow = YGOverflowScroll;
}

Expand Down

0 comments on commit 2d8a287

Please sign in to comment.