Skip to content

Commit 1a133d0

Browse files
committed
Bug#24296291: FIX -WUNUSED-PARAMETER WARNINGS
Patch #15: Fix -Wunused-parameter warnings in plugins, part 1.
1 parent f3b3478 commit 1a133d0

Some content is hidden

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

46 files changed

+258
-259
lines changed

plugin/connection_control/connection_control.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,8 @@ check_failed_connections_threshold(MYSQL_THD thd MY_ATTRIBUTE((unused)),
223223
static void
224224
update_failed_connections_threshold(MYSQL_THD thd MY_ATTRIBUTE((unused)),
225225
struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
226-
void *var_ptr, const void *save)
226+
void *var_ptr MY_ATTRIBUTE((unused)),
227+
const void *save)
227228
{
228229
/*
229230
This won't result in overflow because we have already checked that this is
@@ -306,7 +307,8 @@ check_min_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)),
306307
static void
307308
update_min_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)),
308309
struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
309-
void *var_ptr, const void *save)
310+
void *var_ptr MY_ATTRIBUTE((unused)),
311+
const void *save)
310312
{
311313
longlong new_value= *(reinterpret_cast<const longlong *>(save));
312314
g_variables.min_connection_delay= (int64)new_value;
@@ -385,7 +387,8 @@ check_max_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)),
385387
static void
386388
update_max_connection_delay(MYSQL_THD thd MY_ATTRIBUTE((unused)),
387389
struct st_mysql_sys_var *var MY_ATTRIBUTE((unused)),
388-
void *var_ptr, const void *save)
390+
void *var_ptr MY_ATTRIBUTE((unused)),
391+
const void *save)
389392
{
390393
longlong new_value= *(reinterpret_cast<const longlong *>(save));
391394
my_atomic_store64(&g_variables.max_connection_delay, (int64)new_value);

plugin/connection_control/connection_control_memory.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ namespace connection_control
3939
{
4040
return Connection_control_malloc<void*>(size);
4141
}
42-
static void operator delete(void* ptr, std::size_t sz)
42+
static void operator delete(void* ptr, std::size_t)
4343
{
4444
my_free(ptr);
4545
}
46-
static void operator delete[](void* ptr, std::size_t sz)
46+
static void operator delete[](void* ptr, std::size_t)
4747
{
4848
my_free(ptr);
4949
}

plugin/connection_control/connection_delay.cc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,9 @@ namespace connection_control
9999
/**
100100
Helper function for Connection_delay_event::reset_all
101101
102-
@param [in] ptr Pointer to an entry in hash
103-
104102
@returns 1 to indicate that entry is a match
105103
*/
106-
int match_all_entries(const uchar *ptr)
104+
int match_all_entries(const uchar*)
107105
{
108106
return 1;
109107
}
@@ -384,14 +382,12 @@ namespace connection_control
384382
/**
385383
Function to dump LF hash data to IS table.
386384
387-
@param [in] thd THD handle
388385
@param [in] tables Handle to
389386
information_schema.connection_control_failed_attempts
390387
*/
391388

392389
void
393-
Connection_delay_event::fill_IS_table(THD *thd,
394-
TABLE_LIST *tables)
390+
Connection_delay_event::fill_IS_table(TABLE_LIST *tables)
395391
{
396392
DBUG_ENTER("Connection_delay_event::fill_IS_table");
397393
TABLE *table= tables->table;
@@ -914,7 +910,7 @@ namespace connection_control
914910
}
915911
}
916912
else
917-
m_userhost_hash.fill_IS_table(thd, tables);
913+
m_userhost_hash.fill_IS_table(tables);
918914

919915
DBUG_VOID_RETURN;
920916
}

plugin/connection_control/connection_delay.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ namespace connection_control
119119
lf_hash_destroy(&m_entries);
120120
}
121121

122-
void fill_IS_table(THD *thd, TABLE_LIST *tables);
122+
void fill_IS_table(TABLE_LIST *tables);
123123

124124
/* Overridden function */
125125
bool create_or_update_entry(const Sql_string &s);

