diff options
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/src/MGLFeature.mm | 4 | ||||
-rw-r--r-- | platform/darwin/src/MGLStyle.mm | 8 | ||||
-rw-r--r-- | platform/darwin/src/NSExpression+MGLAdditions.mm | 10 | ||||
-rw-r--r-- | platform/darwin/test/MGLExpressionTests.mm | 4 | ||||
-rw-r--r-- | platform/darwin/test/MGLOfflineStorageTests.mm | 2 |
5 files changed, 15 insertions, 13 deletions
diff --git a/platform/darwin/src/MGLFeature.mm b/platform/darwin/src/MGLFeature.mm index 2298960025..3b6a2ee488 100644 --- a/platform/darwin/src/MGLFeature.mm +++ b/platform/darwin/src/MGLFeature.mm @@ -387,8 +387,8 @@ private: innerPolygons = [NSMutableArray arrayWithCapacity:geometry.size() - 1]; for (auto iter = geometry.begin() + 1; iter != geometry.end(); iter++) { auto &innerRing = *iter; - std::vector<CLLocationCoordinate2D> coordinates = toLocationCoordinates2D(innerRing); - MGLPolygon *innerPolygon = [MGLPolygon polygonWithCoordinates:&coordinates[0] count:coordinates.size()]; + std::vector<CLLocationCoordinate2D> innerCoordinates = toLocationCoordinates2D(innerRing); + MGLPolygon *innerPolygon = [MGLPolygon polygonWithCoordinates:&innerCoordinates[0] count:innerCoordinates.size()]; [innerPolygons addObject:innerPolygon]; } } diff --git a/platform/darwin/src/MGLStyle.mm b/platform/darwin/src/MGLStyle.mm index 244d09ea14..f61fd9952b 100644 --- a/platform/darwin/src/MGLStyle.mm +++ b/platform/darwin/src/MGLStyle.mm @@ -449,8 +449,8 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles, auto layers = self.rawStyle->getLayers(); std::string siblingIdentifier = sibling.identifier.UTF8String; NSUInteger index = 0; - for (auto layer : layers) { - if (layer->getID() == siblingIdentifier) { + for (auto siblingLayer : layers) { + if (siblingLayer->getID() == siblingIdentifier) { break; } index++; @@ -470,9 +470,9 @@ static_assert(6 == mbgl::util::default_styles::numOrderedStyles, [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; } } else { - MGLStyleLayer *sibling = [self layerFromMBGLLayer:layers.at(index + 1)]; + MGLStyleLayer *nextSibling = [self layerFromMBGLLayer:layers.at(index + 1)]; try { - [layer addToStyle:self belowLayer:sibling]; + [layer addToStyle:self belowLayer:nextSibling]; } catch (std::runtime_error & err) { [NSException raise:MGLRedundantLayerIdentifierException format:@"%s", err.what()]; } diff --git a/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/darwin/src/NSExpression+MGLAdditions.mm index 0d6b74e93c..04152afffd 100644 --- a/platform/darwin/src/NSExpression+MGLAdditions.mm +++ b/platform/darwin/src/NSExpression+MGLAdditions.mm @@ -1117,14 +1117,14 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { format:@"Casting expression to %@ not yet implemented.", type]; } else if ([function isEqualToString:@"MGL_FUNCTION"] || [function isEqualToString:@"MGL_FUNCTION:"]) { - NSExpression *op = self.arguments.firstObject; - if (op.expressionType == NSConstantValueExpressionType - && [op.constantValue isEqualToString:@"collator"]) { + NSExpression *firstOp = self.arguments.firstObject; + if (firstOp.expressionType == NSConstantValueExpressionType + && [firstOp.constantValue isEqualToString:@"collator"]) { // Avoid wrapping collator options object in literal expression. return @[@"collator", self.arguments[1].constantValue]; } - if (op.expressionType == NSConstantValueExpressionType - && [op.constantValue isEqualToString:@"format"]) { + if (firstOp.expressionType == NSConstantValueExpressionType + && [firstOp.constantValue isEqualToString:@"format"]) { // Avoid wrapping format options object in literal expression. return @[@"format", self.arguments[1].mgl_jsonExpressionObject, self.arguments[2].constantValue]; } diff --git a/platform/darwin/test/MGLExpressionTests.mm b/platform/darwin/test/MGLExpressionTests.mm index 8856cbf528..7c853b56d8 100644 --- a/platform/darwin/test/MGLExpressionTests.mm +++ b/platform/darwin/test/MGLExpressionTests.mm @@ -375,8 +375,8 @@ using namespace std::string_literals; XCTAssertEqualObjects([NSExpression expressionWithMGLJSONObject:jsonExpression], expression); } { - NSArray *arguments = @[MGLConstantExpression(@1), MGLConstantExpression(@1), MGLConstantExpression(@1)]; - NSExpression *expression = [NSExpression expressionForFunction:@"add:to:" arguments:arguments]; + NSArray *threeArguments = @[MGLConstantExpression(@1), MGLConstantExpression(@1), MGLConstantExpression(@1)]; + NSExpression *expression = [NSExpression expressionForFunction:@"add:to:" arguments:threeArguments]; NSArray *jsonExpression = @[@"+", @1, @1, @1]; XCTAssertEqualObjects(expression.mgl_jsonExpressionObject, jsonExpression); jsonExpression = @[@"+", @[@"+", @1, @1], @1]; diff --git a/platform/darwin/test/MGLOfflineStorageTests.mm b/platform/darwin/test/MGLOfflineStorageTests.mm index 775197b390..f5d7ed28e1 100644 --- a/platform/darwin/test/MGLOfflineStorageTests.mm +++ b/platform/darwin/test/MGLOfflineStorageTests.mm @@ -7,6 +7,8 @@ #include <mbgl/util/run_loop.hpp> +#pragma clang diagnostic ignored "-Wshadow" + @interface MGLOfflineStorageTests : XCTestCase <MGLOfflineStorageDelegate> @end |