diff options
author | Maxim Pimenov <m@maps.me> | 2019-04-15 17:47:05 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-04-15 21:01:06 +0300 |
commit | 1d0428d056aa2e6b0024f991991f5c513cff9f73 (patch) | |
tree | cff44256529314ec8fcc9ea22fab87520a76e33a /platform | |
parent | 25087ac0bf7e8c41e0d0684e43b5285a8b8be47c (diff) |
Several explicit constructors per the Cppcheck report.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/mwm_traits.hpp | 2 | ||||
-rw-r--r-- | platform/platform_android.cpp | 15 | ||||
-rw-r--r-- | platform/platform_tests/measurement_tests.cpp | 2 | ||||
-rw-r--r-- | platform/platform_tests_support/scoped_mwm.hpp | 2 | ||||
-rw-r--r-- | platform/string_storage_base.hpp | 2 |
5 files changed, 13 insertions, 10 deletions
diff --git a/platform/mwm_traits.hpp b/platform/mwm_traits.hpp index 9d2efaf9e4..2390efabbc 100644 --- a/platform/mwm_traits.hpp +++ b/platform/mwm_traits.hpp @@ -41,7 +41,7 @@ public: Unknown }; - MwmTraits(MwmVersion const & version); + explicit MwmTraits(MwmVersion const & version); SearchIndexFormat GetSearchIndexFormat() const; diff --git a/platform/platform_android.cpp b/platform/platform_android.cpp index 5fcc623e54..cb9629ad4a 100644 --- a/platform/platform_android.cpp +++ b/platform/platform_android.cpp @@ -82,19 +82,22 @@ size_t GetSearchSources(string const & file, string const & searchScope, #ifdef DEBUG class DbgLogger { - string const & m_file; - SourceT m_src; public: - DbgLogger(string const & file) : m_file(file) {} - void SetSource(SourceT src) { m_src = src; } + explicit DbgLogger(string const & file) : m_file(file) {} + ~DbgLogger() { LOG(LDEBUG, ("Source for file", m_file, "is", m_src)); } + + void SetSource(SourceT src) { m_src = src; } + +private: + string const & m_file; + SourceT m_src; }; #endif - -} +} // namespace unique_ptr<ModelReader> Platform::GetReader(string const & file, string const & searchScope) const { diff --git a/platform/platform_tests/measurement_tests.cpp b/platform/platform_tests/measurement_tests.cpp index ea7a1938be..e616222969 100644 --- a/platform/platform_tests/measurement_tests.cpp +++ b/platform/platform_tests/measurement_tests.cpp @@ -15,7 +15,7 @@ struct ScopedSettings ScopedSettings() { m_wasSet = Get(kMeasurementUnits, m_oldUnits); } /// Saves/restores previous units and sets new units for a scope. - ScopedSettings(Units newUnits) : ScopedSettings() + explicit ScopedSettings(Units newUnits) : ScopedSettings() { Set(kMeasurementUnits, newUnits); } diff --git a/platform/platform_tests_support/scoped_mwm.hpp b/platform/platform_tests_support/scoped_mwm.hpp index 6f762806c1..e565555dd0 100644 --- a/platform/platform_tests_support/scoped_mwm.hpp +++ b/platform/platform_tests_support/scoped_mwm.hpp @@ -15,7 +15,7 @@ class ScopedFile; class ScopedMwm { public: - ScopedMwm(string const & relativePath); + explicit ScopedMwm(string const & relativePath); string const & GetFullPath() const { return m_file.GetFullPath(); } diff --git a/platform/string_storage_base.hpp b/platform/string_storage_base.hpp index ddb7de9831..9c2ae8282b 100644 --- a/platform/string_storage_base.hpp +++ b/platform/string_storage_base.hpp @@ -9,7 +9,7 @@ namespace platform class StringStorageBase { public: - StringStorageBase(std::string const & path); + explicit StringStorageBase(std::string const & path); void Save() const; void Clear(); bool GetValue(std::string const & key, std::string & outValue) const; |