Skip to content

Commit a11852c

Browse files
committed
Bug#24296291: FIX -WUNUSED-PARAMETER WARNINGS
Patch mysql#17: Fix -Wunused-parameter warnings in unit tests.
1 parent 043c6eb commit a11852c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+198
-208
lines changed

libbinlogevents/include/control_events.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ class Rotate_event: public Binary_log_event
148148
const Format_description_event *description_event);
149149

150150
#ifndef HAVE_MYSYS
151-
void print_event_info(std::ostream& info);
152-
void print_long_info(std::ostream& info);
151+
void print_event_info(std::ostream&);
152+
void print_long_info(std::ostream&);
153153
#endif
154154

155155
~Rotate_event()
@@ -283,8 +283,8 @@ class Start_event_v3: public Binary_log_event
283283
#ifndef HAVE_MYSYS
284284
//TODO(WL#7684): Implement the method print_event_info and print_long_info for
285285
// all the events supported in MySQL Binlog
286-
void print_event_info(std::ostream& info) { }
287-
void print_long_info(std::ostream& info) { }
286+
void print_event_info(std::ostream&) { }
287+
void print_long_info(std::ostream&) { }
288288
#endif
289289
};
290290

@@ -472,7 +472,7 @@ class Stop_event: public Binary_log_event
472472
{}
473473

474474
#ifndef HAVE_MYSYS
475-
void print_event_info(std::ostream& info) {};
475+
void print_event_info(std::ostream&) {};
476476
void print_long_info(std::ostream& info);
477477
#endif
478478
};
@@ -746,8 +746,8 @@ class XA_prepare_event: public Binary_log_event
746746
todo: we need to find way how to exploit server's code of
747747
serialize_xid()
748748
*/
749-
void print_event_info(std::ostream& info) {};
750-
void print_long_info(std::ostream& info) {};
749+
void print_event_info(std::ostream&) {};
750+
void print_long_info(std::ostream&) {};
751751
#endif
752752
};
753753

@@ -800,8 +800,8 @@ class Ignorable_event: public Binary_log_event
800800
*/
801801
Ignorable_event(const char *buf, const Format_description_event *descr_event);
802802
#ifndef HAVE_MYSYS
803-
void print_event_info(std::ostream& info) { }
804-
void print_long_info(std::ostream& info) { }
803+
void print_event_info(std::ostream&) { }
804+
void print_long_info(std::ostream&) { }
805805
#endif
806806
};
807807

@@ -1092,8 +1092,8 @@ class Gtid_event: public Binary_log_event
10921092
#ifndef HAVE_MYSYS
10931093
//TODO(WL#7684): Implement the method print_event_info and print_long_info
10941094
// for all the events supported in MySQL Binlog
1095-
void print_event_info(std::ostream& info) { }
1096-
void print_long_info(std::ostream& info) { }
1095+
void print_event_info(std::ostream&) { }
1096+
void print_long_info(std::ostream&) { }
10971097
#endif
10981098
protected:
10991099
static const int ENCODED_FLAG_LENGTH= 1;
@@ -1214,8 +1214,8 @@ class Previous_gtids_event : public Binary_log_event
12141214
#ifndef HAVE_MYSYS
12151215
//TODO(WL#7684): Implement the method print_event_info and print_long_info
12161216
// for all the events supported in MySQL Binlog
1217-
void print_event_info(std::ostream& info) { }
1218-
void print_long_info(std::ostream& info) { }
1217+
void print_event_info(std::ostream&) { }
1218+
void print_long_info(std::ostream&) { }
12191219
#endif
12201220
protected:
12211221
size_t buf_size;
@@ -1314,8 +1314,8 @@ class Transaction_context_event : public Binary_log_event
13141314
static void clear_set(std::list<const char*> *set);
13151315

13161316
#ifndef HAVE_MYSYS
1317-
void print_event_info(std::ostream& info) { }
1318-
void print_long_info(std::ostream& info) { }
1317+
void print_event_info(std::ostream&) { }
1318+
void print_long_info(std::ostream&) { }
13191319
#endif
13201320

