mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-04 07:27:26 +01:00
Merge pull request #1519 from reza-ebrahimi/master
place a ZMQ_UNUSED macro and replace all unused variables with ZMQ_UNUSED macro
This commit is contained in:
commit
6d217aa919
@ -493,6 +493,12 @@ ZMQ_EXPORT void *zmq_threadstart (zmq_thread_fn* func, void* arg);
|
|||||||
ZMQ_EXPORT void zmq_threadclose (void* thread);
|
ZMQ_EXPORT void zmq_threadclose (void* thread);
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* 0MQ General */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
#define ZMQ_UNUSED(object) (void)object
|
||||||
|
|
||||||
#undef ZMQ_EXPORT
|
#undef ZMQ_EXPORT
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -43,8 +43,7 @@ zmq::client_t::~client_t ()
|
|||||||
|
|
||||||
void zmq::client_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
void zmq::client_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
||||||
{
|
{
|
||||||
// subscribe_to_all_ is unused
|
ZMQ_UNUSED(subscribe_to_all_);
|
||||||
(void) subscribe_to_all_;
|
|
||||||
|
|
||||||
zmq_assert (pipe_);
|
zmq_assert (pipe_);
|
||||||
|
|
||||||
|
@ -44,8 +44,7 @@ zmq::dealer_t::~dealer_t ()
|
|||||||
|
|
||||||
void zmq::dealer_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
void zmq::dealer_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
||||||
{
|
{
|
||||||
// subscribe_to_all_ is unused
|
ZMQ_UNUSED(subscribe_to_all_);
|
||||||
(void) subscribe_to_all_;
|
|
||||||
|
|
||||||
zmq_assert (pipe_);
|
zmq_assert (pipe_);
|
||||||
|
|
||||||
|
@ -47,8 +47,7 @@ zmq::pair_t::~pair_t ()
|
|||||||
|
|
||||||
void zmq::pair_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
void zmq::pair_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
||||||
{
|
{
|
||||||
// subscribe_to_all_ is unused
|
ZMQ_UNUSED(subscribe_to_all_);
|
||||||
(void)subscribe_to_all_;
|
|
||||||
|
|
||||||
zmq_assert (pipe_ != NULL);
|
zmq_assert (pipe_ != NULL);
|
||||||
|
|
||||||
|
@ -44,8 +44,7 @@ zmq::pull_t::~pull_t ()
|
|||||||
|
|
||||||
void zmq::pull_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
void zmq::pull_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
||||||
{
|
{
|
||||||
// subscribe_to_all_ is unused
|
ZMQ_UNUSED(subscribe_to_all_);
|
||||||
(void)subscribe_to_all_;
|
|
||||||
|
|
||||||
zmq_assert (pipe_);
|
zmq_assert (pipe_);
|
||||||
fq.attach (pipe_);
|
fq.attach (pipe_);
|
||||||
|
@ -44,8 +44,8 @@ zmq::push_t::~push_t ()
|
|||||||
|
|
||||||
void zmq::push_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
void zmq::push_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
||||||
{
|
{
|
||||||
// subscribe_to_all_ is unused
|
ZMQ_UNUSED(subscribe_to_all_);
|
||||||
(void)subscribe_to_all_;
|
|
||||||
// Don't delay pipe termination as there is no one
|
// Don't delay pipe termination as there is no one
|
||||||
// to receive the delimiter.
|
// to receive the delimiter.
|
||||||
pipe_->set_nodelay ();
|
pipe_->set_nodelay ();
|
||||||
|
@ -66,8 +66,7 @@ zmq::router_t::~router_t ()
|
|||||||
|
|
||||||
void zmq::router_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
void zmq::router_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
||||||
{
|
{
|
||||||
// subscribe_to_all_ is unused
|
ZMQ_UNUSED(subscribe_to_all_);
|
||||||
(void)subscribe_to_all_;
|
|
||||||
|
|
||||||
zmq_assert (pipe_);
|
zmq_assert (pipe_);
|
||||||
|
|
||||||
|
@ -48,8 +48,7 @@ zmq::server_t::~server_t ()
|
|||||||
|
|
||||||
void zmq::server_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
void zmq::server_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
||||||
{
|
{
|
||||||
// subscribe_to_all_ is unused
|
ZMQ_UNUSED(subscribe_to_all_);
|
||||||
(void)subscribe_to_all_;
|
|
||||||
|
|
||||||
zmq_assert (pipe_);
|
zmq_assert (pipe_);
|
||||||
|
|
||||||
|
@ -58,8 +58,7 @@ zmq::stream_t::~stream_t ()
|
|||||||
|
|
||||||
void zmq::stream_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
void zmq::stream_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
||||||
{
|
{
|
||||||
// subscribe_to_all_ is unused
|
ZMQ_UNUSED(subscribe_to_all_);
|
||||||
(void)subscribe_to_all_;
|
|
||||||
|
|
||||||
zmq_assert (pipe_);
|
zmq_assert (pipe_);
|
||||||
|
|
||||||
|
10
src/tcp.cpp
10
src/tcp.cpp
@ -94,13 +94,13 @@ void zmq::set_tcp_receive_buffer (fd_t sockfd_, int bufsize_)
|
|||||||
void zmq::tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_)
|
void zmq::tune_tcp_keepalives (fd_t s_, int keepalive_, int keepalive_cnt_, int keepalive_idle_, int keepalive_intvl_)
|
||||||
{
|
{
|
||||||
// These options are used only under certain #ifdefs below.
|
// These options are used only under certain #ifdefs below.
|
||||||
(void)keepalive_;
|
ZMQ_UNUSED(keepalive_);
|
||||||
(void)keepalive_cnt_;
|
ZMQ_UNUSED(keepalive_cnt_);
|
||||||
(void)keepalive_idle_;
|
ZMQ_UNUSED(keepalive_idle_);
|
||||||
(void)keepalive_intvl_;
|
ZMQ_UNUSED(keepalive_intvl_);
|
||||||
|
|
||||||
// If none of the #ifdefs apply, then s_ is unused.
|
// If none of the #ifdefs apply, then s_ is unused.
|
||||||
(void)s_;
|
ZMQ_UNUSED(s_);
|
||||||
|
|
||||||
// Tuning TCP keep-alives if platform allows it
|
// Tuning TCP keep-alives if platform allows it
|
||||||
// All values = -1 means skip and leave it for OS
|
// All values = -1 means skip and leave it for OS
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_)
|
int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_)
|
||||||
{
|
{
|
||||||
// TODO: Unused parameter, IPv6 support not implemented for Solaris.
|
// TODO: Unused parameter, IPv6 support not implemented for Solaris.
|
||||||
(void) ipv6_;
|
ZMQ_UNUSED(ipv6_);
|
||||||
|
|
||||||
// Create a socket.
|
// Create a socket.
|
||||||
const int fd = open_socket (AF_INET, SOCK_DGRAM, 0);
|
const int fd = open_socket (AF_INET, SOCK_DGRAM, 0);
|
||||||
@ -123,7 +123,7 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_
|
|||||||
int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_)
|
int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_)
|
||||||
{
|
{
|
||||||
// TODO: Unused parameter, IPv6 support not implemented for AIX or HP/UX.
|
// TODO: Unused parameter, IPv6 support not implemented for AIX or HP/UX.
|
||||||
(void) ipv6_;
|
ZMQ_UNUSED(ipv6_);
|
||||||
|
|
||||||
// Create a socket.
|
// Create a socket.
|
||||||
const int sd = open_socket (AF_INET, SOCK_DGRAM, 0);
|
const int sd = open_socket (AF_INET, SOCK_DGRAM, 0);
|
||||||
@ -209,9 +209,8 @@ int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_
|
|||||||
// This is true especially of Windows.
|
// This is true especially of Windows.
|
||||||
int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_)
|
int zmq::tcp_address_t::resolve_nic_name (const char *nic_, bool ipv6_, bool is_src_)
|
||||||
{
|
{
|
||||||
// All unused parameters.
|
ZMQ_UNUSED(nic_);
|
||||||
(void) nic_;
|
ZMQ_UNUSED(ipv6_);
|
||||||
(void) ipv6_;
|
|
||||||
|
|
||||||
errno = ENODEV;
|
errno = ENODEV;
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -55,8 +55,7 @@ zmq::xsub_t::~xsub_t ()
|
|||||||
|
|
||||||
void zmq::xsub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
void zmq::xsub_t::xattach_pipe (pipe_t *pipe_, bool subscribe_to_all_)
|
||||||
{
|
{
|
||||||
// subscribe_to_all_ is unused
|
ZMQ_UNUSED(subscribe_to_all_);
|
||||||
(void) subscribe_to_all_;
|
|
||||||
|
|
||||||
zmq_assert (pipe_);
|
zmq_assert (pipe_);
|
||||||
fq.attach (pipe_);
|
fq.attach (pipe_);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user