Skip to content

Commit

Permalink
Bug #24710065: SPLIT MY_GLOBAL.H
Browse files Browse the repository at this point in the history
Run include-what-you-use limited to adding "my_io.h" and then re-sorting
the #includes (and nothing else); then remove "my_io.h" from my_global.h.

Change-Id: I69dc6b94d53c722427239f28b3639488ca4890d0
  • Loading branch information
Steinar H. Gunderson committed Jan 31, 2017
1 parent 7fc4fd3 commit e363c28
Show file tree
Hide file tree
Showing 186 changed files with 308 additions and 76 deletions.
1 change: 1 addition & 0 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "my_dbug.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_loglevel.h"
#include "my_readline.h"
#include "mysql/service_my_snprintf.h"
Expand Down
1 change: 1 addition & 0 deletions client/mysql_config_editor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "my_default_priv.h"
#include "my_dir.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_rnd.h"
#include "mysql/service_mysql_alloc.h"
#include "print_version.h"
Expand Down
1 change: 1 addition & 0 deletions client/mysql_ssl_rsa_setup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "mysql/service_mysql_alloc.h"
#include "path.h"
#include "print_version.h"
Expand Down
1 change: 1 addition & 0 deletions client/mysqladmin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "my_dbug.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "mysql/service_mysql_alloc.h"
#include "print_version.h"
#include "typelib.h"
Expand Down
1 change: 1 addition & 0 deletions client/mysqlbinlog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "my_decimal.h"
#include "my_default.h"
#include "my_dir.h"
#include "my_io.h"
#include "my_time.h"
#include "mysql/service_my_snprintf.h"
#include "prealloced_array.h"
Expand Down
1 change: 1 addition & 0 deletions client/mysqldump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include "my_dbug.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "mysql.h"
#include "mysql/service_my_snprintf.h"
#include "mysql/service_mysql_alloc.h"
Expand Down
1 change: 1 addition & 0 deletions client/mysqlimport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "my_dbug.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_systime.h"
#include "mysql/service_my_snprintf.h"
#include "mysql/service_mysql_alloc.h"
Expand Down
1 change: 1 addition & 0 deletions client/mysqlslap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
#include "my_dbug.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_systime.h"
#include "mysql/service_my_snprintf.h"
#include "mysql/service_mysql_alloc.h"
Expand Down
1 change: 1 addition & 0 deletions client/mysqltest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include "my_dbug.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_pointer_arithmetic.h"
#include "my_regex.h" /* Our own version of regex */
#include "my_thread_local.h"
Expand Down
1 change: 1 addition & 0 deletions client/path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "my_dir.h"
#include "my_global.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_sys.h"

#ifndef _WIN32
Expand Down
1 change: 1 addition & 0 deletions client/readline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_readline.h"
#include "my_thread_local.h"
#include "mysql/service_mysql_alloc.h"
Expand Down
1 change: 1 addition & 0 deletions client/upgrade/program.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "check/mysqlcheck.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "mysqld_error.h"
#include "sql_string.h"

Expand Down
10 changes: 6 additions & 4 deletions components/mysql_server/dynamic_loader_path_filter.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -13,14 +13,16 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA */

#include <string>
#include <my_global.h> // needed by mysql_com.h
#include <mysql_com.h> // NAME_CHAR_LEN
#include <mysql/components/service_implementation.h>
#include <mysql/components/services/dynamic_loader_scheme_file.h>
#include <mysql_com.h> // NAME_CHAR_LEN
#include <string>

#include "../../../sql/sql_plugin.h" // opt_plugin_dir
#include "dynamic_loader_path_filter.h"
#include "dynamic_loader_scheme_file.h"
#include "my_io.h"
#include "server_component.h"

typedef std::string my_string;
Expand Down Expand Up @@ -132,4 +134,4 @@ bool
out_path+= path_buff;

return false;
}
}
1 change: 1 addition & 0 deletions dbug/dbug.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_sys.h"
#include "my_thread_local.h"
#include "mysql/service_my_snprintf.h"
Expand Down
1 change: 0 additions & 1 deletion include/my_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <crtdbg.h>
#endif

#include "my_io.h"
#include "my_macros.h"
#include "my_sharedlib.h"
#include "my_shm_defaults.h"
Expand Down
1 change: 1 addition & 0 deletions include/my_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "my_compiler.h"
#include "my_global.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_psi_config.h" /* IWYU pragma: keep */

#ifdef HAVE_ALLOCA_H
Expand Down
1 change: 1 addition & 0 deletions include/myisam.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "my_check_opt.h"
#include "my_compare.h"
#include "my_inttypes.h"
#include "my_io.h"

