Skip to content

Commit adc9d43

Browse files
committed
Bug#37471922: Auto-fix clang-tidy warnings [24/n] [noclose]
Generate fixes for a number of warnings that clang-tidy can fix automatically. This commit fixes the warning 'modernize-redundant-void-arg'. Change example: - static void usage(void); + static void usage(); Change-Id: Iccc3f0f43b211712f0f70f151130cd191e8a999d
1 parent b4eb29e commit adc9d43

File tree

93 files changed

+247
-253
lines changed

Some content is hidden

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

93 files changed

+247
-253
lines changed

client/check/mysqlcheck.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static struct my_option my_long_options[] = {
264264

265265
static const char *load_default_groups[] = {"mysqlcheck", "client", nullptr};
266266

267-
static void usage(void);
267+
static void usage();
268268
static int get_options(int *argc, char ***argv, MEM_ROOT *alloc);
269269
static int dbConnect(char *host, char *user);
270270
static void dbDisconnect(char *host);
@@ -273,7 +273,7 @@ static void safe_exit(int error);
273273

274274
static int what_to_do = 0;
275275

276-
static void usage(void) {
276+
static void usage() {
277277
print_version();
278278
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
279279
puts(

client/mysql_config_editor.cc

+15-15
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ static bool opt_verbose, opt_all,
8383
login_path_specified = false;
8484

8585
static int execute_commands(int command);
86-
static int set_command(void);
87-
static int remove_command(void);
88-
static int print_command(void);
86+
static int set_command();
87+
static int remove_command();
88+
static int print_command();
8989
static void print_login_path(DYNAMIC_STRING *file_buf, const char *path_name);
9090
static void remove_login_path(DYNAMIC_STRING *file_buf, const char *path_name);
9191
static char *locate_login_path(DYNAMIC_STRING *file_buf, const char *path_name);
92-
static bool check_and_create_login_file(void);
92+
static bool check_and_create_login_file();
9393
static void mask_password_and_print(char *buf);
9494
static int reset_login_file(bool gen_key);
9595

@@ -102,14 +102,14 @@ static int do_handle_options(int argc, char *argv[]);
102102
static void remove_options(DYNAMIC_STRING *file_buf, const char *path_name);
103103
static void remove_option(DYNAMIC_STRING *file_buf, const char *path_name,
104104
const char *option_name);
105-
bool generate_login_key(void);
106-
static int read_login_key(void);
107-
static int add_header(void);
105+
bool generate_login_key();
106+
static int read_login_key();
107+
static int add_header();
108108
static void my_perror(const char *msg);
109109

110110
static void verbose_msg(const char *fmt, ...)
111111
MY_ATTRIBUTE((format(printf, 1, 2)));
112-
static void usage_program(void);
112+
static void usage_program();
113113
static void usage_command(int command);
114114
extern "C" bool get_one_option(int optid, const struct my_option *opt,
115115
char *argument);
@@ -494,7 +494,7 @@ static int execute_commands(int command) {
494494
0 Success
495495
*/
496496

497-
static int set_command(void) {
497+
static int set_command() {
498498
DBUG_TRACE;
499499

500500
DYNAMIC_STRING file_buf, path_buf;
@@ -577,7 +577,7 @@ static int set_command(void) {
577577
return -1;
578578
}
579579

580-
static int remove_command(void) {
580+
static int remove_command() {
581581
DBUG_TRACE;
582582

583583
DYNAMIC_STRING file_buf, path_buf;
@@ -625,7 +625,7 @@ static int remove_command(void) {
625625
0 Success
626626
*/
627627

628-
static int print_command(void) {
628+
static int print_command() {
629629
DBUG_TRACE;
630630
DYNAMIC_STRING file_buf;
631631

@@ -655,7 +655,7 @@ static int print_command(void) {
655655
false Success
656656
*/
657657

658-
static bool check_and_create_login_file(void) {
658+
static bool check_and_create_login_file() {
659659
DBUG_TRACE;
660660

661661
MY_STAT stat_info;
@@ -1211,7 +1211,7 @@ static int decrypt_buffer(const char *cipher, int cipher_len, char plain[]) {
12111211
length written, otherwise.
12121212
*/
12131213

1214-
static int add_header(void) {
1214+
static int add_header() {
12151215
DBUG_TRACE;
12161216

12171217
/* Reserved for future use. */
@@ -1260,7 +1260,7 @@ bool generate_login_key() {
12601260
0 Success
12611261
*/
12621262

1263-
static int read_login_key(void) {
1263+
static int read_login_key() {
12641264
DBUG_TRACE;
12651265

12661266
verbose_msg("Reading the login key.\n");
@@ -1315,7 +1315,7 @@ static void usage_command(int command) {
13151315
my_print_variables(command_data[command].options);
13161316
}
13171317

1318-
static void usage_program(void) {
1318+
static void usage_program() {
13191319
print_version();
13201320
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2012"));
13211321
puts("MySQL Configuration Utility.");

client/mysqladmin.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static uint ex_var_count, max_var_length, max_val_length;
106106
#include "client/include/caching_sha2_passwordopt-vars.h"
107107
#include "client/include/multi_factor_passwordopt-vars.h"
108108

109-
static void usage(void);
109+
static void usage();
110110
extern "C" bool get_one_option(int optid, const struct my_option *opt,
111111
char *argument);
112112
static bool sql_connect(MYSQL *mysql, uint wait);
@@ -1193,7 +1193,7 @@ static char **mask_password(int argc, char ***argv) {
11931193
return (temp_argv);
11941194
}
11951195

1196-
static void usage(void) {
1196+
static void usage() {
11971197
print_version();
11981198
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
11991199
puts("Administration program for the mysqld daemon.");

client/mysqldump.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -834,14 +834,14 @@ static void check_io(FILE *file) {
834834
if (ferror(file) || errno == 5) die(EX_EOF, "Got errno %d on write", errno);
835835
}
836836

837-
static void short_usage_sub(void) {
837+
static void short_usage_sub() {
838838
printf("Usage: %s [OPTIONS] database [tables]\n", my_progname);
839839
printf("OR %s [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]\n",
840840
my_progname);
841841
printf("OR %s [OPTIONS] --all-databases [OPTIONS]\n", my_progname);
842842
}
843843

844-
static void usage(void) {
844+
static void usage() {
845845
print_version();
846846
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
847847
puts("Dumping structure and contents of MySQL databases and tables.");
@@ -851,7 +851,7 @@ static void usage(void) {
851851
my_print_variables(my_long_options);
852852
} /* usage */
853853

854-
static void short_usage(void) {
854+
static void short_usage() {
855855
short_usage_sub();
856856
printf("For more options, use %s --help\n", my_progname);
857857
}
@@ -5469,7 +5469,7 @@ static int do_stop_replica_sql(MYSQL *mysql_con) {
54695469
return (0);
54705470
}
54715471

5472-
static int add_stop_replica(void) {
5472+
static int add_stop_replica() {
54735473
if (opt_comments)
54745474
fprintf(md_result_file,
54755475
"\n--\n-- stop replica statement to make a recovery dump\n--\n\n");
@@ -5478,7 +5478,7 @@ static int add_stop_replica(void) {
54785478
return (0);
54795479
}
54805480

5481-
static int add_replica_statements(void) {
5481+
static int add_replica_statements() {
54825482
if (opt_comments)
54835483
fprintf(md_result_file,
54845484
"\n--\n-- start replica statement to make a recovery dump\n--\n\n");

client/mysqlimport.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static struct my_option my_long_options[] = {
246246

247247
static const char *load_default_groups[] = {"mysqlimport", "client", nullptr};
248248

249-
static void usage(void) {
249+
static void usage() {
250250
print_version();
251251
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
252252
printf(

client/mysqlshow.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static struct my_option my_long_options[] = {
321321
{nullptr, 0, nullptr, nullptr, nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0,
322322
0, nullptr, 0, nullptr}};
323323

324-
static void usage(void) {
324+
static void usage() {
325325
print_version();
326326
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
327327
puts(

client/mysqlslap.cc

+9-9
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ uint parse_delimiter(const char *script, statement **stmt, char delm);
280280
int parse_option(const char *origin, option_string **stmt, char delm);
281281
static int drop_schema(MYSQL *mysql, const char *db);
282282
size_t get_random_string(char *buf);
283-
static statement *build_table_string(void);
284-
static statement *build_insert_string(void);
285-
static statement *build_update_string(void);
283+
static statement *build_table_string();
284+
static statement *build_insert_string();
285+
static statement *build_update_string();
286286
static statement *build_select_string(bool key);
287287
static int generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt);
288-
static int drop_primary_key_list(void);
288+
static int drop_primary_key_list();
289289
static int create_schema(MYSQL *mysql, const char *db, statement *stmt,
290290
option_string *engine_stmt);
291291
static void set_sql_mode(MYSQL *mysql);
@@ -720,7 +720,7 @@ static struct my_option my_long_options[] = {
720720
{nullptr, 0, nullptr, nullptr, nullptr, nullptr, GET_NO_ARG, NO_ARG, 0, 0,
721721
0, nullptr, 0, nullptr}};
722722

723-
static void usage(void) {
723+
static void usage() {
724724
print_version();
725725
puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2005"));
726726
puts("Run a query multiple times against the server.\n");
@@ -791,7 +791,7 @@ size_t get_random_string(char *buf) {
791791
This function builds a create table query if the user opts to not supply
792792
a file or string containing a create table statement
793793
*/
794-
static statement *build_table_string(void) {
794+
static statement *build_table_string() {
795795
char buf[HUGE_STRING_LENGTH];
796796
unsigned int col_count;
797797
statement *ptr;
@@ -897,7 +897,7 @@ static statement *build_table_string(void) {
897897
This function builds insert statements when the user opts to not supply
898898
an insert file or string containing insert data
899899
*/
900-
static statement *build_update_string(void) {
900+
static statement *build_update_string() {
901901
char buf[HUGE_STRING_LENGTH];
902902
unsigned int col_count;
903903
statement *ptr;
@@ -961,7 +961,7 @@ static statement *build_update_string(void) {
961961
This function builds insert statements when the user opts to not supply
962962
an insert file or string containing insert data
963963
*/
964-
static statement *build_insert_string(void) {
964+
static statement *build_insert_string() {
965965
char buf[HUGE_STRING_LENGTH];
966966
unsigned int col_count;
967967
statement *ptr;
@@ -1527,7 +1527,7 @@ static int generate_primary_key_list(MYSQL *mysql, option_string *engine_stmt) {
15271527
return 0;
15281528
}
15291529

1530-
static int drop_primary_key_list(void) {
1530+
static int drop_primary_key_list() {
15311531
unsigned long long counter;
15321532

15331533
if (primary_keys_number_of) {

client/mysqltest.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ CHARSET_INFO *charset_info =
356356
*/
357357
static char *timer_file = nullptr;
358358
static ulonglong timer_start;
359-
static void timer_output(void);
360-
static ulonglong timer_now(void);
359+
static void timer_output();
360+
static ulonglong timer_now();
361361

362362
static ulong connection_retry_sleep = 100000; /* Microseconds */
363363

@@ -3325,7 +3325,7 @@ static FILE *my_popen(DYNAMIC_STRING *ds_cmd, const char *mode,
33253325
return popen(ds_cmd->str, mode);
33263326
}
33273327

3328-
static void init_builtin_echo(void) {
3328+
static void init_builtin_echo() {
33293329
#ifdef _WIN32
33303330
size_t echo_length;
33313331

@@ -5127,7 +5127,7 @@ static void do_sync_with_master(struct st_command *command) {
51275127
done on the local mysql server
51285128
*/
51295129

5130-
static void ndb_wait_for_binlog_injector(void) {
5130+
static void ndb_wait_for_binlog_injector() {
51315131
MYSQL_RES *res;
51325132
MYSQL_ROW row;
51335133
MYSQL *mysql = &cur_con->mysql;
@@ -9641,7 +9641,7 @@ static void create_stacktrace_collector_event() {
96419641

96429642
#else /* _WIN32 */
96439643

9644-
static void init_signal_handling(void) {
9644+
static void init_signal_handling() {
96459645
struct sigaction sa;
96469646
DBUG_TRACE;
96479647

@@ -10530,7 +10530,7 @@ int main(int argc, char **argv) {
1053010530
the time between executing the two commands.
1053110531
*/
1053210532

10533-
void timer_output(void) {
10533+
void timer_output() {
1053410534
if (timer_file) {
1053510535
char buf[32], *end;
1053610536
const ulonglong timer = timer_now() - timer_start;
@@ -10541,7 +10541,7 @@ void timer_output(void) {
1054110541
}
1054210542
}
1054310543

10544-
ulonglong timer_now(void) { return my_micro_time() / 1000; }
10544+
ulonglong timer_now() { return my_micro_time() / 1000; }
1054510545

1054610546
/*
1054710547
Get arguments for replace_columns. The syntax is:

components/libminchassis/dynamic_loader.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static PSI_rwlock_info all_dynamic_loader_rwlocks[] = {
313313
{&key_rwlock_LOCK_dynamic_loader, "LOCK_dynamic_loader", PSI_FLAG_SINGLETON,
314314
0, PSI_DOCUMENT_ME}};
315315

316-
static void init_dynamic_loader_psi_keys(void) {
316+
static void init_dynamic_loader_psi_keys() {
317317
const char *category = "components";
318318
int count;
319319

components/libminchassis/dynamic_loader_scheme_file.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static PSI_rwlock_info all_dynamic_loader_scheme_file_rwlocks[] = {
5252
"LOCK_dynamic_loader_scheme_file", PSI_FLAG_SINGLETON, 0,
5353
PSI_DOCUMENT_ME}};
5454

55-
static void init_dynamic_loader_scheme_file_psi_keys(void) {
55+
static void init_dynamic_loader_scheme_file_psi_keys() {
5656
const char *category = "components";
5757
int count;
5858

components/libminchassis/registry.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static PSI_rwlock_info all_registry_rwlocks[] = {
5959
{&::key_rwlock_LOCK_registry, "LOCK_registry", PSI_FLAG_SINGLETON, 0,
6060
PSI_DOCUMENT_ME}};
6161

62-
static void init_registry_psi_keys(void) {
62+
static void init_registry_psi_keys() {
6363
const char *category = "components";
6464
int count;
6565

components/logging/log_sink_syseventlog.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ static void log_syslog_reopen() {
250250
/**
251251
Stop using syslog / EventLog. Call as late as possible.
252252
*/
253-
void log_syslog_exit(void) {
253+
void log_syslog_exit() {
254254
log_syslog_close();
255255

256256
// free ident.
@@ -473,7 +473,7 @@ static void sysvar_update_tag(MYSQL_THD thd [[maybe_unused]],
473473
@retval 0 success
474474
@retval -1 failure
475475
*/
476-
static int sysvar_install_tag(void) {
476+
static int sysvar_install_tag() {
477477
char *var_value;
478478
char *new_value;
479479
size_t var_len = MAX_TAG_LEN;
@@ -607,7 +607,7 @@ static void sysvar_update_fac(MYSQL_THD thd [[maybe_unused]],
607607
@retval 0 success
608608
@retval -1 failure
609609
*/
610-
static int sysvar_install_fac(void) {
610+
static int sysvar_install_fac() {
611611
char *var_value;
612612
char *new_value;
613613
size_t var_len = MAX_FAC_LEN;
@@ -695,7 +695,7 @@ static void sysvar_update_pid(MYSQL_THD thd [[maybe_unused]],
695695
@retval 0 success
696696
@retval -1 failure
697697
*/
698-
static int sysvar_install_pid(void) {
698+
static int sysvar_install_pid() {
699699
char *var_value = nullptr;
700700
size_t var_len = 15;
701701
bool var_bool;

components/pfs_component/pfs_example_continent.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ unsigned int continent_next_available_index = 0;
3939

4040
Continent_record continent_records_array[CONTINENT_MAX_ROWS] = {{"", 0, false}};
4141

42-
int continent_delete_all_rows(void) {
42+
int continent_delete_all_rows() {
4343
native_mutex_lock(&LOCK_continent_records_array);
4444
for (int i = 0; i < CONTINENT_MAX_ROWS; i++)
4545
continent_records_array[i].m_exist = false;
@@ -245,9 +245,7 @@ int write_rows_from_component(Continent_Table_Handle *handle) {
245245
return 0;
246246
}
247247

248-
unsigned long long continent_get_row_count(void) {
249-
return continent_rows_in_table;
250-
}
248+
unsigned long long continent_get_row_count() { return continent_rows_in_table; }
251249

252250
void init_continent_share(PFS_engine_table_share_proxy *share) {
253251
/* Instantiate and initialize PFS_engine_table_share_proxy */

0 commit comments

Comments
 (0)