diff options
author | Sergey Yershov <syershov@maps.me> | 2016-12-19 18:57:30 +0300 |
---|---|---|
committer | Sergey Yershov <syershov@maps.me> | 2016-12-20 13:54:08 +0300 |
commit | 07cf333622995e81f4dffc7a8efef999c1395936 (patch) | |
tree | fb06b3d255665fac5e7778bae6896d9b1a0a263b /coding | |
parent | 6aaa267d7286eaf746a94c3ba62f9231b7ffcfeb (diff) |
Fix warnings in coding
Diffstat (limited to 'coding')
-rw-r--r-- | coding/huffman.hpp | 8 | ||||
-rw-r--r-- | coding/zlib.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/coding/huffman.hpp b/coding/huffman.hpp index dfe2882614..a59b24a195 100644 --- a/coding/huffman.hpp +++ b/coding/huffman.hpp @@ -21,10 +21,10 @@ public: struct Code { uint32_t bits; - uint32_t len; + size_t len; Code() : bits(0), len(0) {} - Code(uint32_t bits, uint32_t len) : bits(bits), len(len) {} + Code(uint32_t bits, size_t len) : bits(bits), len(len) {} bool operator<(const Code & o) const { @@ -134,7 +134,7 @@ private: Node *l, *r; uint32_t symbol; uint32_t freq; - uint32_t depth; + size_t depth; bool isLeaf; Node(uint32_t symbol, uint32_t freq, bool isLeaf) @@ -156,7 +156,7 @@ private: // No need to clump the interface: keep private the methods // that encode one symbol only. template <typename TWriter> - uint32_t EncodeAndWrite(BitWriter<TWriter> & bitWriter, uint32_t symbol) const + size_t EncodeAndWrite(BitWriter<TWriter> & bitWriter, uint32_t symbol) const { Code code; CHECK(Encode(symbol, code), ()); diff --git a/coding/zlib.cpp b/coding/zlib.cpp index e1646d2f91..f54cc574b4 100644 --- a/coding/zlib.cpp +++ b/coding/zlib.cpp @@ -25,7 +25,7 @@ ZLib::Processor::Processor(void const * data, size_t size) noexcept : m_init(fal // zconf.h. So, for portability, const_cast<...> is used here, but // in any case, zlib does not modify |data|. m_stream.next_in = static_cast<unsigned char *>(const_cast<void *>(data)); - m_stream.avail_in = size; + m_stream.avail_in = static_cast<unsigned int>(size); m_stream.next_out = m_buffer; m_stream.avail_out = kBufferSize; |