diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-05-10 00:01:35 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-05-18 17:11:12 -0700 |
commit | b7b4515d4883f7da1fdcfb4d5aff7a2f3118ae86 (patch) | |
tree | 0d0cee369d74946c0b8f562fc080a71655111c91 /platform | |
parent | 63ea3d4befe7f2a8958cf3496d31d2a71561801b (diff) | |
download | qtlocation-mapboxgl-b7b4515d4883f7da1fdcfb4d5aff7a2f3118ae86.tar.gz |
Marked unused parameters with __unused
Replaced haphazard usage of pragmas and `(void)` expressions with the `__unused` keyword.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/MGLMapView.mm | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 72a2ed0d62..5d14107518 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -649,10 +649,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) #pragma mark - Life Cycle - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wunused-parameter" - -- (void)sleepGL:(NSNotification *)notification +- (void)sleepGL:(__unused NSNotification *)notification { MGLAssertIsMainThread(); @@ -686,7 +683,7 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) } } -- (void)wakeGL:(NSNotification *)notification +- (void)wakeGL:(__unused NSNotification *)notification { MGLAssertIsMainThread(); @@ -720,19 +717,15 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) #pragma mark - Gestures - -- (void)handleCompassTapGesture:(id)sender +- (void)handleCompassTapGesture:(__unused id)sender { [self resetNorthAnimated:YES]; if (self.userTrackingMode == MGLUserTrackingModeFollowWithHeading) self.userTrackingMode = MGLUserTrackingModeFollow; } -#pragma clang diagnostic pop - -- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +- (void)touchesBegan:(__unused NSSet *)touches withEvent:(__unused UIEvent *)event { - (void)touches; - (void)event; _mbglMap->cancelTransitions(); _mbglMap->setGestureInProgress(false); self.animatingGesture = NO; @@ -2018,10 +2011,8 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng) } } -- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation +- (void)locationManager:(__unused CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { - (void)manager; - if ( ! _showsUserLocation || ! newLocation || ! CLLocationCoordinate2DIsValid(newLocation.coordinate)) return; if ([newLocation distanceFromLocation:oldLocation] || ! oldLocation) @@ -2094,19 +2085,15 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng) - (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager { - (void)manager; - - if (self.displayHeadingCalibration) [self.locationManager performSelector:@selector(dismissHeadingCalibrationDisplay) - withObject:nil - afterDelay:10.0]; + if (self.displayHeadingCalibration) [manager performSelector:@selector(dismissHeadingCalibrationDisplay) + withObject:nil + afterDelay:10.0]; return self.displayHeadingCalibration; } -- (void)locationManager:(CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading +- (void)locationManager:(__unused CLLocationManager *)manager didUpdateHeading:(CLHeading *)newHeading { - (void)manager; - if ( ! _showsUserLocation || self.pan.state == UIGestureRecognizerStateBegan || newHeading.headingAccuracy < 0) return; self.userLocation.heading = newHeading; @@ -2126,10 +2113,8 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng) } } -- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status +- (void)locationManager:(__unused CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { - (void)manager; - if (status == kCLAuthorizationStatusDenied || status == kCLAuthorizationStatusRestricted) { self.userTrackingMode = MGLUserTrackingModeNone; @@ -2137,10 +2122,8 @@ CLLocationCoordinate2D latLngToCoordinate(mbgl::LatLng latLng) } } -- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error +- (void)locationManager:(__unused CLLocationManager *)manager didFailWithError:(NSError *)error { - (void)manager; - if ([error code] == kCLErrorDenied) { self.userTrackingMode = MGLUserTrackingModeNone; |