mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 05:29:43 +01:00
Problem: ptr/ref parameters and local variables are non-const but never modified
Solution: add const
This commit is contained in:
@@ -302,7 +302,7 @@ int zmq::options_t::setsockopt (int option_,
|
||||
const void *optval_,
|
||||
size_t optvallen_)
|
||||
{
|
||||
bool is_int = (optvallen_ == sizeof (int));
|
||||
const bool is_int = (optvallen_ == sizeof (int));
|
||||
int value = 0;
|
||||
if (is_int)
|
||||
memcpy (&value, optval_, sizeof (int));
|
||||
@@ -448,7 +448,7 @@ int zmq::options_t::setsockopt (int option_,
|
||||
/* Deprecated in favor of ZMQ_IPV6 */
|
||||
case ZMQ_IPV4ONLY: {
|
||||
bool value;
|
||||
int rc =
|
||||
const int rc =
|
||||
do_setsockopt_int_as_bool_strict (optval_, optvallen_, &value);
|
||||
if (rc == 0)
|
||||
ipv6 = !value;
|
||||
|
||||
Reference in New Issue
Block a user