From 1caaa1561e86f70784dace7d28610914c0058460 Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Wed, 11 Jan 2017 17:47:48 +0300 Subject: [PATCH] Fix warnings --- indexer/data_header.hpp | 2 +- indexer/feature_altitude.hpp | 4 ++-- indexer/feature_data.cpp | 2 +- indexer/feature_data.hpp | 2 +- platform/apple_location_service.mm | 8 ++----- platform/platform_ios.mm | 37 ------------------------------ platform/socket.hpp | 8 +++---- 7 files changed, 11 insertions(+), 52 deletions(-) diff --git a/indexer/data_header.hpp b/indexer/data_header.hpp index e78d8e9ae0..42e751ded7 100644 --- a/indexer/data_header.hpp +++ b/indexer/data_header.hpp @@ -62,7 +62,7 @@ namespace feature } inline size_t GetScalesCount() const { return m_scales.size(); } - inline int GetScale(int i) const { return static_cast(m_scales[i]); } + inline int GetScale(size_t i) const { return static_cast(m_scales[i]); } inline int GetLastScale() const { return m_scales.back(); } pair GetScaleRange() const; diff --git a/indexer/feature_altitude.hpp b/indexer/feature_altitude.hpp index 41f1f3a7da..580fa9bb12 100644 --- a/indexer/feature_altitude.hpp +++ b/indexer/feature_altitude.hpp @@ -111,7 +111,7 @@ public: for (size_t i = 0; i < pointCount; ++i) { - uint32_t const biasedDelta = coding::DeltaCoder::Decode(bits); + uint64_t const biasedDelta = coding::DeltaCoder::Decode(bits); if (biasedDelta == 0) { LOG(LERROR, ("Decoded altitude delta is zero. File", countryFileName, @@ -119,7 +119,7 @@ public: m_altitudes.clear(); return false; } - uint32_t const delta = biasedDelta - 1; + uint64_t const delta = biasedDelta - 1; m_altitudes[i] = static_cast(bits::ZigZagDecode(delta) + prevAltitude); if (m_altitudes[i] < minAltitude) diff --git a/indexer/feature_data.cpp b/indexer/feature_data.cpp index be07177331..2be9cf0d62 100644 --- a/indexer/feature_data.cpp +++ b/indexer/feature_data.cpp @@ -129,7 +129,7 @@ public: namespace feature { -uint8_t CalculateHeader(uint32_t const typesCount, uint8_t const headerGeomType, +uint8_t CalculateHeader(size_t const typesCount, uint8_t const headerGeomType, FeatureParamsBase const & params) { ASSERT(typesCount != 0, ("Feature should have at least one type.")); diff --git a/indexer/feature_data.hpp b/indexer/feature_data.hpp index 3aae88d45d..36c4260c5d 100644 --- a/indexer/feature_data.hpp +++ b/indexer/feature_data.hpp @@ -122,7 +122,7 @@ namespace feature string DebugPrint(TypesHolder const & holder); - uint8_t CalculateHeader(uint32_t const typesCount, uint8_t const headerGeomType, + uint8_t CalculateHeader(size_t const typesCount, uint8_t const headerGeomType, FeatureParamsBase const & params); } // namespace feature diff --git a/platform/apple_location_service.mm b/platform/apple_location_service.mm index 0ec2ae0dc8..cb7da3a328 100644 --- a/platform/apple_location_service.mm +++ b/platform/apple_location_service.mm @@ -86,20 +86,16 @@ public: } - (void)locationManager:(CLLocationManager *)manager - didUpdateToLocation:(CLLocation *)newLocation - fromLocation:(CLLocation *)oldLocation + didUpdateLocations:(NSArray *)locations { - UNUSED_VALUE(manager); - UNUSED_VALUE(oldLocation); GpsInfo newInfo; - [LocationManagerWrapper location:newLocation toGpsInfo:newInfo]; + [LocationManagerWrapper location:locations.firstObject toGpsInfo:newInfo]; m_service->OnLocationUpdate(newInfo); } - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { - UNUSED_VALUE(manager); LOG(LWARNING, ("locationManager failed with error", error.code, [error.description UTF8String])); if (error.code == kCLErrorDenied) diff --git a/platform/platform_ios.mm b/platform/platform_ios.mm index 16cc552627..5d617f3483 100644 --- a/platform/platform_ios.mm +++ b/platform/platform_ios.mm @@ -17,10 +17,6 @@ #include #include -#if !defined(IFT_ETHER) -#define IFT_ETHER 0x6 /* Ethernet CSMACD */ -#endif - #import "iphone/Maps/Common/MWMCommon.h" #import "3party/Alohalytics/src/alohalytics_objc.h" @@ -99,39 +95,6 @@ unique_ptr Platform::GetReader(string const & file, string const & int Platform::VideoMemoryLimit() const { return 8 * 1024 * 1024; } int Platform::PreCachingDepth() const { return 2; } -static string GetDeviceUid() -{ - NSString * uid = @""; - UIDevice * device = [UIDevice currentDevice]; - if (device.systemVersion.floatValue >= 6.0 && device.identifierForVendor) - uid = [device.identifierForVendor UUIDString]; - return [uid UTF8String]; -} - -static string GetMacAddress() -{ - string result; - // get wifi mac addr - ifaddrs * addresses = NULL; - if (getifaddrs(&addresses) == 0 && addresses != NULL) - { - ifaddrs * currentAddr = addresses; - do - { - if (currentAddr->ifa_addr->sa_family == AF_LINK && - ((const struct sockaddr_dl *)currentAddr->ifa_addr)->sdl_type == IFT_ETHER) - { - const struct sockaddr_dl * dlAddr = (const struct sockaddr_dl *)currentAddr->ifa_addr; - const char * base = &dlAddr->sdl_data[dlAddr->sdl_nlen]; - result.assign(base, dlAddr->sdl_alen); - break; - } - currentAddr = currentAddr->ifa_next; - } while (currentAddr->ifa_next); - freeifaddrs(addresses); - } - return result; -} string Platform::UniqueClientId() const { return [Alohalytics installationId].UTF8String; } static void PerformImpl(void * obj) diff --git a/platform/socket.hpp b/platform/socket.hpp index ab955523d2..7d6bc55572 100644 --- a/platform/socket.hpp +++ b/platform/socket.hpp @@ -30,11 +30,11 @@ class StubSocket final : public Socket { public: // Socket overrides: - bool Open(string const & host, uint16_t port) override { return false; } + bool Open(string const &, uint16_t) override { return false; } void Close() override {} - bool Read(uint8_t * data, uint32_t count) override { return false; } - bool Write(uint8_t const * data, uint32_t count) override { return false; } - void SetTimeout(uint32_t milliseconds) override {} + bool Read(uint8_t *, uint32_t) override { return false; } + bool Write(uint8_t const *, uint32_t) override { return false; } + void SetTimeout(uint32_t) override {} }; unique_ptr CreateSocket();