summaryrefslogtreecommitdiff
path: root/platform/darwin
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2017-01-11 03:08:05 -0800
committerGitHub <noreply@github.com>2017-01-11 03:08:05 -0800
commit581fb3849da8ce97e557bb3633b886fcc369f6cb (patch)
tree503b3a3657d59218c40712c853640032c51da169 /platform/darwin
parentb6cf87f5e763ec6849e4fe34f2dd20fc8a0d0d52 (diff)
downloadqtlocation-mapboxgl-581fb3849da8ce97e557bb3633b886fcc369f6cb.tar.gz
[ios, macos] Fix miscellaneous static analyzer warnings (#7670)
* [ios, macos] Fixed static analyzer warnings Fixed static analyzer warnings in MGLNetworkConfiguration, MGLRasterSource, and MGLShape. * [ios] Fixed static analyzer warnings Fixed static analyzer warnings in MGLAnnotationImage. * [macos] Fixed static analyzer warnings Fixed static analyzer warnings in MGLAnnotationImage and NSImage(MGLAdditions). * [ios, macos] Two pointer-equal images are object-equal by definition
Diffstat (limited to 'platform/darwin')
-rw-r--r--platform/darwin/src/MGLNetworkConfiguration.m4
-rw-r--r--platform/darwin/src/MGLRasterSource.mm2
-rw-r--r--platform/darwin/src/MGLShape.mm4
3 files changed, 2 insertions, 8 deletions
diff --git a/platform/darwin/src/MGLNetworkConfiguration.m b/platform/darwin/src/MGLNetworkConfiguration.m
index d661d9090e..82d333dc99 100644
--- a/platform/darwin/src/MGLNetworkConfiguration.m
+++ b/platform/darwin/src/MGLNetworkConfiguration.m
@@ -1,5 +1,4 @@
#import "MGLNetworkConfiguration.h"
-#import "NSProcessInfo+MGLAdditions.h"
@implementation MGLNetworkConfiguration
@@ -12,9 +11,6 @@
}
+ (instancetype)sharedManager {
- if (NSProcessInfo.processInfo.mgl_isInterfaceBuilderDesignablesAgent) {
- return nil;
- }
static dispatch_once_t onceToken;
static MGLNetworkConfiguration *_sharedManager;
void (^setupBlock)() = ^{
diff --git a/platform/darwin/src/MGLRasterSource.mm b/platform/darwin/src/MGLRasterSource.mm
index dbcba85d91..b52b4e3eed 100644
--- a/platform/darwin/src/MGLRasterSource.mm
+++ b/platform/darwin/src/MGLRasterSource.mm
@@ -51,7 +51,7 @@ static const CGFloat MGLRasterSourceRetinaTileSize = 512;
if (self = [super initWithIdentifier:identifier tileURLTemplates:tileURLTemplates options:options]) {
mbgl::Tileset tileSet = MGLTileSetFromTileURLTemplates(tileURLTemplates, options);
- uint16_t tileSize;
+ uint16_t tileSize = MGLRasterSourceRetinaTileSize;
if (NSNumber *tileSizeNumber = options[MGLTileSourceOptionTileSize]) {
if (![tileSizeNumber isKindOfClass:[NSNumber class]]) {
[NSException raise:NSInvalidArgumentException
diff --git a/platform/darwin/src/MGLShape.mm b/platform/darwin/src/MGLShape.mm
index 4ddf7c9df7..984235fd97 100644
--- a/platform/darwin/src/MGLShape.mm
+++ b/platform/darwin/src/MGLShape.mm
@@ -94,9 +94,7 @@ bool operator==(const CLLocationCoordinate2D lhs, const CLLocationCoordinate2D r
- (NSUInteger)hash
{
- NSUInteger hash;
- hash += _title.hash;
- hash += _subtitle.hash;
+ NSUInteger hash = _title.hash + _subtitle.hash;
#if !TARGET_OS_IPHONE
hash += _toolTip.hash;
#endif