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

Style: Fix unused parameter compilation warnings

This commit addresses the following warnings reported on gcc 5.2.1. In
the future, this will help reduce the "noise" and help catch warnings
revealing a serious problem.

8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
/path/to/libzmq/src/options.cpp:1048:36: warning: unused parameter ‘option_’ [-Wunused-parameter]
 bool zmq::options_t::is_valid (int option_) const
                                    ^

/path/to/libzmq/src/plain_client.cpp:146:30: warning: unused parameter ‘cmd_data’ [-Wunused-parameter]
         const unsigned char *cmd_data, size_t data_size)
                              ^

/path/to/libzmq/src/plain_client.cpp:146:30: warning: unused parameter ‘cmd_data’ [-Wunused-parameter]
         const unsigned char *cmd_data, size_t data_size)
                              ^

/path/to/libzmq/src/socket_base.cpp:1445:44: warning: unused parameter ‘group_’ [-Wunused-parameter]
 int zmq::socket_base_t::xjoin (const char *group_)
                                            ^
/path/to/libzmq/src/socket_base.cpp:1451:45: warning: unused parameter ‘group_’ [-Wunused-parameter]
 int zmq::socket_base_t::xleave (const char *group_)
                                             ^

/path/to/libzmq/src/radio.cpp:145:33: warning: unused parameter ‘msg_’ [-Wunused-parameter]
 int zmq::radio_t::xrecv (msg_t *msg_)
                                 ^
/path/to/libzmq/src/dish.cpp:164:32: warning: unused parameter ‘msg_’ [-Wunused-parameter]
 int zmq::dish_t::xsend (msg_t *msg_)
                                ^

/path/to/libzmq/tests/test_msg_ffn.cpp:32:16: warning: unused parameter ‘data’ [-Wunused-parameter]
 void ffn(void *data, void *hint) {
                ^

/path/to/libzmq/tests/test_timers.cpp:50:19: warning: unused parameter ‘timer_id’ [-Wunused-parameter]
 void handler (int timer_id, void* arg)
                   ^
8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
This commit is contained in:
Jean-Christophe Fillion-Robin 2016-01-30 02:31:23 -05:00
parent b784943f90
commit f329252dcb
7 changed files with 13 additions and 0 deletions

View File

@ -163,6 +163,7 @@ int zmq::dish_t::xleave (const char* group_)
int zmq::dish_t::xsend (msg_t *msg_) int zmq::dish_t::xsend (msg_t *msg_)
{ {
LIBZMQ_UNUSED (msg_);
errno = ENOTSUP; errno = ENOTSUP;
return -1; return -1;
} }

View File

@ -31,6 +31,7 @@
#include "options.hpp" #include "options.hpp"
#include "err.hpp" #include "err.hpp"
#include "macros.hpp"
#include "../include/zmq_utils.h" #include "../include/zmq_utils.h"
zmq::options_t::options_t () : zmq::options_t::options_t () :
@ -1047,5 +1048,6 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
bool zmq::options_t::is_valid (int option_) const bool zmq::options_t::is_valid (int option_) const
{ {
LIBZMQ_UNUSED (option_);
return true; return true;
} }

View File

@ -27,6 +27,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "macros.hpp"
#include "platform.hpp" #include "platform.hpp"
#ifdef ZMQ_HAVE_WINDOWS #ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp" #include "windows.hpp"
@ -145,6 +146,8 @@ int zmq::plain_client_t::produce_hello (msg_t *msg_) const
int zmq::plain_client_t::process_welcome ( int zmq::plain_client_t::process_welcome (
const unsigned char *cmd_data, size_t data_size) const unsigned char *cmd_data, size_t data_size)
{ {
LIBZMQ_UNUSED (cmd_data);
if (state != waiting_for_welcome) { if (state != waiting_for_welcome) {
errno = EPROTO; errno = EPROTO;
return -1; return -1;

View File

@ -145,6 +145,7 @@ bool zmq::radio_t::xhas_out ()
int zmq::radio_t::xrecv (msg_t *msg_) int zmq::radio_t::xrecv (msg_t *msg_)
{ {
// Messages cannot be received from PUB socket. // Messages cannot be received from PUB socket.
LIBZMQ_UNUSED (msg_);
errno = ENOTSUP; errno = ENOTSUP;
return -1; return -1;
} }

View File

@ -1444,12 +1444,14 @@ bool zmq::socket_base_t::xhas_in ()
int zmq::socket_base_t::xjoin (const char *group_) int zmq::socket_base_t::xjoin (const char *group_)
{ {
LIBZMQ_UNUSED (group_);
errno = ENOTSUP; errno = ENOTSUP;
return -1; return -1;
} }
int zmq::socket_base_t::xleave (const char *group_) int zmq::socket_base_t::xleave (const char *group_)
{ {
LIBZMQ_UNUSED (group_);
errno = ENOTSUP; errno = ENOTSUP;
return -1; return -1;
} }

View File

@ -27,9 +27,11 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "macros.hpp"
#include "testutil.hpp" #include "testutil.hpp"
void ffn(void *data, void *hint) { void ffn(void *data, void *hint) {
LIBZMQ_UNUSED (data);
// Signal that ffn has been called by writing "freed" to hint // Signal that ffn has been called by writing "freed" to hint
memcpy(hint, (void *) "freed", 5); memcpy(hint, (void *) "freed", 5);
} }

View File

@ -27,6 +27,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "macros.hpp"
#include "testutil.hpp" #include "testutil.hpp"
#include "../include/zmq_utils.h" #include "../include/zmq_utils.h"
@ -49,6 +50,7 @@ void sleep_ (long timeout_)
void handler (int timer_id, void* arg) void handler (int timer_id, void* arg)
{ {
LIBZMQ_UNUSED (timer_id);
*((bool *)arg) = true; *((bool *)arg) = true;
} }