summaryrefslogtreecommitdiff
path: root/platform/darwin
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2018-11-19 18:51:28 -0500
committerJason Wray <jason@mapbox.com>2018-11-20 11:48:18 -0500
commit83ecb765629ddbbe59998178acbb2f3db6db213a (patch)
treedde9c336f6d432250843bbedd676a643c7d4d4a6 /platform/darwin
parent00d0864441f94104806a7459fb814318f104c14b (diff)
downloadqtlocation-mapboxgl-83ecb765629ddbbe59998178acbb2f3db6db213a.tar.gz
[darwin] Fix GCC_WARN_SIGN_COMPARE warnings
Diffstat (limited to 'platform/darwin')
-rw-r--r--platform/darwin/src/MGLPointCollection.mm2
-rw-r--r--platform/darwin/src/MGLPolygon.mm2
-rw-r--r--platform/darwin/test/MGLFeatureTests.mm12
-rw-r--r--platform/darwin/test/MGLGeometryTests.mm2
-rw-r--r--platform/darwin/test/MGLOfflineStorageTests.mm2
-rw-r--r--platform/darwin/test/MGLShapeSourceTests.mm6
-rw-r--r--platform/darwin/test/MGLStyleTests.mm8
-rw-r--r--platform/darwin/test/MGLTileSetTests.mm2
8 files changed, 18 insertions, 18 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");