0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-26 23:01:04 +08:00

Problem: various unused variables warnings

Solution: use LIBZMQ_UNUSED where necessary
This commit is contained in:
Luca Boccassi 2017-08-19 12:18:51 +01:00
parent e81a40b8bd
commit 90b6c102bb
6 changed files with 37 additions and 0 deletions

View File

@ -228,5 +228,8 @@ void zmq::bind_to_device (fd_t s_, std::string &bound_device_)
#else
errno_assert (rc == 0);
#endif
#else
LIBZMQ_UNUSED (s_);
LIBZMQ_UNUSED (bound_device_);
#endif
}

View File

@ -67,6 +67,7 @@ int zmq::pgm_receiver_t::init (bool udp_encapsulation_, const char *network_)
void zmq::pgm_receiver_t::plug (io_thread_t *io_thread_,
session_base_t *session_)
{
LIBZMQ_UNUSED (io_thread_);
// Retrieve PGM fds and start polling.
fd_t socket_fd = retired_fd;
fd_t waiting_pipe_fd = retired_fd;

View File

@ -39,6 +39,7 @@
#include "err.hpp"
#include "wire.hpp"
#include "stdint.hpp"
#include "macros.hpp"
zmq::pgm_sender_t::pgm_sender_t (io_thread_t *parent_,
const options_t &options_) :
@ -73,6 +74,7 @@ int zmq::pgm_sender_t::init (bool udp_encapsulation_, const char *network_)
void zmq::pgm_sender_t::plug (io_thread_t *io_thread_, session_base_t *session_)
{
LIBZMQ_UNUSED (io_thread_);
// Allocate 2 fds for PGM socket.
fd_t downlink_socket_fd = retired_fd;
fd_t uplink_socket_fd = retired_fd;

View File

@ -140,6 +140,8 @@ void test_curve_security_with_valid_credentials (
void test_curve_security_with_bogus_client_credentials (
void *ctx, char *my_endpoint, void *server, void *server_mon, int timeout)
{
LIBZMQ_UNUSED (timeout);
// This must be caught by the ZAP handler
char bogus_public [41];
char bogus_secret [41];
@ -278,6 +280,9 @@ void test_curve_security_invalid_hello_wrong_length (char *my_endpoint,
void *server_mon,
int timeout)
{
LIBZMQ_UNUSED (server);
LIBZMQ_UNUSED (timeout);
int s = connect_vanilla_socket (my_endpoint);
// send GREETING
@ -352,6 +357,9 @@ void test_curve_security_invalid_hello_command_name (char *my_endpoint,
void *server_mon,
int timeout)
{
LIBZMQ_UNUSED (server);
LIBZMQ_UNUSED (timeout);
int s = connect_vanilla_socket (my_endpoint);
send_greeting (s);
@ -380,6 +388,9 @@ void test_curve_security_invalid_hello_version (char *my_endpoint,
void *server_mon,
int timeout)
{
LIBZMQ_UNUSED (server);
LIBZMQ_UNUSED (timeout);
int s = connect_vanilla_socket (my_endpoint);
send_greeting (s);
@ -455,6 +466,8 @@ void test_curve_security_invalid_initiate_length (char *my_endpoint,
void *server_mon,
int timeout)
{
LIBZMQ_UNUSED (server);
zmq::curve_client_tools_t tools = make_curve_client_tools ();
int s = connect_exchange_greeting_and_send_hello (my_endpoint, tools);
@ -465,6 +478,8 @@ void test_curve_security_invalid_initiate_length (char *my_endpoint,
#ifdef ZMQ_BUILD_DRAFT_API
int res = get_monitor_event_with_timeout (server_mon, NULL, NULL, timeout);
assert (res == -1);
#else
LIBZMQ_UNUSED (timeout);
#endif
send(s, "\x04\x09\x08INITIATE");
@ -508,6 +523,8 @@ void test_curve_security_invalid_initiate_command_name (char *my_endpoint,
void *server_mon,
int timeout)
{
LIBZMQ_UNUSED (server);
zmq::curve_client_tools_t tools = make_curve_client_tools ();
int s = connect_exchange_greeting_and_hello_welcome (
my_endpoint, server_mon, timeout, tools);
@ -531,6 +548,8 @@ void test_curve_security_invalid_initiate_command_name (char *my_endpoint,
void test_curve_security_invalid_initiate_command_encrypted_cookie (
char *my_endpoint, void *server, void *server_mon, int timeout)
{
LIBZMQ_UNUSED (server);
zmq::curve_client_tools_t tools = make_curve_client_tools ();
int s = connect_exchange_greeting_and_hello_welcome (
my_endpoint, server_mon, timeout, tools);
@ -554,6 +573,8 @@ void test_curve_security_invalid_initiate_command_encrypted_cookie (
void test_curve_security_invalid_initiate_command_encrypted_content (
char *my_endpoint, void *server, void *server_mon, int timeout)
{
LIBZMQ_UNUSED (server);
zmq::curve_client_tools_t tools = make_curve_client_tools ();
int s = connect_exchange_greeting_and_hello_welcome (
my_endpoint, server_mon, timeout, tools);

View File

@ -86,6 +86,8 @@
# endif
#endif
#define LIBZMQ_UNUSED(object) (void)object
// Bounce a message from client to server and back
// For REQ/REP or DEALER/DEALER pairs only
void

View File

@ -41,10 +41,14 @@ const char *test_zap_domain = "ZAPTEST";
// NULL specific functions
void socket_config_null_client (void *server, void *server_secret)
{
LIBZMQ_UNUSED (server);
LIBZMQ_UNUSED (server_secret);
}
void socket_config_null_server (void *server, void *server_secret)
{
LIBZMQ_UNUSED (server_secret);
int rc = zmq_setsockopt (server, ZMQ_ZAP_DOMAIN, test_zap_domain, 7);
assert (rc == 0);
}
@ -55,6 +59,8 @@ const char *test_plain_password = "testpass";
void socket_config_plain_client (void *server, void *server_secret)
{
LIBZMQ_UNUSED (server_secret);
int rc = zmq_setsockopt (server, ZMQ_PLAIN_PASSWORD, test_plain_password, 8);
assert (rc == 0);
@ -64,6 +70,8 @@ void socket_config_plain_client (void *server, void *server_secret)
void socket_config_plain_server (void *server, void *server_secret)
{
LIBZMQ_UNUSED (server_secret);
int as_server = 1;
int rc = zmq_setsockopt (server, ZMQ_PLAIN_SERVER, &as_server, sizeof (int));
assert (rc == 0);