Skip to content

Commit 8cdc4ed

Browse files
authored
Problem: unused variables warnings
Solution: fix them
1 parent de5ee18 commit 8cdc4ed

14 files changed

Lines changed: 32 additions & 4 deletions

src/ip.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ void zmq::set_socket_priority (fd_t s_, int priority_)
210210
setsockopt (s_, SOL_SOCKET, SO_PRIORITY,
211211
reinterpret_cast<char *> (&priority_), sizeof (priority_));
212212
errno_assert (rc == 0);
213+
#else
214+
LIBZMQ_UNUSED (s_);
215+
LIBZMQ_UNUSED (priority_);
213216
#endif
214217
}
215218

src/zmq.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,8 @@ int zmq_proxy_steerable (void *frontend_,
17391739
void *capture_,
17401740
void *control_)
17411741
{
1742+
LIBZMQ_UNUSED (capture_);
1743+
LIBZMQ_UNUSED (control_);
17421744
if (!frontend_ || !backend_) {
17431745
errno = EFAULT;
17441746
return -1;

src/zmtp_engine.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ bool zmq::zmtp_engine_t::handshake_v3_x (const bool downgrade_sub_)
371371
error (protocol_error);
372372
return false;
373373
}
374+
#ifndef ZMQ_HAVE_CURVE
375+
LIBZMQ_UNUSED (downgrade_sub_);
376+
#endif
374377
_next_msg = &zmtp_engine_t::next_handshake_command;
375378
_process_msg = &zmtp_engine_t::process_handshake_command;
376379

tests/test_bind_fuzzer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ void test_bind_fuzzer ()
5959

6060
int main (int argc, char **argv)
6161
{
62+
LIBZMQ_UNUSED (argc);
63+
LIBZMQ_UNUSED (argv);
64+
6265
setup_test_environment ();
6366

6467
UNITY_BEGIN ();

tests/test_bind_null_fuzzer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ void test_bind_null_fuzzer ()
7676

7777
int main (int argc, char **argv)
7878
{
79+
LIBZMQ_UNUSED (argc);
80+
LIBZMQ_UNUSED (argv);
7981
setup_test_environment ();
8082

8183
UNITY_BEGIN ();

tests/test_connect_fuzzer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ void test_connect_fuzzer ()
4646

4747
int main (int argc, char **argv)
4848
{
49+
LIBZMQ_UNUSED (argc);
50+
LIBZMQ_UNUSED (argv);
51+
4952
setup_test_environment ();
5053

5154
UNITY_BEGIN ();

tests/test_connect_null_fuzzer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ void test_connect_null_fuzzer ()
8181

8282
int main (int argc, char **argv)
8383
{
84+
LIBZMQ_UNUSED (argc);
85+
LIBZMQ_UNUSED (argv);
86+
8487
setup_test_environment ();
8588

8689
UNITY_BEGIN ();

tests/test_poller.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ void call_poller_wait_all_null_event_fails_event_count_nonzero (void *poller_)
297297

298298
void call_poller_wait_all_null_event_fails_event_count_zero (void *poller_)
299299
{
300+
LIBZMQ_UNUSED (poller_);
300301
#if 0
301302
// TODO this causes an assertion, which is not consistent if the number
302303
// of events may be 0, the pointer should be allowed to by NULL in that

tests/test_reconnect_options.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ void reconnect_default ()
4949
int rc = get_monitor_event_with_timeout (sub_mon, &event, &event_address,
5050
2 * 1000);
5151
assert (rc == -1);
52+
LIBZMQ_UNUSED (rc);
5253

5354
// Close sub
5455
// TODO why does this use zero_linger?
@@ -102,6 +103,7 @@ void reconnect_success ()
102103
int rc = get_monitor_event_with_timeout (sub_mon, &event, &event_address,
103104
SETTLE_TIME);
104105
assert (rc == -1);
106+
LIBZMQ_UNUSED (rc);
105107

106108
// Now re-bind pub socket and wait for re-connect
107109
pub = test_context_socket (ZMQ_PUB);

tests/test_socks.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ int remote_connect (int socket, uint32_t addr, uint16_t port)
7777
void *setup_socks_server (char *socks_server_address,
7878
int socks_server_address_len)
7979
{
80+
LIBZMQ_UNUSED (socks_server_address_len);
8081
fprintf (stderr, "socks_server: setup socks server\n");
8182
int server_fd =
8283
bind_socket_resolve_port ("127.0.0.1", "0", socks_server_address);

0 commit comments

Comments
 (0)