Fix/silence warnings on vc++

This commit is contained in:
Tobias Oberstein
2012-03-07 15:58:02 +01:00
parent f4b910d2c3
commit aac25f9532
5 changed files with 26 additions and 6 deletions

View File

@@ -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<size_t>(m_message_size));
if (!m_binary) {
fill_utf8(m_data,m_message_size,true);
fill_utf8(m_data,static_cast<size_t>(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<size_t>(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;

View File

@@ -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<size_t>(m_processor->get_bytes_needed())),
boost::bind(
&type::handle_read_frame,
type::shared_from_this(),

View File

@@ -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<size_t>(
new_size, static_cast<size_t>(2*m_payload.capacity())
static_cast<size_t>(new_size), static_cast<size_t>(2*m_payload.capacity())
));
}

View File

@@ -45,6 +45,12 @@
#include <iostream>
#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<endpoint>::connection<connection_type>::log_open_result() {
} // namespace role
} // namespace websocketpp
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif // WEBSOCKETPP_ROLE_CLIENT_HPP

View File

@@ -44,6 +44,12 @@
#include <iostream>
#include <stdexcept>
#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<endpoint>::connection<connection_type>::log_open_result() {
} // namespace role
} // namespace websocketpp
#ifdef _MSC_VER
# pragma warning(pop)
#endif
#endif // WEBSOCKETPP_ROLE_SERVER_HPP