diff options
author | Maxim Pimenov <m@maps.me> | 2017-03-27 16:52:31 +0300 |
---|---|---|
committer | Maxim Pimenov <m@maps.me> | 2017-03-27 17:02:46 +0300 |
commit | 5c3f3080726b6e5551bea70f1470b5a52580edca (patch) | |
tree | 0c4f3fca0457923fe35efc82b76cd2a20246979a /search | |
parent | e6bbc3477d4836b2421f0b0d84c7b954b7f73e11 (diff) |
Fixed some warnings.
Diffstat (limited to 'search')
-rw-r--r-- | search/geocoder.cpp | 2 | ||||
-rw-r--r-- | search/hotels_filter.cpp | 4 | ||||
-rw-r--r-- | search/locality_scorer.cpp | 5 | ||||
-rw-r--r-- | search/retrieval.cpp | 10 |
4 files changed, 16 insertions, 5 deletions
diff --git a/search/geocoder.cpp b/search/geocoder.cpp index 71cc14c7e5..8e9ef25a3c 100644 --- a/search/geocoder.cpp +++ b/search/geocoder.cpp @@ -1007,7 +1007,7 @@ void Geocoder::MatchPOIsAndBuildings(BaseContext & ctx, size_t curToken) vector<uint32_t> features; m_postcodes.m_features.ForEach([&features](uint64_t bit) { - features.push_back(base::asserted_cast<uint32_t>(bit)); + features.push_back(base::asserted_cast<uint32_t>(bit)); }); layer.m_sortedFeatures = &features; return FindPaths(ctx); diff --git a/search/hotels_filter.cpp b/search/hotels_filter.cpp index b3fd8b9785..0499eb7e3d 100644 --- a/search/hotels_filter.cpp +++ b/search/hotels_filter.cpp @@ -5,6 +5,7 @@ #include "indexer/ftypes_matcher.hpp" #include "base/assert.hpp" +#include "base/checked_cast.hpp" #include "std/algorithm.hpp" @@ -111,7 +112,8 @@ HotelsFilter::Descriptions const & HotelsFilter::GetDescriptions(MwmContext cons auto const hotels = m_hotels.Get(context); auto & descriptions = m_descriptions[mwmId]; - hotels.ForEach([&descriptions, &context](uint32_t id) { + hotels.ForEach([&descriptions, &context](uint64_t bit) { + uint32_t const id = base::asserted_cast<uint32_t>(bit); FeatureType ft; Description description; diff --git a/search/locality_scorer.cpp b/search/locality_scorer.cpp index 45136622de..58f4442d51 100644 --- a/search/locality_scorer.cpp +++ b/search/locality_scorer.cpp @@ -4,6 +4,8 @@ #include "search/geocoder_context.hpp" #include "search/token_slice.hpp" +#include "base/checked_cast.hpp" + #include <algorithm> #include <sstream> #include <unordered_set> @@ -62,7 +64,8 @@ void LocalityScorer::GetTopLocalities(MwmSet::MwmId const & countryId, BaseConte // Skip locality candidates that match only numbers. if (!m_params.IsNumberTokens(tokenRange)) { - intersection.ForEach([&](uint32_t featureId) { + intersection.ForEach([&](uint64_t bit) { + uint32_t const featureId = base::asserted_cast<uint32_t>(bit); double const prob = static_cast<double>(intersection.PopCount()) / static_cast<double>(unfilteredIntersection.PopCount()); localities.emplace_back(countryId, featureId, tokenRange, prob); diff --git a/search/retrieval.cpp b/search/retrieval.cpp index 60354f721b..666f25cd27 100644 --- a/search/retrieval.cpp +++ b/search/retrieval.cpp @@ -25,6 +25,8 @@ #include "coding/compressed_bit_vector.hpp" #include "coding/reader_wrapper.hpp" +#include "base/checked_cast.hpp" + #include "std/algorithm.hpp" using namespace strings; @@ -224,7 +226,9 @@ unique_ptr<coding::CompressedBitVector> RetrieveAddressFeaturesImpl( WithSearchTrieRoot<Value>(context.m_value, [&](TrieRoot<Value> const & root) { MatchFeaturesInTrie( request, root, - [&holder](uint32_t featureIndex) { return !holder.ModifiedOrDeleted(featureIndex); }, + [&holder](uint64_t featureIndex) { + return !holder.ModifiedOrDeleted(base::asserted_cast<uint32_t>(featureIndex)); + }, collector); }); @@ -247,7 +251,9 @@ unique_ptr<coding::CompressedBitVector> RetrievePostcodeFeaturesImpl( WithSearchTrieRoot<Value>(context.m_value, [&](TrieRoot<Value> const & root) { MatchPostcodesInTrie( slice, root, - [&holder](uint32_t featureIndex) { return !holder.ModifiedOrDeleted(featureIndex); }, + [&holder](uint64_t featureIndex) { + return !holder.ModifiedOrDeleted(base::asserted_cast<uint32_t>(featureIndex)); + }, collector); }); holder.ForEachModifiedOrCreated([&](FeatureType & ft, uint64_t index) { |