plugin/keyring/checker/checker_ver_1_0.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bool CheckerVer_1_0::file_seek_to_tag(File file)
2727
return mysql_file_seek(file, -static_cast<int>(EOF_TAG_SIZE), MY_SEEK_END,
2828
MYF(0)) == MY_FILEPOS_ERROR;
2929
}
30-
bool CheckerVer_1_0::is_dgst_correct(File file, Digest *digest)
30+
bool CheckerVer_1_0::is_dgst_correct(File, Digest *digest)
3131
{
3232
digest->is_empty= TRUE;
3333
return TRUE;

plugin/keyring/common/keyring_memory.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ namespace keyring {
4242
{
4343
return keyring_malloc<void*>(size);
4444
}
45-
static void operator delete(void* ptr, std::size_t sz)
45+
static void operator delete(void* ptr, std::size_t)
4646
{
4747
my_free(ptr);
4848
}
49-
static void operator delete[](void* ptr, std::size_t sz)
49+
static void operator delete[](void* ptr, std::size_t)
5050
{
5151
my_free(ptr);
5252
}

plugin/keyring_udf/keyring_udf.cc

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636

3737
static bool is_keyring_udf_initialized= FALSE;
3838

39-
static int keyring_udf_init(void *p)
39+
static int keyring_udf_init(void*)
4040
{
4141
DBUG_ENTER("keyring_udf_init");
4242
is_keyring_udf_initialized= TRUE;
4343
DBUG_RETURN(0);
4444
}
4545

46-
static int keyring_udf_deinit(void *p)
46+
static int keyring_udf_deinit(void*)
4747
{
4848
DBUG_ENTER("keyring_udf_deinit");
4949
is_keyring_udf_initialized= FALSE;
@@ -225,7 +225,7 @@ bool keyring_key_store_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
225225
}
226226

227227
PLUGIN_EXPORT
228-
void keyring_key_store_deinit(UDF_INIT *initid)
228+
void keyring_key_store_deinit(UDF_INIT*)
229229
{}
230230

231231
/**
@@ -234,8 +234,7 @@ void keyring_key_store_deinit(UDF_INIT *initid)
234234
@return 1 on success, NULL and error on failure
235235
*/
236236
PLUGIN_EXPORT
237-
long long keyring_key_store(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
238-
char *error)
237+
long long keyring_key_store(UDF_INIT*, UDF_ARGS *args, char*, char *error)
239238
{
240239
std::string current_user;
241240

@@ -321,7 +320,7 @@ void keyring_key_fetch_deinit(UDF_INIT *initid)
321320
@return key on success, NULL if key does not exist, NULL and error on failure
322321
*/
323322
PLUGIN_EXPORT
324-
char *keyring_key_fetch(UDF_INIT *initid, UDF_ARGS *args, char *result,
323+
char *keyring_key_fetch(UDF_INIT *initid, UDF_ARGS *args, char*,
325324
unsigned long *length, char *is_null, char *error)
326325
{
327326
char *key= NULL;
@@ -372,7 +371,7 @@ void keyring_key_type_fetch_deinit(UDF_INIT *initid)
372371
@return key's type on success, NULL if key does not exist, NULL and error on failure
373372
*/
374373
PLUGIN_EXPORT
375-
char *keyring_key_type_fetch(UDF_INIT *initid, UDF_ARGS *args, char *result,
374+
char *keyring_key_type_fetch(UDF_INIT *initid, UDF_ARGS *args, char*,
376375
unsigned long *length, char *is_null, char *error)
377376
{
378377
char *key_type= NULL;
@@ -424,7 +423,7 @@ void keyring_key_length_fetch_deinit(UDF_INIT *initid)
424423
@return key's length on success, NULL if key does not exist, NULL and error on failure
425424
*/
426425
PLUGIN_EXPORT
427-
long long keyring_key_length_fetch(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
426+
long long keyring_key_length_fetch(UDF_INIT*, UDF_ARGS *args, char *is_null,
428427
char *error)
429428
{
430429
size_t key_len= 0;
@@ -450,7 +449,7 @@ bool keyring_key_remove_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
450449
}
451450

452451
PLUGIN_EXPORT
453-
void keyring_key_remove_deinit(UDF_INIT *initid)
452+
void keyring_key_remove_deinit(UDF_INIT*)
454453
{}
455454

456455
/**
@@ -459,8 +458,7 @@ void keyring_key_remove_deinit(UDF_INIT *initid)
459458
@return 1 on success, NULL on failure
460459
*/
461460
PLUGIN_EXPORT
462-
long long keyring_key_remove(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
463-
char *error)
461+
long long keyring_key_remove(UDF_INIT*, UDF_ARGS *args, char*, char *error)
464462
{
465463
std::string current_user;
466464
if (get_current_user(&current_user))
@@ -487,7 +485,7 @@ bool keyring_key_generate_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
487485
}
488486

489487
PLUGIN_EXPORT
490-
void keyring_key_generate_deinit(UDF_INIT *initid)
488+
void keyring_key_generate_deinit(UDF_INIT*)
491489
{}
492490

493491
/**
@@ -496,8 +494,7 @@ void keyring_key_generate_deinit(UDF_INIT *initid)
496494
@return 1 on success, NULL and error on failure
497495
*/
498496
PLUGIN_EXPORT
499-
long long keyring_key_generate(UDF_INIT *initid, UDF_ARGS *args, char *is_null,
500-
char *error)
497+
long long keyring_key_generate(UDF_INIT*, UDF_ARGS *args, char*, char *error)
501498
{
502499
std::string current_user;
503500
if (get_current_user(&current_user))

plugin/replication_observers_example/replication_observers_example.cc

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -100,42 +100,42 @@ static void dump_server_state_calls()
100100
/*
101101
DBMS lifecycle events observers.
102102
*/
103-
static int before_handle_connection(Server_state_param *param)
103+
static int before_handle_connection(Server_state_param*)
104104
{
105105
before_handle_connection_call++;
106106

107107
return 0;
108108
}
109109

110-
static int before_recovery(Server_state_param *param)
110+
static int before_recovery(Server_state_param*)
111111
{
112112
before_recovery_call++;
113113

114114
return 0;
115115
}
116116

117-
static int after_engine_recovery(Server_state_param *param)
117+
static int after_engine_recovery(Server_state_param*)
118118
{
119119
after_engine_recovery_call++;
120120

121121
return 0;
122122
}
123123

124-
static int after_recovery(Server_state_param *param)
124+
static int after_recovery(Server_state_param*)
125125
{
126126
after_recovery_call++;
127127

128128
return 0;
129129
}
130130

131-
static int before_server_shutdown(Server_state_param *param)
131+
static int before_server_shutdown(Server_state_param*)
132132
{
133133
before_server_shutdown_call++;
134134

135135
return 0;
136136
}
137137

138-
static int after_server_shutdown(Server_state_param *param)
138+
static int after_server_shutdown(Server_state_param*)
139139
{
140140
after_server_shutdown_call++;
141141

@@ -201,7 +201,7 @@ static void dump_transaction_calls()
201201
/*
202202
Transaction lifecycle events observers.
203203
*/
204-
static int trans_before_dml(Trans_param *param, int& out_val)
204+
static int trans_before_dml(Trans_param*, int& out_val)
205205
{
206206
trans_before_dml_call++;
207207

@@ -315,14 +315,14 @@ static int trans_before_commit(Trans_param *param)
315315
return 0;
316316
}
317317

318-
static int trans_before_rollback(Trans_param *param)
318+
static int trans_before_rollback(Trans_param*)
319319
{
320320
trans_before_rollback_call++;
321321

322322
return 0;
323323
}
324324

325-
static int trans_after_commit(Trans_param *param)
325+
static int trans_after_commit(Trans_param*)
326326
{
327327
trans_after_commit_call++;
328328

@@ -412,56 +412,56 @@ static void dump_binlog_relay_calls()
412412
}
413413
}
414414

415-
static int binlog_relay_thread_start(Binlog_relay_IO_param *param)
415+
static int binlog_relay_thread_start(Binlog_relay_IO_param*)
416416
{
417417
binlog_relay_thread_start_call++;
418418

419419
return 0;
420420
}
421421

422-
static int binlog_relay_thread_stop(Binlog_relay_IO_param *param)
422+
static int binlog_relay_thread_stop(Binlog_relay_IO_param*)
423423
{
424424
binlog_relay_thread_stop_call++;
425425

426426
return 0;
427427
}
428428

429-
static int binlog_relay_applier_stop(Binlog_relay_IO_param *param,
429+
static int binlog_relay_applier_stop(Binlog_relay_IO_param*,
430430
bool aborted)
431431
{
432432
binlog_relay_applier_stop_call++;
433433
thread_aborted = aborted;
434434
return 0;
435435
}
436436

437-
static int binlog_relay_before_request_transmit(Binlog_relay_IO_param *param,
438-
uint32 flags)
437+
static int binlog_relay_before_request_transmit(Binlog_relay_IO_param*,
438+
uint32)
439439
{
440440
binlog_relay_before_request_transmit_call++;
441441

442442
return 0;
443443
}
444444

445-
static int binlog_relay_after_read_event(Binlog_relay_IO_param *param,
446-
const char *packet, unsigned long len,
447-
const char **event_buf, unsigned long *event_len)
445+
static int binlog_relay_after_read_event(Binlog_relay_IO_param*,
446+
const char*, unsigned long,
447+
const char**, unsigned long*)
448448
{
449449
binlog_relay_after_read_event_call++;
450450

451451
return 0;
452452
}
453453

454-
static int binlog_relay_after_queue_event(Binlog_relay_IO_param *param,
455-
const char *event_buf,
456-
unsigned long event_len,
457-
uint32 flags)
454+
static int binlog_relay_after_queue_event(Binlog_relay_IO_param*,
455+
const char*,
456+
unsigned long,
457+
uint32)
458458
{
459459
binlog_relay_after_queue_event_call++;
460460

461461
return 0;
462462
}
463463

464-
static int binlog_relay_after_reset_slave(Binlog_relay_IO_param *param)
464+
static int binlog_relay_after_reset_slave(Binlog_relay_IO_param*)
465465
{
466466
binlog_relay_after_reset_slave_call++;
467467

plugin/rewrite_example/rewrite_example.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static int plugin_init(MYSQL_PLUGIN)
4949
#endif /* HAVE_PSI_INTERFACE */
5050

5151

52-
static int rewrite_lower(MYSQL_THD thd, mysql_event_class_t event_class,
52+
static int rewrite_lower(MYSQL_THD, mysql_event_class_t event_class,
5353
const void *event)
5454
{
5555
if (event_class == MYSQL_AUDIT_PARSE_CLASS)

plugin/rewriter/rewriter_udf.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929

3030
extern "C" {
3131

32-
bool load_rewrite_rules_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
32+
bool load_rewrite_rules_init(UDF_INIT*, UDF_ARGS*, char *message)
3333
{
3434
if (get_rewriter_plugin_info() != NULL)
3535
return 0;
3636
strncpy(message, "Rewriter plugin needs to be installed.", MYSQL_ERRMSG_SIZE);
3737
return 1;
3838
}
3939

40-
char *load_rewrite_rules(UDF_INIT *initid, UDF_ARGS *args, char *result,
41-
unsigned long *length, char *is_null, char *error)
40+
char *load_rewrite_rules(UDF_INIT*, UDF_ARGS*, char*,
41+
unsigned long *length, char *is_null, char*)
4242
{
4343
DBUG_ASSERT(get_rewriter_plugin_info() != NULL);
4444
const char *message= NULL;
@@ -53,6 +53,6 @@ char *load_rewrite_rules(UDF_INIT *initid, UDF_ARGS *args, char *result,
5353
return const_cast<char*>(message);
5454
}
5555

56-
void load_rewrite_rules_deinit(UDF_INIT *initid) {}
56+
void load_rewrite_rules_deinit(UDF_INIT*) {}
5757

5858
}

0 commit comments

Comments
 (0)