diff options
author | Jason Wray <jason@mapbox.com> | 2018-11-19 18:51:28 -0500 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2018-11-20 11:48:18 -0500 |
commit | 83ecb765629ddbbe59998178acbb2f3db6db213a (patch) | |
tree | dde9c336f6d432250843bbedd676a643c7d4d4a6 | |
parent | 00d0864441f94104806a7459fb814318f104c14b (diff) | |
download | qtlocation-mapboxgl-83ecb765629ddbbe59998178acbb2f3db6db213a.tar.gz |
[darwin] Fix GCC_WARN_SIGN_COMPARE warnings
-rw-r--r-- | platform/darwin/src/MGLPointCollection.mm | 2 | ||||
-rw-r--r-- | platform/darwin/src/MGLPolygon.mm | 2 | ||||
-rw-r--r-- | platform/darwin/test/MGLFeatureTests.mm | 12 | ||||
-rw-r--r-- | platform/darwin/test/MGLGeometryTests.mm | 2 | ||||
-rw-r--r-- | platform/darwin/test/MGLOfflineStorageTests.mm | 2 | ||||
-rw-r--r-- | platform/darwin/test/MGLShapeSourceTests.mm | 6 | ||||
-rw-r--r-- | platform/darwin/test/MGLStyleTests.mm | 8 | ||||
-rw-r--r-- | platform/darwin/test/MGLTileSetTests.mm | 2 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 4 | ||||
-rw-r--r-- | platform/ios/src/MGLScaleBar.mm | 2 | ||||
-rw-r--r-- | platform/macos/app/MapDocument.m | 2 |
11 files changed, 22 insertions, 22 deletions
diff --git a/platform/darwin/src/MGLPointCollection.mm b/platform/darwin/src/MGLPointCollection.mm index f4f91f0162..6e056712f7 100644 --- a/platform/darwin/src/MGLPointCollection.mm +++ b/platform/darwin/src/MGLPointCollection.mm @@ -105,7 +105,7 @@ NS_ASSUME_NONNULL_BEGIN { mbgl::MultiPoint<double> multiPoint; multiPoint.reserve(self.pointCount); - for (NSInteger i = 0; i< self.pointCount; i++) + for (NSUInteger i = 0; i < self.pointCount; i++) { multiPoint.push_back(mbgl::Point<double>(self.coordinates[i].longitude, self.coordinates[i].latitude)); } diff --git a/platform/darwin/src/MGLPolygon.mm b/platform/darwin/src/MGLPolygon.mm index 6304408f7a..52bff01b20 100644 --- a/platform/darwin/src/MGLPolygon.mm +++ b/platform/darwin/src/MGLPolygon.mm @@ -117,7 +117,7 @@ for (MGLPolygon *interiorPolygon in self.interiorPolygons) { NSMutableArray *interiorRing = [NSMutableArray array]; - for (int index = 0; index < interiorPolygon.pointCount; index++) { + for (NSUInteger index = 0; index < interiorPolygon.pointCount; index++) { CLLocationCoordinate2D coordinate = interiorPolygon.coordinates[index]; [interiorRing addObject:@[@(coordinate.longitude), @(coordinate.latitude)]]; } diff --git a/platform/darwin/test/MGLFeatureTests.mm b/platform/darwin/test/MGLFeatureTests.mm index cf57d0b4b6..3e8e47474b 100644 --- a/platform/darwin/test/MGLFeatureTests.mm +++ b/platform/darwin/test/MGLFeatureTests.mm @@ -39,7 +39,7 @@ features.push_back(mbgl::Feature { polygon }); NSArray<MGLShape <MGLFeature> *> *shapes = MGLFeaturesFromMBGLFeatures(features); - XCTAssertEqual(shapes.count, 3, @"All features should be converted into shapes"); + XCTAssertEqual(shapes.count, 3UL, @"All features should be converted into shapes"); MGLPointFeature *pointShape = (MGLPointFeature *)shapes[0]; XCTAssertTrue([pointShape isKindOfClass:[MGLPointFeature class]]); @@ -48,7 +48,7 @@ MGLPolylineFeature *polylineShape = (MGLPolylineFeature *)shapes[1]; XCTAssertTrue([polylineShape isKindOfClass:[MGLPolylineFeature class]]); - XCTAssertEqual(polylineShape.pointCount, 2); + XCTAssertEqual(polylineShape.pointCount, 2UL); CLLocationCoordinate2D polylineCoordinates[2]; [polylineShape getCoordinates:polylineCoordinates range:NSMakeRange(0, polylineShape.pointCount)]; XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:polylineCoordinates[0]], @@ -58,7 +58,7 @@ MGLPolygonFeature *polygonShape = (MGLPolygonFeature *)shapes[2]; XCTAssertTrue([polygonShape isKindOfClass:[MGLPolygonFeature class]]); - XCTAssertEqual(polygonShape.pointCount, 4); + XCTAssertEqual(polygonShape.pointCount, 4UL); CLLocationCoordinate2D *polygonCoordinates = polygonShape.coordinates; XCTAssertNotEqual(polygonCoordinates, nil); XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:polygonCoordinates[0]], @@ -70,9 +70,9 @@ XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:polygonCoordinates[3]], [NSValue valueWithMGLCoordinate:CLLocationCoordinate2DMake(4, 1)]); NSArray<MGLPolygon *> *interiorPolygons = polygonShape.interiorPolygons; - XCTAssertEqual(interiorPolygons.count, 1); + XCTAssertEqual(interiorPolygons.count, 1UL); MGLPolygon *interiorPolygon = interiorPolygons.firstObject; - XCTAssertEqual(interiorPolygon.pointCount, 4); + XCTAssertEqual(interiorPolygon.pointCount, 4UL); CLLocationCoordinate2D interiorPolygonCoordinates[4]; [interiorPolygon getCoordinates:interiorPolygonCoordinates range:NSMakeRange(0, interiorPolygon.pointCount)]; XCTAssertEqualObjects([NSValue valueWithMGLCoordinate:interiorPolygonCoordinates[0]], @@ -104,7 +104,7 @@ features.push_back(pointFeature); NSArray<MGLShape <MGLFeature> *> *shapes = MGLFeaturesFromMBGLFeatures(features); - XCTAssertEqual(shapes.count, 1, @"All features should be converted into shapes"); + XCTAssertEqual(shapes.count, 1UL, @"All features should be converted into shapes"); MGLShape <MGLFeature> *shape = shapes.firstObject; XCTAssertTrue([shape conformsToProtocol:@protocol(MGLFeature)]); diff --git a/platform/darwin/test/MGLGeometryTests.mm b/platform/darwin/test/MGLGeometryTests.mm index 1489fefea9..e3b1836e8d 100644 --- a/platform/darwin/test/MGLGeometryTests.mm +++ b/platform/darwin/test/MGLGeometryTests.mm @@ -106,7 +106,7 @@ XCTAssertNil(error, @"Valid GeoJSON data should produce no error on deserialization."); XCTAssertNotNil(feature, @"Valid GeoJSON data should produce an object on deserialization."); XCTAssertTrue([feature isKindOfClass:[MGLPointFeature class]], @"Valid GeoJSON point feature data should produce an MGLPointFeature."); - XCTAssertEqual(feature.attributes.count, 0); + XCTAssertEqual(feature.attributes.count, 0UL); XCTAssertEqual(feature.coordinate.latitude, 0); XCTAssertEqual(feature.coordinate.longitude, 0); diff --git a/platform/darwin/test/MGLOfflineStorageTests.mm b/platform/darwin/test/MGLOfflineStorageTests.mm index d7c592d668..775197b390 100644 --- a/platform/darwin/test/MGLOfflineStorageTests.mm +++ b/platform/darwin/test/MGLOfflineStorageTests.mm @@ -248,7 +248,7 @@ } - (void)testCountOfBytesCompleted { - XCTAssertGreaterThan([MGLOfflineStorage sharedOfflineStorage].countOfBytesCompleted, 0); + XCTAssertGreaterThan([MGLOfflineStorage sharedOfflineStorage].countOfBytesCompleted, 0UL); } - (NSURL *)offlineStorage:(MGLOfflineStorage *)storage diff --git a/platform/darwin/test/MGLShapeSourceTests.mm b/platform/darwin/test/MGLShapeSourceTests.mm index c4f791f958..3459fb1733 100644 --- a/platform/darwin/test/MGLShapeSourceTests.mm +++ b/platform/darwin/test/MGLShapeSourceTests.mm @@ -65,7 +65,7 @@ MGLShapeCollection *collection = (MGLShapeCollection *)source.shape; XCTAssertNotNil(collection); - XCTAssertEqual(collection.shapes.count, 1); + XCTAssertEqual(collection.shapes.count, 1UL); XCTAssertTrue([collection.shapes.firstObject isMemberOfClass:[MGLPolylineFeature class]]); } @@ -294,7 +294,7 @@ MGLShapeCollectionFeature *shape = (MGLShapeCollectionFeature *)source.shape; XCTAssertTrue([shape isKindOfClass:[MGLShapeCollectionFeature class]]); - XCTAssertEqual(shape.shapes.count, 1, @"Shape collection should contain 1 shape"); + XCTAssertEqual(shape.shapes.count, 1UL, @"Shape collection should contain 1 shape"); // when a shape is included in the features array MGLPolygon *polygon = [MGLPolygon polygonWithCoordinates:coordinates count:sizeof(coordinates)/sizeof(coordinates[0]) interiorPolygons:nil]; @@ -319,7 +319,7 @@ MGLShapeCollectionFeature *shape = (MGLShapeCollectionFeature *)source.shape; XCTAssertTrue([shape isKindOfClass:[MGLShapeCollection class]]); - XCTAssertEqual(shape.shapes.count, 1, @"Shape collection should contain 1 shape"); + XCTAssertEqual(shape.shapes.count, 1UL, @"Shape collection should contain 1 shape"); } @end diff --git a/platform/darwin/test/MGLStyleTests.mm b/platform/darwin/test/MGLStyleTests.mm index ce7e3036a1..7330477126 100644 --- a/platform/darwin/test/MGLStyleTests.mm +++ b/platform/darwin/test/MGLStyleTests.mm @@ -141,9 +141,9 @@ - (void)testSources { NSSet<MGLSource *> *initialSources = self.style.sources; if ([initialSources.anyObject.identifier isEqualToString:@"com.mapbox.annotations"]) { - XCTAssertEqual(self.style.sources.count, 1); + XCTAssertEqual(self.style.sources.count, 1UL); } else { - XCTAssertEqual(self.style.sources.count, 0); + XCTAssertEqual(self.style.sources.count, 0UL); } MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; [self.style addSource:shapeSource]; @@ -251,9 +251,9 @@ - (void)testLayers { NSArray<MGLStyleLayer *> *initialLayers = self.style.layers; if ([initialLayers.firstObject.identifier isEqualToString:@"com.mapbox.annotations.points"]) { - XCTAssertEqual(self.style.layers.count, 1); + XCTAssertEqual(self.style.layers.count, 1UL); } else { - XCTAssertEqual(self.style.layers.count, 0); + XCTAssertEqual(self.style.layers.count, 0UL); } MGLShapeSource *shapeSource = [[MGLShapeSource alloc] initWithIdentifier:@"shapeSource" shape:nil options:nil]; [self.style addSource:shapeSource]; diff --git a/platform/darwin/test/MGLTileSetTests.mm b/platform/darwin/test/MGLTileSetTests.mm index 2319f66447..998d4baee6 100644 --- a/platform/darwin/test/MGLTileSetTests.mm +++ b/platform/darwin/test/MGLTileSetTests.mm @@ -18,7 +18,7 @@ mbgl::Tileset tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, nil); // has the correct URL templates - XCTAssertEqual(tileSet.tiles.size(), 3); + XCTAssertEqual(tileSet.tiles.size(), 3UL); XCTAssertEqual(tileSet.tiles[0], "tile.1"); XCTAssertEqual(tileSet.tiles[1], "tile.2"); XCTAssertEqual(tileSet.tiles[2], "tile.3"); diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 6a3ab4da68..5b74ded15f 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -2590,7 +2590,7 @@ public: } // Compass - NSUInteger compassIndex = 0; + NSInteger compassIndex = 0; if (index == compassIndex) { return self.compassView; @@ -2666,7 +2666,7 @@ public: } // Attribution button - NSUInteger attributionButtonIndex = NSMaxRange(visibleRoadFeatureRange); + NSInteger attributionButtonIndex = NSMaxRange(visibleRoadFeatureRange); if (index == attributionButtonIndex) { return self.attributionButton; diff --git a/platform/ios/src/MGLScaleBar.mm b/platform/ios/src/MGLScaleBar.mm index d69fb3e852..f17d7b7ad2 100644 --- a/platform/ios/src/MGLScaleBar.mm +++ b/platform/ios/src/MGLScaleBar.mm @@ -358,7 +358,7 @@ static const CGFloat MGLFeetPerMeter = 3.28084; - (void)updateLabels { NSEnumerator<UIView*> *viewEnumerator = [self.labelViews objectEnumerator]; - NSInteger i = 0; + NSUInteger i = 0; CLLocationDistance multiplier = (self.row.distance / self.row.numberOfBars); if (![self usesMetricSystem]) { diff --git a/platform/macos/app/MapDocument.m b/platform/macos/app/MapDocument.m index 7e537a31c7..d2bc7e9bfc 100644 --- a/platform/macos/app/MapDocument.m +++ b/platform/macos/app/MapDocument.m @@ -1324,7 +1324,7 @@ NSArray<id <MGLAnnotation>> *MBXFlattenedShapes(NSArray<id <MGLAnnotation>> *sha } if (action == @selector(showStyle:)) { NSPopUpButton *popUpButton = (NSPopUpButton *)toolbarItem.view; - NSUInteger index = self.indexOfStyleInToolbarItem; + NSInteger index = self.indexOfStyleInToolbarItem; if (index == NSNotFound) { index = -1; } |