Skip to content

Commit ce80d85

Browse files
committed
Bug#37471922: Auto-fix clang-tidy warnings [1/n] [noclose]
Generate fixes for a number of warnings that clang-tidy can fix automatically. This commit fixes the warning 'modernize-deprecated-headers' (InnoDB, NDB, router, group_replication and X plugin impacts will be in the separate commit). Change example: -#include <stdlib.h> +#include <cstdlib> Change-Id: Iddafdfabf99b274dc7a77add766c16446167d21f
1 parent f94969b commit ce80d85

File tree

430 files changed

+1211
-1214
lines changed

Some content is hidden

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

430 files changed

+1211
-1214
lines changed

client/check/mysqlcheck.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2001, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2001, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -27,7 +27,7 @@
2727

2828
#include <mysql_version.h>
2929
#include <mysqld_error.h>
30-
#include <stdlib.h>
30+
#include <cstdlib>
3131

3232
#include "client/include/caching_sha2_passwordopt-vars.h"
3333
#include "client/include/client_priv.h"

client/echo.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2000, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -36,7 +36,7 @@
3636
3737
*/
3838

39-
#include <stdio.h>
39+
#include <cstdio>
4040

4141
int main(int argc, char **argv) {
4242
int i;

client/json_binlog_main.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2020, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2020, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -26,7 +26,7 @@
2626
visible. See the accompanying cmake rules.
2727
Instantiated Value objects are bad, running this executable will fail.
2828
*/
29-
#include <stdlib.h>
29+
#include <cstdlib>
3030

3131
#include <string>
3232

client/logger.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2015, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2015, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -25,7 +25,7 @@
2525

2626
#include "client/logger.h"
2727

28-
#include <time.h>
28+
#include <ctime>
2929
#include <iostream>
3030
#include <locale>
3131
#include <memory>

client/mysql.cc

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -27,16 +27,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2727

2828
#include "my_config.h"
2929

30-
#include <errno.h>
3130
#include <fcntl.h>
32-
#include <inttypes.h>
33-
#include <math.h>
34-
#include <signal.h>
35-
#include <stdarg.h>
36-
#include <stdio.h>
37-
#include <stdlib.h>
3831
#include <sys/types.h>
39-
#include <time.h>
32+
#include <cerrno>
33+
#include <cinttypes>
34+
#include <cmath>
35+
#include <csignal>
36+
#include <cstdarg>
37+
#include <cstdio>
38+
#include <cstdlib>
39+
#include <ctime>
4040

4141
#include "client/client_query_attributes.h"
4242
#include "client/include/client_priv.h"
@@ -74,7 +74,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
7474
#endif
7575

7676
#if defined(USE_LIBEDIT_INTERFACE)
77-
#include <locale.h>
77+
#include <clocale>
7878
#endif
7979

8080
#ifdef HAVE_PWD_H

client/mysql_config_editor.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2012, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2012, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -32,12 +32,12 @@
3232

3333
#include "my_config.h"
3434

35-
#include <errno.h>
3635
#include <fcntl.h>
37-
#include <signal.h>
38-
#include <stdarg.h>
39-
#include <stdlib.h>
4036
#include <sys/types.h>
37+
#include <cerrno>
38+
#include <csignal>
39+
#include <cstdarg>
40+
#include <cstdlib>
4141

4242
#include "client/include/client_priv.h"
4343
#include "my_aes.h"

client/mysql_secure_installation.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2013, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2013, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -23,9 +23,9 @@
2323
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2424
*/
2525

26-
#include <stdio.h>
27-
#include <stdlib.h>
2826
#include <sys/types.h>
27+
#include <cstdio>
28+
#include <cstdlib>
2929

3030
#include "client/include/client_priv.h"
3131
#include "m_string.h"

client/mysqladmin.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -28,11 +28,11 @@
2828
#include <fcntl.h>
2929
#include <mysql.h>
3030
#include <mysqld_error.h> /* to check server error codes */
31-
#include <signal.h>
32-
#include <stdlib.h>
3331
#include <sys/stat.h>
3432
#include <sys/types.h>
35-
#include <time.h>
33+
#include <csignal>
34+
#include <cstdlib>
35+
#include <ctime>
3636
#include <string>
3737

3838
#include "client/include/client_priv.h"

client/mysqldump.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -29,12 +29,12 @@
2929

3030
#include "my_config.h"
3131

32-
#include <errno.h>
3332
#include <fcntl.h>
34-
#include <stdarg.h>
35-
#include <stdio.h>
36-
#include <stdlib.h>
3733
#include <sys/types.h>
34+
#include <cerrno>
35+
#include <cstdarg>
36+
#include <cstdio>
37+
#include <cstdlib>
3838
#include <string>
3939
#include <unordered_map>
4040

client/mysqlimport.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -28,10 +28,10 @@
2828
** into a table(s).
2929
*/
3030

31-
#include <stdio.h>
32-
#include <stdlib.h>
3331
#include <sys/types.h>
34-
#include <time.h>
32+
#include <cstdio>
33+
#include <cstdlib>
34+
#include <ctime>
3535

3636
#include "client/include/client_priv.h"
3737
#include "compression.h"

client/mysqlshow.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -27,11 +27,11 @@
2727

2828
#include <mysql.h>
2929
#include <mysqld_error.h>
30-
#include <signal.h>
31-
#include <stdarg.h>
32-
#include <stdio.h>
33-
#include <stdlib.h>
3430
#include <sys/types.h>
31+
#include <csignal>
32+
#include <cstdarg>
33+
#include <cstdio>
34+
#include <cstdlib>
3535

3636
#include "client/include/caching_sha2_passwordopt-vars.h"
3737
#include "client/include/client_priv.h"

client/mysqlslap.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2005, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -88,13 +88,13 @@ database, then reporting the timing of each stage.
8888

8989
#include "my_config.h"
9090

91-
#include <ctype.h>
9291
#include <fcntl.h>
9392
#include <mysqld_error.h>
94-
#include <signal.h>
95-
#include <stdarg.h>
96-
#include <stdlib.h>
9793
#include <sys/types.h>
94+
#include <cctype>
95+
#include <csignal>
96+
#include <cstdarg>
97+
#include <cstdlib>
9898

9999
#include "client/include/caching_sha2_passwordopt-vars.h"
100100
#include "client/include/sslopt-vars.h"
@@ -105,8 +105,8 @@ database, then reporting the timing of each stage.
105105
#ifdef HAVE_SYS_TIME_H
106106
#include <sys/time.h>
107107
#endif
108-
#include <stdio.h>
109-
#include <time.h>
108+
#include <cstdio>
109+
#include <ctime>
110110

111111
#include "client/include/client_priv.h"
112112
#include "compression.h"

client/mysqltest.cc

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2000, 2024, Oracle and/or its affiliates.
1+
// Copyright (c) 2000, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -48,24 +48,24 @@
4848
#include <thread> // std::thread
4949
#endif
5050

51-
#include <assert.h>
51+
#include <cassert>
5252
#if defined MY_MSCRT_DEBUG || defined _WIN32
5353
#include <crtdbg.h>
5454
#endif
5555
#ifdef _WIN32
5656
#include <direct.h>
5757
#endif
58-
#include <errno.h>
5958
#include <fcntl.h>
60-
#include <limits.h>
6159
#include <mysql_async.h>
6260
#include <mysql_version.h>
6361
#include <mysqld_error.h>
64-
#include <signal.h>
65-
#include <stdarg.h>
66-
#include <stdio.h>
67-
#include <stdlib.h>
6862
#include <sys/types.h>
63+
#include <cerrno>
64+
#include <climits>
65+
#include <csignal>
66+
#include <cstdarg>
67+
#include <cstdio>
68+
#include <cstdlib>
6969
#ifndef _WIN32
7070
#include <poll.h>
7171
#include <sys/time.h>

client/mysqltest/secondary_engine.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2018, 2024, Oracle and/or its affiliates.
1+
// Copyright (c) 2018, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -25,7 +25,7 @@
2525
#include "client/mysqltest/error_names.h"
2626
#include "client/mysqltest/utils.h"
2727

28-
#include <assert.h>
28+
#include <cassert>
2929
#include <cstring>
3030
#include <fstream>
3131
#include <iostream>

client/path.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2012, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2012, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -24,7 +24,7 @@
2424
*/
2525
#include "client/path.h"
2626

27-
#include <stddef.h>
27+
#include <cstddef>
2828
#ifdef HAVE_UNISTD_H
2929
#include <unistd.h>
3030
#endif

client/readline.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -25,8 +25,8 @@
2525

2626
/* readline for batch mode */
2727

28-
#include <stdio.h>
2928
#include <sys/types.h>
29+
#include <cstdio>
3030

3131
#include "client/my_readline.h"
3232
#include "m_string.h"

components/audit_api_message_emit/audit_api_message_emit.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
1+
/* Copyright (c) 2018, 2025, Oracle and/or its affiliates.
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, version 2.0,
@@ -32,8 +32,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
3232
will receive this event.
3333
*/
3434

35-
#include <assert.h>
36-
#include <ctype.h>
3735
#include <mysql/components/component_implementation.h>
3836
#include <mysql/components/my_service.h>
3937
#include <mysql/components/service_implementation.h>
@@ -42,13 +40,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
4240
#include <mysql/components/services/udf_metadata.h>
4341
#include <mysql/components/services/udf_registration.h>
4442
#include <mysql/service_plugin_registry.h>
43+
#include <cassert>
44+
#include <cctype>
4545

46-
#include <stdio.h>
47-
#include <stdlib.h>
48-
#include <string.h>
4946
#include <sys/types.h>
5047
#include <algorithm>
5148
#include <cstdarg>
49+
#include <cstdio>
50+
#include <cstdlib>
51+
#include <cstring>
5252
#include <map>
5353
#include <memory>
5454
#include <string>

0 commit comments

Comments
 (0)