0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

Problem: parameters not const where const possible

Solution: add const
This commit is contained in:
Simon Giesecke 2019-12-08 14:59:41 +01:00 committed by Simon Giesecke
parent 84267e734b
commit fdabd73da6
4 changed files with 8 additions and 6 deletions

View File

@ -616,7 +616,9 @@ int zmq::thread_ctx_t::set (int option_, const void *optval_, size_t optvallen_)
return -1;
}
int zmq::thread_ctx_t::get (int option_, void *optval_, size_t *optvallen_)
int zmq::thread_ctx_t::get (int option_,
void *optval_,
const size_t *optvallen_)
{
const bool is_int = (*optvallen_ == sizeof (int));
int *value = static_cast<int *> (optval_);

View File

@ -73,7 +73,7 @@ class thread_ctx_t
const char *name_ = NULL) const;
int set (int option_, const void *optval_, size_t optvallen_);
int get (int option_, void *optval_, size_t *optvallen_);
int get (int option_, void *optval_, const size_t *optvallen_);
protected:
// Synchronisation of access to context options.

View File

@ -85,7 +85,7 @@ int zmq::do_getsockopt (void *const optval_,
#ifdef ZMQ_HAVE_CURVE
static int do_getsockopt_curve_key (void *const optval_,
size_t *const optvallen_,
const size_t *const optvallen_,
const uint8_t (&curve_key_)[CURVE_KEYSIZE])
{
if (*optvallen_ == CURVE_KEYSIZE) {

View File

@ -100,9 +100,9 @@ static void zap_handler_large_routing_id (void * /*unused_*/)
zap_handler_generic (zap_ok, large_routing_id);
}
void expect_new_client_curve_bounce_fail (char *server_public_,
char *client_public_,
char *client_secret_,
void expect_new_client_curve_bounce_fail (const char *server_public_,
const char *client_public_,
const char *client_secret_,
char *my_endpoint_,
void *server_,
void **client_mon_ = NULL,