13211321
protected:
@@ -1416,8 +1416,8 @@ class View_change_event : public Binary_log_event
14161416
std::map<std::string, std::string> *map);
14171417

14181418
#ifndef HAVE_MYSYS
1419-
void print_event_info(std::ostream& info) { }
1420-
void print_long_info(std::ostream& info) { }
1419+
void print_event_info(std::ostream&) { }
1420+
void print_long_info(std::ostream&) { }
14211421
#endif
14221422

14231423
protected:

libbinlogevents/include/load_data_events.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ class Delete_file_event: public Binary_log_event
249249
#ifndef HAVE_MYSYS
250250
//TODO(WL#7684): Implement the method print_event_info and print_long_info for
251251
// all the events supported in MySQL Binlog
252-
void print_event_info(std::ostream& info) {};
253-
void print_long_info(std::ostream& info) {};
252+
void print_event_info(std::ostream&) {};
253+
void print_long_info(std::ostream&) {};
254254
#endif
255255
};
256256

@@ -364,8 +364,8 @@ class Append_block_event: public Binary_log_event
364364
#ifndef HAVE_MYSYS
365365
//TODO(WL#7684): Implement the method print_event_info and print_long_info for
366366
// all the events supported in MySQL Binlog
367-
void print_event_info(std::ostream& info) {};
368-
void print_long_info(std::ostream& info) {};
367+
void print_event_info(std::ostream&) {};
368+
void print_long_info(std::ostream&) {};
369369
#endif
370370
};
371371

@@ -424,8 +424,8 @@ class Begin_load_query_event: public virtual Append_block_event
424424
#ifndef HAVE_MYSYS
425425
//TODO(WL#7684): Implement the method print_event_info and print_long_info for
426426
// all the events supported in MySQL Binlog
427-
void print_event_info(std::ostream& info) {};
428-
void print_long_info(std::ostream& info) {};
427+
void print_event_info(std::ostream&) {};
428+
void print_long_info(std::ostream&) {};
429429
#endif
430430
};
431431
} // end namespace binary_log

