mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-28 19:52:00 +01:00
Problem: comparison between signed and unsigned integer expressions
Solution: make tcp_recv_buffer_size and tcp_send_buffer_size unsigned
This commit is contained in:
@@ -285,13 +285,13 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
|
||||
|
||||
case ZMQ_TCP_RECV_BUFFER:
|
||||
if (is_int && (value >= 0 && value <= 10) ) {
|
||||
tcp_recv_buffer_size = static_cast<int>(std::pow(2.0, value)) * 1024;
|
||||
tcp_recv_buffer_size = static_cast<unsigned int>(std::pow(2.0, value)) * 1024;
|
||||
}
|
||||
break;
|
||||
|
||||
case ZMQ_TCP_SEND_BUFFER:
|
||||
if (is_int && (value >= 0 && value <= 10) ) {
|
||||
tcp_send_buffer_size = static_cast<int>(std::pow(2.0, value)) * 1024;
|
||||
tcp_send_buffer_size = static_cast<unsigned int>(std::pow(2.0, value)) * 1024;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user