Commit a992d9ac authored by Constantin Rack's avatar Constantin Rack

Problem: comparison between signed and unsigned integer expressions

Solution: make tcp_recv_buffer_size and tcp_send_buffer_size unsigned
parent 98d5d4d7
...@@ -285,13 +285,13 @@ int zmq::options_t::setsockopt (int option_, const void *optval_, ...@@ -285,13 +285,13 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
case ZMQ_TCP_RECV_BUFFER: case ZMQ_TCP_RECV_BUFFER:
if (is_int && (value >= 0 && value <= 10) ) { 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; break;
case ZMQ_TCP_SEND_BUFFER: case ZMQ_TCP_SEND_BUFFER:
if (is_int && (value >= 0 && value <= 10) ) { 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; break;
......
...@@ -156,9 +156,9 @@ namespace zmq ...@@ -156,9 +156,9 @@ namespace zmq
typedef std::vector <tcp_address_mask_t> tcp_accept_filters_t; typedef std::vector <tcp_address_mask_t> tcp_accept_filters_t;
tcp_accept_filters_t tcp_accept_filters; tcp_accept_filters_t tcp_accept_filters;
// TCO buffer sizes // TCP buffer sizes
int tcp_recv_buffer_size; unsigned int tcp_recv_buffer_size;
int tcp_send_buffer_size; unsigned int tcp_send_buffer_size;
// IPC accept() filters // IPC accept() filters
# if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED # if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment