From 07cf333622995e81f4dffc7a8efef999c1395936 Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Mon, 19 Dec 2016 18:57:30 +0300 Subject: [PATCH] Fix warnings in coding --- coding/huffman.hpp | 8 ++++---- 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 - uint32_t EncodeAndWrite(BitWriter & bitWriter, uint32_t symbol) const + size_t EncodeAndWrite(BitWriter & 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(const_cast(data)); - m_stream.avail_in = size; + m_stream.avail_in = static_cast(size); m_stream.next_out = m_buffer; m_stream.avail_out = kBufferSize;