diff options
author | Maxim Pimenov <m@maps.me> | 2019-05-14 20:17:52 +0300 |
---|---|---|
committer | Vladimir Byko-Ianko <bykoianko@gmail.com> | 2019-05-15 13:35:08 +0300 |
commit | c11c41d67738500b0d1eeea7170a775441578cae (patch) | |
tree | 0f888fdd6ec1cef7baa4e32cde00d6dd608461e2 /indexer | |
parent | 06978f4585c463e97db42f96e7140616061939c3 (diff) |
Fixed some warnings.
Diffstat (limited to 'indexer')
-rw-r--r-- | indexer/cities_boundaries_serdes.hpp | 8 | ||||
-rw-r--r-- | indexer/rank_table.cpp | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/indexer/cities_boundaries_serdes.hpp b/indexer/cities_boundaries_serdes.hpp index e3872932b5..7bbbdb7806 100644 --- a/indexer/cities_boundaries_serdes.hpp +++ b/indexer/cities_boundaries_serdes.hpp @@ -294,14 +294,16 @@ public: void operator()(std::vector<std::vector<CityBoundary>> & boundaries) { - auto const size = ReadVarUint<uint64_t>(m_source); - boundaries.resize(size); + { + auto const size = static_cast<size_t>(ReadVarUint<uint64_t>(m_source)); + boundaries.resize(size); + } { BitReader<Source> reader(m_source); for (auto & bs : boundaries) { - auto const size = coding::GammaCoder::Decode(reader); + auto const size = static_cast<size_t>(coding::GammaCoder::Decode(reader)); ASSERT_GREATER_OR_EQUAL(size, 1, ()); bs.resize(size - 1); } diff --git a/indexer/rank_table.cpp b/indexer/rank_table.cpp index 621fc02008..20ec49b9ba 100644 --- a/indexer/rank_table.cpp +++ b/indexer/rank_table.cpp @@ -69,7 +69,7 @@ unique_ptr<CopiedMemoryRegion> GetMemoryRegionForTag(FilesContainerR const & rco if (!rcont.IsExist(tag)) return unique_ptr<CopiedMemoryRegion>(); FilesContainerR::TReader reader = rcont.GetReader(tag); - vector<uint8_t> buffer(reader.Size()); + vector<uint8_t> buffer(static_cast<size_t>(reader.Size())); reader.Read(0, buffer.data(), buffer.size()); return make_unique<CopiedMemoryRegion>(move(buffer)); } @@ -126,7 +126,8 @@ public: if (!region.get()) return unique_ptr<RankTableV0>(); - auto const result = CheckEndianness(MemReader(region->ImmutableData(), region->Size())); + auto const result = + CheckEndianness(MemReader(region->ImmutableData(), static_cast<size_t>(region->Size()))); if (result != CheckResult::EndiannessMatch) return unique_ptr<RankTableV0>(); @@ -144,7 +145,8 @@ public: return unique_ptr<RankTableV0>(); unique_ptr<RankTableV0> table; - switch (CheckEndianness(MemReader(region->ImmutableData(), region->Size()))) + switch ( + CheckEndianness(MemReader(region->ImmutableData(), static_cast<size_t>(region->Size())))) { case CheckResult::CorruptedHeader: break; |