Skip to content

Commit 557db85

Browse files
committed
Bug#24296291: FIX -WUNUSED-PARAMETER WARNINGS
Patch #18: Fix -Wunused-parameter warnings in clients and plugins.
1 parent d683d25 commit 557db85

22 files changed

+66
-94
lines changed

client/base/abstract_program.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ using std::vector;
2929
extern const char *load_default_groups[];
3030

3131
bool Abstract_program::callback_option_parsed(
32-
int optid,
33-
const struct my_option *opt MY_ATTRIBUTE((unused)),
34-
char *argument)
32+
int, const struct my_option *opt, char *argument)
3533
{
3634
// Check if option uses My::Tools::Base::Options, and it should.
3735
Options::I_option* app_type = (Options::I_option*)opt->app_type;

client/dump/abstract_chain_element.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -73,7 +73,7 @@ Item_processing_data* Abstract_chain_element::new_task_created(
7373
}
7474

7575
Item_processing_data* Abstract_chain_element::new_chain_created(
76-
Chain_data* new_chain_data, Item_processing_data* parent_processing_data,
76+
Chain_data*, Item_processing_data* parent_processing_data,
7777
I_chain_element* child_chain_element)
7878
{
7979
Item_processing_data* new_item_to_process=

client/dump/abstract_mysql_chain_element_extension.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Mysql::Nullable<std::string>
8080
Abstract_mysql_chain_element_extension::get_create_statement(
8181
Mysql::Tools::Base::Mysql_query_runner* runner,
8282
const std::string& database_name, const std::string& object_name,
83-
const std::string& object_type, uint field_id/*= 1*/)
83+
const std::string& object_type, uint)
8484
{
8585
std::vector<const Mysql::Tools::Base::Mysql_query_runner::Row*> result;
8686

client/dump/abstract_progress_watcher.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Abstract_progress_watcher::Abstract_progress_watcher(
7171
m_last_step_countdown(1)
7272
{}
7373

74-
void Abstract_progress_watcher::crawler_completed(I_crawler* crawler)
74+
void Abstract_progress_watcher::crawler_completed(I_crawler*)
7575
{}
7676

7777
void Abstract_progress_watcher::object_processing_ended(
@@ -107,7 +107,7 @@ void Abstract_progress_watcher::object_processing_ended(
107107
}
108108

109109
void Abstract_progress_watcher::object_processing_started(
110-
Item_processing_data* process_data)
110+
Item_processing_data*)
111111
{}
112112

113113
void Abstract_progress_watcher::new_chain_created(

client/dump/mysqldump_tool_chain_maker.cc

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,11 @@
3131
using namespace Mysql::Tools::Dump;
3232
using std::placeholders::_1;
3333

34-
void Mysqldump_tool_chain_maker::delete_chain(
35-
uint64 chain_id, I_object_reader* chain)
34+
void Mysqldump_tool_chain_maker::delete_chain(uint64, I_object_reader*)
3635
{}
3736

3837
I_object_reader* Mysqldump_tool_chain_maker::create_chain(
39-
Chain_data* chain_data, I_dump_task* dump_task)
38+
Chain_data*, I_dump_task* dump_task)
4039
{
4140
Table_rows_dump_task* rows_task= dynamic_cast<Table_rows_dump_task*>(
4241
dump_task);

client/dump/single_transaction_connection_provider.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ using namespace Mysql::Tools::Dump;
2424

2525
Mysql::Tools::Base::Mysql_query_runner*
2626
Single_transaction_connection_provider::create_new_runner(
27-
std::function<bool(const Mysql::Tools::Base::Message_data&)>*
28-
message_handler)
27+
std::function<bool(const Mysql::Tools::Base::Message_data&)>*)
2928
{
3029
Mysql::Tools::Base::Mysql_query_runner* runner= NULL;
3130
my_boost::mutex::scoped_lock lock(m_pool_mutex);

client/dump/sql_formatter.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ void Sql_formatter::format_database_start(
264264
this->append_output(database->get_sql_formatted_definition() + ";\n");
265265
}
266266

267-
void Sql_formatter::format_dump_end(Dump_end_dump_task* dump_start_dump_task)
267+
void Sql_formatter::format_dump_end(Dump_end_dump_task*)
268268
{
269269
std::ostringstream out;
270270
std::time_t sys_time = std::chrono::system_clock::to_time_t(

client/dump/standard_progress_watcher.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
2222
using namespace Mysql::Tools::Dump;
2323

2424
void Standard_progress_watcher::process_progress_step(
25-
Abstract_progress_watcher::Progress_data& change)
25+
Abstract_progress_watcher::Progress_data&)
2626
{
2727
std::cerr << "Dump progress: " << m_last_progress.m_table_count << "/"
2828
<< m_total.m_table_count << " tables, " << m_last_progress.m_row_count

client/logger.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
using namespace std;
2525

26-
ostream &operator<<(ostream &os, const Datetime &dt)
26+
ostream &operator<<(ostream &os, const Datetime&)
2727
{
2828
const char format[]= "%Y-%m-%d %X";
2929
time_t t(time(NULL));

client/mysql.cc

+4-6
Original file line numberDiff line numberDiff line change
@@ -1181,10 +1181,10 @@ static void mysql_end_timer(ulong start_time,char *buff);
11811181
static void nice_time(double sec,char *buff,bool part_second);
11821182
static void kill_query(const char* reason);
11831183
extern "C" void mysql_end(int sig);
1184-
extern "C" void handle_ctrlc_signal(int sig);
1184+
extern "C" void handle_ctrlc_signal(int);
11851185
extern "C" void handle_quit_signal(int sig);
11861186
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
1187-
static void window_resize(int sig);
1187+
static void window_resize(int);
11881188
#endif
11891189

11901190
const char DELIMITER_NAME[]= "delimiter";
@@ -1541,11 +1541,9 @@ void mysql_end(int sig)
15411541
This function handles SIGINT (Ctrl - C). It sends a 'KILL [QUERY]' command
15421542
to the server if a query is currently executing. On Windows, 'Ctrl - Break'
15431543
is treated alike.
1544-
1545-
@param sig Signal number
15461544
*/
15471545

1548-
void handle_ctrlc_signal(int sig)
1546+
void handle_ctrlc_signal(int)
15491547
{
15501548
sigint_received= 1;
15511549

@@ -1638,7 +1636,7 @@ void kill_query(const char *reason)
16381636

16391637

16401638
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
1641-
void window_resize(int sig)
1639+
void window_resize(int)
16421640
{
16431641
struct winsize window_size;
16441642

client/mysql_config_editor.cc

+4-12
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@ my_program_get_one_option(int optid,
246246
}
247247

248248
static bool
249-
my_set_command_get_one_option(int optid,
250-
const struct my_option *opt MY_ATTRIBUTE((unused)),
251-
char *argument)
249+
my_set_command_get_one_option(int optid, const struct my_option *, char*)
252250
{
253251
switch(optid) {
254252
case 'p':
@@ -273,9 +271,7 @@ my_set_command_get_one_option(int optid,
273271
}
274272

275273
static bool
276-
my_remove_command_get_one_option(int optid,
277-
const struct my_option *opt MY_ATTRIBUTE((unused)),
278-
char *argument)
274+
my_remove_command_get_one_option(int optid, const struct my_option*, char*)
279275
{
280276
switch(optid) {
281277
case 'G':
@@ -297,9 +293,7 @@ my_remove_command_get_one_option(int optid,
297293
}
298294

299295
static bool
300-
my_print_command_get_one_option(int optid,
301-
const struct my_option *opt MY_ATTRIBUTE((unused)),
302-
char *argument)
296+
my_print_command_get_one_option(int optid, const struct my_option*, char*)
303297
{
304298
switch(optid) {
305299
case 'G':
@@ -321,9 +315,7 @@ my_print_command_get_one_option(int optid,
321315
}
322316

323317
static bool
324-
my_reset_command_get_one_option(int optid,
325-
const struct my_option *opt MY_ATTRIBUTE((unused)),
326-
char *argument)
318+
my_reset_command_get_one_option(int optid, const struct my_option*, char*)
327319
{
328320
switch(optid) {
329321
case '?':

client/mysql_ssl_rsa_setup.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,7 @@ void usage(void)
360360

361361
extern "C" {
362362
static bool
363-
my_arguments_get_one_option(int optid,
364-
const struct my_option *opt MY_ATTRIBUTE((unused)),
365-
char *argument)
363+
my_arguments_get_one_option(int optid, const struct my_option*, char*)
366364
{
367365
switch(optid){
368366
case '?':

client/mysqltest.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -2862,7 +2862,7 @@ static void do_source(struct st_command *command)
28622862

28632863

28642864
static FILE* my_popen(DYNAMIC_STRING *ds_cmd, const char *mode,
2865-
struct st_command *command)
2865+
struct st_command *command MY_ATTRIBUTE((unused)))
28662866
{
28672867
#ifdef _WIN32
28682868
/*
@@ -5483,7 +5483,7 @@ static bool kill_process(int pid)
54835483
@param pid Process id.
54845484
@param path Path to create minidump file in.
54855485
*/
5486-
static void abort_process(int pid, const char *path)
5486+
static void abort_process(int pid, const char *path MY_ATTRIBUTE((unused)))
54875487
{
54885488
#ifdef _WIN32
54895489
HANDLE proc;

client/upgrade/program.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const int SYS_PROCEDURE_COUNT = 26;
5959
/**
6060
Error callback to be called from mysql_check functionality.
6161
*/
62-
static void mysql_check_error_callback(MYSQL *mysql, string when)
62+
static void mysql_check_error_callback(MYSQL*, string)
6363
{
6464
mysql_check_errors= 1;
6565
}
@@ -203,7 +203,7 @@ class Program : public Base::Abstract_connection_program
203203
EXIT_MYSQL_CHECK_ERROR - Error during calling mysql_check functionality.
204204
EXIT_UPGRADING_QUERIES_ERROR - Error during execution of upgrading queries.
205205
*/
206-
int execute(vector<string> positional_options)
206+
int execute(vector<string>)
207207
{
208208
/*
209209
Disables output buffering to make printing to stdout and stderr order

sql/locking_service_udf.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ bool service_get_read_locks_init(UDF_INIT *initid, UDF_ARGS *args,
8080
}
8181

8282

83-
long long service_get_read_locks(UDF_INIT *initid, UDF_ARGS *args,
84-
char *is_null, char *error)
83+
long long service_get_read_locks(UDF_INIT*, UDF_ARGS *args,
84+
char*, char*)
8585
{
8686
const char *lock_namespace= args->args[0];
8787
long long timeout= *((long long*)args->args[args->arg_count - 1]);
@@ -102,8 +102,8 @@ bool service_get_write_locks_init(UDF_INIT *initid, UDF_ARGS *args,
102102
}
103103

104104

105-
long long service_get_write_locks(UDF_INIT *initid, UDF_ARGS *args,
106-
char *is_null, char *error)
105+
long long service_get_write_locks(UDF_INIT*, UDF_ARGS *args,
106+
char*, char*)
107107
{
108108
const char *lock_namespace= args->args[0];
109109
long long timeout= *((long long*)args->args[args->arg_count - 1]);
@@ -143,8 +143,8 @@ bool service_release_locks_init(UDF_INIT *initid, UDF_ARGS *args,
143143
}
144144

145145

146-
long long service_release_locks(UDF_INIT *initid, UDF_ARGS *args,
147-
char *is_null, char *error)
146+
long long service_release_locks(UDF_INIT*, UDF_ARGS *args,
147+
char*, char*)
148148
{
149149
const char *lock_namespace= args->args[0];
150150
// For the UDF 1 == success, 0 == failure.

0 commit comments

Comments
 (0)