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; diff --git a/platform/http_client_apple.mm b/platform/http_client_apple.mm index 2157776b3c..7c366dafa0 100644 --- a/platform/http_client_apple.mm +++ b/platform/http_client_apple.mm @@ -55,12 +55,12 @@ static const double kTimeoutInSeconds = 24.0; bool HttpClient::RunHttpRequest() { NSMutableURLRequest * request = [NSMutableURLRequest requestWithURL: - [NSURL URLWithString:[NSString stringWithUTF8String:m_urlRequested.c_str()]] + static_cast([NSURL URLWithString:@(m_urlRequested.c_str())]) cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:kTimeoutInSeconds]; // We handle cookies manually. request.HTTPShouldHandleCookies = NO; - request.HTTPMethod = [NSString stringWithUTF8String:m_httpMethod.c_str()]; + request.HTTPMethod = @(m_httpMethod.c_str()); for (auto const & header : m_headers) { [request setValue:@(header.second.c_str()) forHTTPHeaderField:@(header.first.c_str())]; @@ -125,7 +125,7 @@ bool HttpClient::RunHttpRequest() if (m_outputFile.empty()) m_serverResponse.assign(reinterpret_cast(url_data.bytes), url_data.length); else - [url_data writeToFile:[NSString stringWithUTF8String:m_outputFile.c_str()] atomically:YES]; + [url_data writeToFile:@(m_outputFile.c_str()) atomically:YES]; } diff --git a/platform/http_thread_apple.mm b/platform/http_thread_apple.mm index 423b35db91..5f617f8a8c 100644 --- a/platform/http_thread_apple.mm +++ b/platform/http_thread_apple.mm @@ -46,7 +46,7 @@ static id downloadIndicator = nil; m_expectedSize = size; NSMutableURLRequest * request = [NSMutableURLRequest requestWithURL: - [NSURL URLWithString:[NSString stringWithUTF8String:url.c_str()]] + static_cast([NSURL URLWithString:@(url.c_str())]) cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:TIMEOUT_IN_SECONDS]; // use Range header only if we don't download whole file from start @@ -77,7 +77,7 @@ static id downloadIndicator = nil; if (url.find("mapswithme.com") != string::npos) { static string const uid = GetPlatform().UniqueClientId(); - [request addValue:[NSString stringWithUTF8String: uid.c_str()] forHTTPHeaderField:@"User-Agent"]; + [request addValue:@(uid.c_str()) forHTTPHeaderField:@"User-Agent"]; } #ifdef OMIM_OS_IPHONE