diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2016-04-12 14:30:29 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-04-12 19:08:01 +0300 |
commit | 6c5558135822c31c9ac4cde7dbfbc7c277e391e1 (patch) | |
tree | 9faeff0fa288d7f2ccdc7081d9ce9d4dd9264684 /platform | |
parent | ad4d681fa5514a9e16d84a3b889491d19d36ea2b (diff) |
Fix using different types
Diffstat (limited to 'platform')
-rw-r--r-- | platform/country_defines.hpp | 5 | ||||
-rw-r--r-- | platform/country_file.cpp | 4 | ||||
-rw-r--r-- | platform/country_file.hpp | 8 |
3 files changed, 11 insertions, 6 deletions
diff --git a/platform/country_defines.hpp b/platform/country_defines.hpp index d2f46dd409..c59d63759b 100644 --- a/platform/country_defines.hpp +++ b/platform/country_defines.hpp @@ -1,6 +1,7 @@ #pragma once #include "std/string.hpp" +#include "std/utility.hpp" enum class MapOptions : uint8_t { @@ -10,6 +11,10 @@ enum class MapOptions : uint8_t MapWithCarRouting = 0x3 }; +using TMwmCounter = uint32_t; +using TMwmSize = uint64_t; +using TLocalAndRemoteSize = pair<TMwmSize, TMwmSize>; + bool HasOptions(MapOptions mask, MapOptions options); MapOptions IntersectOptions(MapOptions lhs, MapOptions rhs); diff --git a/platform/country_file.cpp b/platform/country_file.cpp index f2de49ba75..f013ba92b8 100644 --- a/platform/country_file.cpp +++ b/platform/country_file.cpp @@ -35,13 +35,13 @@ CountryFile::CountryFile(string const & name) : m_name(name), m_mapSize(0), m_ro string const & CountryFile::GetName() const { return m_name; } -void CountryFile::SetRemoteSizes(uint32_t mapSize, uint32_t routingSize) +void CountryFile::SetRemoteSizes(TMwmSize mapSize, TMwmSize routingSize) { m_mapSize = mapSize; m_routingSize = routingSize; } -uint32_t CountryFile::GetRemoteSize(MapOptions filesMask) const +TMwmSize CountryFile::GetRemoteSize(MapOptions filesMask) const { uint32_t size = 0; if (HasOptions(filesMask, MapOptions::Map)) diff --git a/platform/country_file.hpp b/platform/country_file.hpp index eb5c622cff..06a3286155 100644 --- a/platform/country_file.hpp +++ b/platform/country_file.hpp @@ -20,8 +20,8 @@ public: string const & GetName() const; /// \note Remote size is size of mwm in bytes. This mwm contains routing and map sections. - void SetRemoteSizes(uint32_t mapSize, uint32_t routingSize); - uint32_t GetRemoteSize(MapOptions file) const; + void SetRemoteSizes(TMwmSize mapSize, TMwmSize routingSize); + TMwmSize GetRemoteSize(MapOptions file) const; inline bool operator<(const CountryFile & rhs) const { return m_name < rhs.m_name; } inline bool operator==(const CountryFile & rhs) const { return m_name == rhs.m_name; } @@ -32,8 +32,8 @@ private: /// Base name (without any extensions) of the file. Same as id of country/region. string m_name; - uint32_t m_mapSize; - uint32_t m_routingSize; + TMwmSize m_mapSize; + TMwmSize m_routingSize; }; /// \returns This method returns file name with extension. For example Abkhazia.mwm or |