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 /local_ads | |
parent | 06978f4585c463e97db42f96e7140616061939c3 (diff) |
Fixed some warnings.
Diffstat (limited to 'local_ads')
-rw-r--r-- | local_ads/file_helpers.cpp | 8 | ||||
-rw-r--r-- | local_ads/file_helpers.hpp | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/local_ads/file_helpers.cpp b/local_ads/file_helpers.cpp index baa8a926fe..d84d302099 100644 --- a/local_ads/file_helpers.cpp +++ b/local_ads/file_helpers.cpp @@ -6,6 +6,8 @@ #include "base/assert.hpp" +#include <cstddef> + namespace local_ads { void WriteCountryName(FileWriter & writer, std::string const & countryName) @@ -22,7 +24,7 @@ void WriteZigZag(FileWriter & writer, int64_t duration) void WriteRawData(FileWriter & writer, std::vector<uint8_t> const & rawData) { - uint64_t const size = static_cast<uint64_t>(rawData.size()); + auto const size = static_cast<size_t>(rawData.size()); WriteToSink(writer, size); writer.Write(rawData.data(), size); } @@ -43,9 +45,9 @@ int64_t ReadZigZag(ReaderSource<FileReader> & src) std::vector<uint8_t> ReadRawData(ReaderSource<FileReader> & src) { uint64_t const size = ReadPrimitiveFromSource<uint64_t>(src); - if (src.Size() < size) + if (static_cast<uint64_t>(src.Size()) < size) MYTHROW(Reader::SizeException, (src.Pos(), size)); - std::vector<uint8_t> bytes(size); + std::vector<uint8_t> bytes(static_cast<size_t>(size)); src.Read(bytes.data(), bytes.size()); return bytes; } diff --git a/local_ads/file_helpers.hpp b/local_ads/file_helpers.hpp index 9078e9e36d..35e9bbca34 100644 --- a/local_ads/file_helpers.hpp +++ b/local_ads/file_helpers.hpp @@ -6,6 +6,7 @@ #include "coding/file_writer.hpp" #include <chrono> +#include <cstdint> #include <string> #include <vector> |