diff --git a/websocketpp/frame.hpp b/websocketpp/frame.hpp index e1865428f3..fe430db0ad 100644 --- a/websocketpp/frame.hpp +++ b/websocketpp/frame.hpp @@ -172,7 +172,7 @@ struct basic_header { uint8_t basic_value; if (size <= limits::payload_size_basic) { - basic_value = size; + basic_value = static_cast(size); } else if (size <= limits::payload_size_extended) { basic_value = payload_size_code_16bit; } else { @@ -396,7 +396,7 @@ inline lib::error_code set_size(basic_header &h, extended_header &eh, uint64_t uint8_t basic_value; if (size <= limits::payload_size_basic) { - basic_value = size; + basic_value = static_cast(size); } else if (size <= limits::payload_size_extended) { basic_value = payload_size_code_16bit; } else if (size <= limits::payload_size_jumbo) { @@ -576,8 +576,8 @@ inline size_t prepare_masking_key(const masking_key_type& key) { size_t low_bits = static_cast(key.i); if (sizeof(size_t) == 8) { - size_t high_bits = static_cast(key.i); - return (high_bits << 32) | low_bits; + uint64_t high_bits = static_cast(key.i); + return static_cast((high_bits << 32) | low_bits); } else { return low_bits; }