diff --git a/src/options.cpp b/src/options.cpp index e4bc011a..c89d3a02 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -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(std::pow(2, value)) * 1024; + tcp_recv_buffer_size = static_cast(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(std::pow(2, value)) * 1024; + tcp_send_buffer_size = static_cast(std::pow(2.0, value)) * 1024; } break; diff --git a/src/options.hpp b/src/options.hpp index be04ec64..5eab5060 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -156,9 +156,9 @@ namespace zmq typedef std::vector tcp_accept_filters_t; tcp_accept_filters_t tcp_accept_filters; - // TCO buffer sizes - int tcp_recv_buffer_size; - int tcp_send_buffer_size; + // TCP buffer sizes + unsigned int tcp_recv_buffer_size; + unsigned int tcp_send_buffer_size; // IPC accept() filters # if defined ZMQ_HAVE_SO_PEERCRED || defined ZMQ_HAVE_LOCAL_PEERCRED