#ifdef __cplusplus
extern "C" {
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/psi/psi_abi_file_v0.h.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#include "mysql/psi/psi_file.h"
#include "my_global.h"
#include "my_io.h"
#include "my_config.h"
static inline int is_directory_separator(char c)
{
return c == '/';
}
typedef int File;
typedef mode_t MY_MODE;
typedef socklen_t socket_len_t;
typedef int my_socket;
#include "my_psi_config.h"
#include "psi_base.h"
#include "my_psi_config.h"
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/psi/psi_abi_file_v1.h.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#include "mysql/psi/psi_file.h"
#include "my_global.h"
#include "my_io.h"
#include "my_config.h"
static inline int is_directory_separator(char c)
{
return c == '/';
}
typedef int File;
typedef mode_t MY_MODE;
typedef socklen_t socket_len_t;
typedef int my_socket;
#include "my_psi_config.h"
#include "psi_base.h"
#include "my_psi_config.h"
Expand Down
12 changes: 11 additions & 1 deletion include/mysql/psi/psi_abi_file_v2.h.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#include "mysql/psi/psi_file.h"
#include "my_global.h"
#include "my_io.h"
#include "my_config.h"
static inline int is_directory_separator(char c)
{
return c == '/';
}
typedef int File;
typedef mode_t MY_MODE;
typedef socklen_t socket_len_t;
typedef int my_socket;
#include "my_psi_config.h"
#include "psi_base.h"
#include "my_psi_config.h"
Expand All @@ -20,7 +30,7 @@
typedef struct PSI_file PSI_file;
struct PSI_file_bootstrap
{
void* (*get_interface)(int version);
void *(*get_interface)(int version);
};
typedef struct PSI_file_bootstrap PSI_file_bootstrap;
typedef struct PSI_placeholder PSI_file_service_t;
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/psi/psi_abi_socket_v0.h.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#include "mysql/psi/psi_socket.h"
#include "my_global.h"
#include "my_io.h"
#include "my_config.h"
static inline int is_directory_separator(char c)
{
return c == '/';
}
typedef int File;
typedef mode_t MY_MODE;
typedef socklen_t socket_len_t;
typedef int my_socket;
#include "my_psi_config.h"
#include "psi_base.h"
#include "my_psi_config.h"
Expand Down
10 changes: 10 additions & 0 deletions include/mysql/psi/psi_abi_socket_v1.h.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#include "mysql/psi/psi_socket.h"
#include "my_global.h"
#include "my_io.h"
#include "my_config.h"
static inline int is_directory_separator(char c)
{
return c == '/';
}
typedef int File;
typedef mode_t MY_MODE;
typedef socklen_t socket_len_t;
typedef int my_socket;
#include "my_psi_config.h"
#include "psi_base.h"
#include "my_psi_config.h"
Expand Down
12 changes: 11 additions & 1 deletion include/mysql/psi/psi_abi_socket_v2.h.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#include "mysql/psi/psi_socket.h"
#include "my_global.h"
#include "my_io.h"
#include "my_config.h"
static inline int is_directory_separator(char c)
{
return c == '/';
}
typedef int File;
typedef mode_t MY_MODE;
typedef socklen_t socket_len_t;
typedef int my_socket;
#include "my_psi_config.h"
#include "psi_base.h"
#include "my_psi_config.h"
Expand All @@ -20,7 +30,7 @@
typedef struct PSI_socket PSI_socket;
struct PSI_socket_bootstrap
{
void* (*get_interface)(int version);
void *(*get_interface)(int version);
};
typedef struct PSI_socket_bootstrap PSI_socket_bootstrap;
typedef struct PSI_placeholder PSI_socket_service_t;
Expand Down
3 changes: 2 additions & 1 deletion include/mysql/psi/psi_file.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -26,6 +26,7 @@
*/

#include "my_global.h"
#include "my_io.h"
#include "my_psi_config.h" // IWYU pragma: keep
#include "psi_base.h"

Expand Down
3 changes: 2 additions & 1 deletion include/mysql/psi/psi_socket.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -26,6 +26,7 @@
*/

#include "my_global.h"
#include "my_io.h"
#include "my_psi_config.h" // IWYU pragma: keep
#include "psi_base.h"

Expand Down
3 changes: 2 additions & 1 deletion libbinlogevents/include/binlog_event.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -40,6 +40,7 @@
*/
#include "byteorder.h"
#include "debug_vars.h"
#include "my_io.h"
#include "wrapper_functions.h"

#if defined(_WIN32)
Expand Down
10 changes: 5 additions & 5 deletions libbinlogevents/src/control_events.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -13,14 +13,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

#include "binary_log_types.h"

#include "statement_events.h"

#include <algorithm>
#include <cstdio>
#include <string>

#include "binary_log_types.h"
#include "my_io.h"
#include "statement_events.h"

namespace binary_log
{

Expand Down
1 change: 1 addition & 0 deletions libmysql/libmysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "my_dbug.h"
#include "my_double2ulonglong.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_pointer_arithmetic.h"
#include "my_thread_local.h"
#include "mysql.h"
Expand Down
1 change: 1 addition & 0 deletions mysys/mf_tempdir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "mutex_lock.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "mysys_priv.h"
#include "prealloced_array.h"

Expand Down
1 change: 1 addition & 0 deletions mysys_ssl/my_default.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "my_default.h"
#include "my_default_priv.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_loglevel.h"
#include "my_psi_config.h"
#include "mysql/psi/mysql_file.h"
Expand Down
1 change: 1 addition & 0 deletions mysys_ssl/my_getopt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "my_dbug.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_loglevel.h"
#include "mysql/service_mysql_alloc.h"
#include "typelib.h"
Expand Down
1 change: 1 addition & 0 deletions plugin/daemon_example/daemon_example.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "m_string.h" // strlen
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_psi_config.h"
#include "my_sys.h" // my_write, my_malloc
#include "my_thread.h"
Expand Down
1 change: 1 addition & 0 deletions plugin/keyring/buffered_file_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "keyring_memory.h"
#include "logger.h"
#include "my_inttypes.h"
#include "my_io.h"

namespace keyring {

Expand Down
1 change: 1 addition & 0 deletions plugin/keyring/checker/checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "keyring_memory.h"
#include "logger.h"
#include "my_inttypes.h"
#include "my_io.h"

namespace keyring {

Expand Down
Loading

0 comments on commit e363c28

Please sign in to comment.