From 948b70b5b56c5501786e47f5aa95f235f9af4be2 Mon Sep 17 00:00:00 2001 From: mobileben Date: Mon, 8 Oct 2018 19:41:23 -0700 Subject: [PATCH] Various fixes on #866 which broke building for iOS and Mac (#888) * Various fixes on #866 which broke building for iOS and Mac * Remove trailing semicolon from namespace since flags error when building on Ubuntu * Ubuntu builds needs to factor in unused arguments/variables * Remove trailing spaces from empty lines * Remove duplicate bind_impls. * Fix some merge fallout with master. --- Release/include/cpprest/http_headers.h | 3 +- Release/src/http/common/http_compression.cpp | 35 ++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Release/include/cpprest/http_headers.h b/Release/include/cpprest/http_headers.h index 3761940c8b..34f0122b3f 100644 --- a/Release/include/cpprest/http_headers.h +++ b/Release/include/cpprest/http_headers.h @@ -18,7 +18,6 @@ #include "cpprest/asyncrt_utils.h" namespace web { namespace http { - /// /// Binds an individual reference to a string value. /// @@ -250,7 +249,7 @@ class http_headers return false; } - return details::bind_impl(iter->second, value) || iter->second.empty(); + return web::http::details::bind_impl(iter->second, value) || iter->second.empty(); } /// diff --git a/Release/src/http/common/http_compression.cpp b/Release/src/http/common/http_compression.cpp index 7fc229642d..194f1efc97 100644 --- a/Release/src/http/common/http_compression.cpp +++ b/Release/src/http/common/http_compression.cpp @@ -156,7 +156,7 @@ class zlib_compressor_base : public compress_provider private: int m_state{Z_BUF_ERROR}; - z_stream m_stream{0}; + z_stream m_stream{}; const utility::string_t& m_algorithm; }; @@ -263,7 +263,7 @@ class zlib_decompressor_base : public decompress_provider private: int m_state{Z_BUF_ERROR}; - z_stream m_stream{0}; + z_stream m_stream{}; const utility::string_t& m_algorithm; }; @@ -283,7 +283,7 @@ class gzip_compressor : public zlib_compressor_base class gzip_decompressor : public zlib_decompressor_base { public: - gzip_decompressor::gzip_decompressor() : zlib_decompressor_base(16) // gzip auto-detect + gzip_decompressor() : zlib_decompressor_base(16) // gzip auto-detect { } }; @@ -634,14 +634,14 @@ class generic_decompress_factory : public decompress_factory static const std::vector> g_compress_factories #if defined(CPPREST_HTTP_COMPRESSION) = {std::make_shared( - algorithm::GZIP, []() -> std::unique_ptr { return std::make_unique(); }), + algorithm::GZIP, []() -> std::unique_ptr { return utility::details::make_unique(); }), std::make_shared( algorithm::DEFLATE, - []() -> std::unique_ptr { return std::make_unique(); }), + []() -> std::unique_ptr { return utility::details::make_unique(); }), #if defined(CPPREST_BROTLI_COMPRESSION) std::make_shared( algorithm::BROTLI, - []() -> std::unique_ptr { return std::make_unique(); }) + []() -> std::unique_ptr { return utility::details::make_unique(); }) #endif // CPPREST_BROTLI_COMPRESSION }; #else // CPPREST_HTTP_COMPRESSION @@ -653,16 +653,16 @@ static const std::vector> g_decompress_facto = {std::make_shared( algorithm::GZIP, 500, - []() -> std::unique_ptr { return std::make_unique(); }), + []() -> std::unique_ptr { return utility::details::make_unique(); }), std::make_shared( algorithm::DEFLATE, 500, - []() -> std::unique_ptr { return std::make_unique(); }), + []() -> std::unique_ptr { return utility::details::make_unique(); }), #if defined(CPPREST_BROTLI_COMPRESSION) std::make_shared( algorithm::BROTLI, 500, - []() -> std::unique_ptr { return std::make_unique(); }) + []() -> std::unique_ptr { return utility::details::make_unique(); }) #endif // CPPREST_BROTLI_COMPRESSION }; #else // CPPREST_HTTP_COMPRESSION @@ -748,10 +748,11 @@ std::shared_ptr get_decompress_factory(const utility::string return std::shared_ptr(); } + std::unique_ptr make_gzip_compressor(int compressionLevel, int method, int strategy, int memLevel) { #if defined(CPPREST_HTTP_COMPRESSION) - return std::move(std::make_unique(compressionLevel, method, strategy, memLevel)); + return utility::details::make_unique(compressionLevel, method, strategy, memLevel); #else // CPPREST_HTTP_COMPRESSION (void)compressionLevel; (void)method; @@ -760,11 +761,11 @@ std::unique_ptr make_gzip_compressor(int compressionLevel, in return std::unique_ptr(); #endif // CPPREST_HTTP_COMPRESSION } - + std::unique_ptr make_deflate_compressor(int compressionLevel, int method, int strategy, int memLevel) { #if defined(CPPREST_HTTP_COMPRESSION) - return std::move(std::make_unique(compressionLevel, method, strategy, memLevel)); + return utility::details::make_unique(compressionLevel, method, strategy, memLevel); #else // CPPREST_HTTP_COMPRESSION (void)compressionLevel; (void)method; @@ -777,7 +778,7 @@ std::unique_ptr make_deflate_compressor(int compressionLevel, std::unique_ptr make_brotli_compressor(uint32_t window, uint32_t quality, uint32_t mode) { #if defined(CPPREST_HTTP_COMPRESSION) && defined(CPPREST_BROTLI_COMPRESSION) - return std::move(std::make_unique(window, quality, mode)); + return utility::details::make_unique(window, quality, mode); #else // CPPREST_BROTLI_COMPRESSION (void)window; (void)quality; @@ -962,7 +963,7 @@ std::unique_ptr get_compressor_from_header( if (compressor) { - return std::move(compressor); + return compressor; } // If we're here, we didn't match the caller's compressor above; @@ -976,7 +977,7 @@ std::unique_ptr get_compressor_from_header( auto compressor = web::http::compression::builtin::_make_compressor(f, coding); if (compressor) { - return std::move(compressor); + return compressor; } if (type == header_types::accept_encoding && utility::details::str_iequal(coding, _XPLATSTR("identity"))) { @@ -1079,7 +1080,7 @@ std::unique_ptr get_decompressor_from_header( // Either the response is compressed and we have a decompressor that can handle it, or // built-in compression is not enabled and we don't have an alternate set of decompressors - return std::move(decompressor); + return decompressor; } utility::string_t build_supported_header(header_types type, @@ -1120,7 +1121,7 @@ utility::string_t build_supported_header(header_types type, os << _XPLATSTR("identity;q=1, *;q=0"); } - return std::move(os.str()); + return os.str(); } } // namespace details } // namespace compression