diff --git a/examples/wsperf/generic.hpp b/examples/wsperf/generic.hpp index 0b86a7f288..77e6f884b2 100644 --- a/examples/wsperf/generic.hpp +++ b/examples/wsperf/generic.hpp @@ -94,13 +94,13 @@ public: void on_open(connection_ptr con) { m_msg = con->get_data_message(); - m_data.reserve(m_message_size); + m_data.reserve(static_cast(m_message_size)); if (!m_binary) { - fill_utf8(m_data,m_message_size,true); + fill_utf8(m_data,static_cast(m_message_size),true); m_msg->reset(websocketpp::frame::opcode::TEXT); } else { - fill_binary(m_data,m_message_size,true); + fill_binary(m_data,static_cast(m_message_size),true); m_msg->reset(websocketpp::frame::opcode::BINARY); } @@ -142,7 +142,7 @@ public: } private: // Simulation Parameters - size_t m_message_size; + uint64_t m_message_size; uint64_t m_message_count; uint64_t m_timeout; bool m_binary; diff --git a/src/connection.hpp b/src/connection.hpp index 4a14d054a1..a4432a0c95 100644 --- a/src/connection.hpp +++ b/src/connection.hpp @@ -348,7 +348,7 @@ public: boost::asio::async_read( socket_type::get_socket(), m_buf, - boost::asio::transfer_at_least(m_processor->get_bytes_needed()), + boost::asio::transfer_at_least(static_cast(m_processor->get_bytes_needed())), boost::bind( &type::handle_read_frame, type::shared_from_this(), diff --git a/src/messages/data.cpp b/src/messages/data.cpp index 4765edc10b..4e95a2c087 100644 --- a/src/messages/data.cpp +++ b/src/messages/data.cpp @@ -58,7 +58,7 @@ uint64_t data::process_payload(std::istream& input,uint64_t size) { if (new_size > m_payload.capacity()) { m_payload.reserve(std::max( - new_size, static_cast(2*m_payload.capacity()) + static_cast(new_size), static_cast(2*m_payload.capacity()) )); } diff --git a/src/roles/client.hpp b/src/roles/client.hpp index 68dbe0d3e4..c0ed9e8c36 100644 --- a/src/roles/client.hpp +++ b/src/roles/client.hpp @@ -45,6 +45,12 @@ #include +#ifdef _MSC_VER +// Disable "warning C4355: 'this' : used in base member initializer list". +# pragma warning(push) +# pragma warning(disable:4355) +#endif + using boost::asio::ip::tcp; namespace websocketpp { @@ -531,4 +537,8 @@ void client::connection::log_open_result() { } // namespace role } // namespace websocketpp +#ifdef _MSC_VER +# pragma warning(pop) +#endif + #endif // WEBSOCKETPP_ROLE_CLIENT_HPP diff --git a/src/roles/server.hpp b/src/roles/server.hpp index 3eb8f78b85..822f37a7cb 100644 --- a/src/roles/server.hpp +++ b/src/roles/server.hpp @@ -44,6 +44,12 @@ #include #include +#ifdef _MSC_VER +// Disable "warning C4355: 'this' : used in base member initializer list". +# pragma warning(push) +# pragma warning(disable:4355) +#endif + namespace websocketpp { // Forward declarations @@ -644,4 +650,8 @@ void server::connection::log_open_result() { } // namespace role } // namespace websocketpp +#ifdef _MSC_VER +# pragma warning(pop) +#endif + #endif // WEBSOCKETPP_ROLE_SERVER_HPP