diff options
author | Maksim Andrianov <maksimandrianov1@gmail.com> | 2019-05-24 18:23:54 +0300 |
---|---|---|
committer | Roman Kuznetsov <r.kuznetsow@gmail.com> | 2019-05-28 17:12:27 +0300 |
commit | e2d0d658a527eaa3a9b267d55e6b817f5ef5b518 (patch) | |
tree | 5b6bd8e2be77782371c9af22af38aa0a86bc057e /map | |
parent | 142e4ada6d750ed17301e84311fcbcfc7ac97e9b (diff) |
Fixed warnings for gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
Diffstat (limited to 'map')
-rw-r--r-- | map/framework.cpp | 29 | ||||
-rw-r--r-- | map/notifications/notification_queue.hpp | 3 | ||||
-rw-r--r-- | map/power_management/power_management_schemas.cpp | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index fad48d2e53..edcf2828f2 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -1528,7 +1528,7 @@ void Framework::InitUGC() }); bool ugcStorageValidationExecuted = false; - UNUSED_VALUE(settings::Get("WasUgcStorageValidationExecuted", ugcStorageValidationExecuted)); + settings::TryGet("WasUgcStorageValidationExecuted", ugcStorageValidationExecuted); if (!ugcStorageValidationExecuted) { @@ -1711,19 +1711,16 @@ size_t Framework::ShowSearchResults(search::Results const & results) using namespace search; size_t count = results.GetCount(); - switch (count) + if (count == 0) + return 0; + + if (count == 1) { - case 1: - { - Result const & r = results[0]; - if (!r.IsSuggest()) - ShowSearchResult(r); - else - count = 0; - // do not put break here - } - case 0: - return count; + Result const & r = results[0]; + if (!r.IsSuggest()) + ShowSearchResult(r); + else + return 0; } FillSearchResultsMarks(true /* clear */, results); @@ -2592,7 +2589,7 @@ UserMark const * Framework::FindUserMarkInTapPosition(df::TapInfo const & tapInf return tapInfo.GetRoutingPointSearchRect(m_currentModelView); return tapInfo.GetDefaultSearchRect(m_currentModelView); }, - [](UserMark::Type type) { return false; }); + [](UserMark::Type) { return false; }); return mark; } @@ -3066,7 +3063,7 @@ bool Framework::ParseEditorDebugCommand(search::SearchParams const & params) return false; } -bool Framework::ParseRoutingDebugCommand(search::SearchParams const & params) +bool Framework::ParseRoutingDebugCommand(search::SearchParams const &) { // This is an example. /* @@ -3625,7 +3622,7 @@ void Framework::ShowViewportSearchResults(search::Results::ConstIter begin, if (!id.IsValid()) return; - for (auto const filterResult : filtersResults) + for (auto const & filterResult : filtersResults) { auto const found = std::binary_search(filterResult.m_featuresSorted.cbegin(), filterResult.m_featuresSorted.cend(), id); diff --git a/map/notifications/notification_queue.hpp b/map/notifications/notification_queue.hpp index e4715bb9bd..9ca41740b5 100644 --- a/map/notifications/notification_queue.hpp +++ b/map/notifications/notification_queue.hpp @@ -75,7 +75,7 @@ struct QueueV0 static Version GetVersion() { return Version::V0; } DECLARE_VISITOR(visitor(m_candidates, "queue"), - visitor(m_lastNotificationProvidedTime, "last_notification")); + visitor(m_lastNotificationProvidedTime, "last_notification")) Time m_lastNotificationProvidedTime; Candidates m_candidates; @@ -90,5 +90,6 @@ inline std::string DebugPrint(NotificationCandidate::Type type) case NotificationCandidate::Type::UgcAuth: return "UgcAuth"; case NotificationCandidate::Type::UgcReview: return "UgcReview"; } + UNREACHABLE(); } } // namespace notifications diff --git a/map/power_management/power_management_schemas.cpp b/map/power_management/power_management_schemas.cpp index f050247cf6..3560f9ac7b 100644 --- a/map/power_management/power_management_schemas.cpp +++ b/map/power_management/power_management_schemas.cpp @@ -104,6 +104,7 @@ std::string DebugPrint(Facility const facility) case Facility::AdsDownloading: return "AdsDownloading"; case Facility::Count: return "Count"; } + UNREACHABLE(); } std::string DebugPrint(Scheme const scheme) @@ -116,5 +117,6 @@ std::string DebugPrint(Scheme const scheme) case Scheme::EconomyMaximum: return "EconomyMaximum"; case Scheme::Auto: return "Auto"; } + UNREACHABLE(); } } // namespace power_management |