libbinlogevents/include/wrapper_functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ inline void* bapi_memdup(const void* source, size_t len)
151151
@param flags flags to pass to MySQL server my_malloc functions
152152
@return Void pointer to the allocated chunk of memory
153153
*/
154-
inline void * bapi_malloc(size_t size, int flags)
154+
inline void * bapi_malloc(size_t size, int flags MY_ATTRIBUTE((unused)))
155155
{
156156
void * dest= NULL;
157157
#ifdef HAVE_MYSYS

libbinlogevents/src/binlog_event.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,8 @@ Unknown_event::Unknown_event(const char* buf,
320320
{
321321
}
322322
#ifndef HAVE_MYSYS
323-
void Binary_log_event::print_event_info(std::ostream& info) {}
324-
void Binary_log_event::print_long_info(std::ostream& info) {}
323+
void Binary_log_event::print_event_info(std::ostream&) {}
324+
void Binary_log_event::print_long_info(std::ostream&) {}
325325
/**
326326
This method is used by the binlog_browser to print short and long
327327
information about the event. Since the body of Stop_event is empty

rapid/plugin/x/ngs/src/client.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ void Client::on_session_auth_success(Session_interface&)
340340
}
341341

342342

343-
void Client::on_session_close(Session_interface &s)
343+
void Client::on_session_close(Session_interface &s MY_ATTRIBUTE((unused)))
344344
{
345345
log_debug("%s: Session %i removed", client_id(), s.session_id());
346346

@@ -356,7 +356,7 @@ void Client::on_session_close(Session_interface &s)
356356
}
357357

358358

359-
void Client::on_session_reset(Session_interface &s)
359+
void Client::on_session_reset(Session_interface &s MY_ATTRIBUTE((unused)))
360360
{
361361
log_debug("%s: Resetting session %i", client_id(), s.session_id());
362362

rapid/plugin/x/ngs/src/protocol_encoder.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ void Protocol_encoder::log_protobuf(const char *direction_name, Request &request
256256
}
257257

258258

259-
void Protocol_encoder::log_protobuf(const char *direction_name, const Message *message)
259+
void
260+
Protocol_encoder::log_protobuf(const char *direction_name MY_ATTRIBUTE((unused)),
261+
const Message *message)
260262
{
261263
#ifdef USE_MYSQLX_FULL_PROTO
262264
std::string text_message;
@@ -282,7 +284,7 @@ void Protocol_encoder::log_protobuf(const char *direction_name, const Message *m
282284
}
283285

284286
// for message sent as raw buffer only logging its type tag now
285-
void Protocol_encoder::log_protobuf(int8_t type)
287+
void Protocol_encoder::log_protobuf(int8_t type MY_ATTRIBUTE((unused)))
286288
{
287289
log_debug("SEND RAW: Type: %d", type);
288290
}

rapid/unittest/gunit/xplugin/capabilities_handlers_t.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class No_delete
4141
{
4242
public:
4343
template <typename T>
44-
void operator() (T *memory)
44+
void operator() (T*)
4545
{
4646
}
4747
};

rapid/unittest/gunit/xplugin/mysqlx_pb_wrapper.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved.
1+
/* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
22
33
This program is free software; you can redistribute it and/or modify
44
it under the terms of the GNU General Public License as published by
@@ -189,7 +189,7 @@ Scalar::Scalar(const Scalar::String &value)
189189
}
190190

191191

192-
Scalar::Scalar(Scalar::Null value)
192+
Scalar::Scalar(Scalar::Null)
193193
{
194194
set_type(Mysqlx::Datatypes::Scalar_Type_V_NULL);
195195
}

rapid/unittest/gunit/xplugin/stubs/command_service.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
extern "C" {
2222
#endif
2323

24-
int command_service_run_command(MYSQL_SESSION session,
25-
enum enum_server_command command,
26-
const union COM_DATA * data,
27-
const CHARSET_INFO * client_cs,
28-
const struct st_command_service_cbs * callbacks,
29-
enum cs_text_or_binary text_or_binary,
30-
void * service_callbacks_ctx)
24+
int command_service_run_command(MYSQL_SESSION,
25+
enum enum_server_command,
26+
const union COM_DATA*,
27+
const CHARSET_INFO*,
28+
const struct st_command_service_cbs*,
29+
enum cs_text_or_binary,
30+
void*)
3131
{
3232
DBUG_ASSERT(0);
3333
return 0;

rapid/unittest/gunit/xplugin/stubs/misc.cc

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -59,88 +59,88 @@ PSI_socket_key KEY_socket_x_client_connection = PSI_NOT_INSTRUMENTED;
5959
const char *my_localhost;
6060
int32 volatile connection_events_loop_aborted_flag;;
6161

62-
int ip_to_hostname(struct sockaddr_storage *ip_storage,
63-
const char *ip_string,
64-
char **hostname,
65-
uint *connect_errors)
62+
int ip_to_hostname(struct sockaddr_storage*,
63+
const char*,
64+
char**,
65+
uint*)
6666
{
6767
DBUG_ASSERT(0);
6868
return 1;
6969
}
7070

71-
int register_server_state_observer(Server_state_observer *observer, void *p)
71+
int register_server_state_observer(Server_state_observer*, void*)
7272
{
7373
return 0;
7474
}
7575

76-
int unregister_server_state_observer(Server_state_observer *observer, void *p)
76+
int unregister_server_state_observer(Server_state_observer*, void*)
7777
{
7878
return 0;
7979
}
8080

8181
extern "C"
82-
void ssl_wrapper_version(Vio *vio, char *version, const size_t version_size)
82+
void ssl_wrapper_version(Vio*, char*, const size_t)
8383
{
8484
}
8585

8686
extern "C"
87-
void ssl_wrapper_cipher(Vio *vio, char *cipher, const size_t cipher_size)
87+
void ssl_wrapper_cipher(Vio*, char*, const size_t)
8888
{
8989
}
9090

9191
extern "C"
92-
long ssl_wrapper_cipher_list(Vio *vio, const char **clipher_list, const size_t maximun_num_of_elements)
92+
long ssl_wrapper_cipher_list(Vio*, const char**, const size_t)
9393
{
9494
return 0;
9595
}
9696

9797
extern "C"
98-
long ssl_wrapper_verify_depth(Vio *vio)
98+
long ssl_wrapper_verify_depth(Vio*)
9999
{
100100
return 0;
101101
}
102102

103103
extern "C"
104-
long ssl_wrapper_verify_mode(Vio *vio)
104+
long ssl_wrapper_verify_mode(Vio*)
105105
{
106106
return 0;
107107
}
108108

109109
extern "C"
110-
void ssl_wrapper_get_peer_certificate_issuer(Vio *vio, char *issuer, const size_t issuer_size)
110+
void ssl_wrapper_get_peer_certificate_issuer(Vio*, char*, const size_t)
111111
{
112112
}
113113

114114
extern "C"
115-
void ssl_wrapper_get_peer_certificate_subject(Vio *vio, char *subject, const size_t subject_size)
115+
void ssl_wrapper_get_peer_certificate_subject(Vio*, char*, const size_t)
116116
{
117117
}
118118

119119
extern "C"
120-
long ssl_wrapper_get_verify_result_and_cert(Vio *vio)
120+
long ssl_wrapper_get_verify_result_and_cert(Vio*)
121121
{
122122
return 0;
123123
}
124124

125125
extern "C"
126-
long ssl_wrapper_ctx_verify_depth(struct st_VioSSLFd *vio_ssl)
126+
long ssl_wrapper_ctx_verify_depth(struct st_VioSSLFd*)
127127
{
128128
return 0;
129129
}
130130

131131
extern "C"
132-
long ssl_wrapper_ctx_verify_mode(struct st_VioSSLFd *vio_ssl)
132+
long ssl_wrapper_ctx_verify_mode(struct st_VioSSLFd*)
133133
{
134134
return 0;
135135
}
136136

137137
extern "C"
138-
void ssl_wrapper_ctx_server_not_after(struct st_VioSSLFd *vio_ssl, char *no_after, const size_t no_after_size)
138+
void ssl_wrapper_ctx_server_not_after(struct st_VioSSLFd*, char*, const size_t)
139139
{
140140
}
141141

142142
extern "C"
143-
void ssl_wrapper_ctx_server_not_before(struct st_VioSSLFd *vio_ssl, char *no_before, const size_t no_before_size)
143+
void ssl_wrapper_ctx_server_not_before(struct st_VioSSLFd*, char*, const size_t)
144144
{
145145
}
146146

@@ -150,13 +150,13 @@ void ssl_wrapper_thread_cleanup()
150150
}
151151

152152
extern "C"
153-
long ssl_wrapper_sess_accept(struct st_VioSSLFd *vio_ssl)
153+
long ssl_wrapper_sess_accept(struct st_VioSSLFd*)
154154
{
155155
return 0;
156156
}
157157

158158
extern "C"
159-
long ssl_wrapper_sess_accept_good(struct st_VioSSLFd *vio_ssl)
159+
long ssl_wrapper_sess_accept_good(struct st_VioSSLFd*)
160160
{
161161
return 0;
162162
}

rapid/unittest/gunit/xplugin/stubs/plugin.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
#include "mysql/plugin.h"
1818

1919
extern "C" {
20-
21-
int thd_killed(const MYSQL_THD thd)
20+
21+
int thd_killed(const MYSQL_THD)
2222
{
2323
return 0;
2424
}
2525

26-
void thd_set_kill_status(const MYSQL_THD thd)
26+
void thd_set_kill_status(const MYSQL_THD)
2727
{
2828
}
2929
}

0 commit comments

Comments
 (0)