Skip to content

Commit 4491eaf

Browse files
Anonymous ReformatterSteinar H. Gunderson
Anonymous Reformatter
authored and
Steinar H. Gunderson
committed
Bug #27414321: CLANG-FORMAT EVERYTHING
Mark nearly all C/C++ code as under clang-format in .gitattributes, and run clang-format over the entire code base. The real committer is Steinar H. Gunderson <[email protected]>, but the author has been set to Anonymous Reformatter so that git blame won't show myself as author of all existing code. To ignore whitespace changes caused by this commit, please use git blame -w. For ignoring larger changes, you can run blame on the commit immediately preceding this, as follows: git blame clang-format-base^ -- path/to/file.cc
1 parent ab8ebdf commit 4491eaf

File tree

3,675 files changed

+910547
-1155487
lines changed

Some content is hidden

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

3,675 files changed

+910547
-1155487
lines changed

.gitattributes

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,41 @@
11
.gitattributes export-ignore
22
.gitignore export-ignore
3-
/sql/gis/*.cc filter=codeformat
4-
/sql/gis/*.h filter=codeformat
5-
/sql/gis/srs/*.cc filter=codeformat
6-
/sql/gis/srs/*.h filter=codeformat
7-
/include/my_alloc.h filter=codeformat
8-
/mysys/my_alloc.cc filter=codeformat
3+
4+
# All MySQL code is auto-formatted using clang-format.
5+
*.c filter=codeformat
6+
*.cc filter=codeformat
7+
*.cpp filter=codeformat
8+
*.h filter=codeformat
9+
*.hpp filter=codeformat
10+
*.i filter=codeformat
11+
*.ic filter=codeformat
12+
13+
# Third-party code.
14+
/extra/** !filter
15+
/include/boost_*/** !filter
16+
/plugin/innodb_memcached/daemon_memcached/** !filter
17+
/plugin/innodb_memcached/innodb_memcache/cache-src/** !filter
18+
/internal/plugin/keyring_okv/okv_client_sdk/** !filter
19+
/rapid/plugin/group_replication/libmysqlgcs/src/bindings/xcom/xcom/windeps/** !filter
20+
21+
# Generated from lex/yacc.
22+
/storage/innobase/fts/fts0blex.cc !filter
23+
/storage/innobase/fts/fts0pars.cc !filter
24+
/storage/innobase/fts/fts0tlex.cc !filter
25+
/storage/innobase/include/fts0blex.h !filter
26+
/storage/innobase/include/fts0pars.h !filter
27+
/storage/innobase/include/fts0tlex.h !filter
28+
/storage/innobase/pars/lexyy.cc !filter
29+
/storage/innobase/pars/pars0grm.cc !filter
30+
31+
# Other autogenerated files. The generators should eventually be updated.
32+
/strings/uca900_data.h !filter
33+
/strings/uca900_ja_data.h !filter
34+
/strings/uca_data.h !filter
35+
/internal/meb/meb/mysqloption_list.cpp !filter
36+
37+
# NDB is currently exempt and will be taken in a future merge.
38+
/storage/ndb/** !filter
39+
/sql/*ndb* !filter
40+
/sql/abstract_query_plan.h !filter
41+
/sql/abstract_query_plan.cc !filter

client/base/abstract_connection_program.cc

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,19 @@
2626

2727
using namespace Mysql::Tools::Base;
2828

29-
3029
Abstract_connection_program::Abstract_connection_program()
31-
: m_connection_options(this)
32-
{
30+
: m_connection_options(this) {
3331
this->add_provider(&this->m_connection_options);
3432
}
3533

36-
MYSQL* Abstract_connection_program::create_connection()
37-
{
34+
MYSQL *Abstract_connection_program::create_connection() {
3835
return this->m_connection_options.create_connection();
3936
}
4037

41-
CHARSET_INFO* Abstract_connection_program::get_current_charset() const
42-
{
38+
CHARSET_INFO *Abstract_connection_program::get_current_charset() const {
4339
return m_connection_options.get_current_charset();
4440
}
4541

46-
void Abstract_connection_program::set_current_charset(CHARSET_INFO* charset)
47-
{
42+
void Abstract_connection_program::set_current_charset(CHARSET_INFO *charset) {
4843
m_connection_options.set_current_charset(charset);
4944
}

client/base/abstract_connection_program.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,43 +34,42 @@
3434
#include "client/base/mysql_connection_options.h"
3535
#include "client/client_priv.h"
3636

37-
namespace Mysql{
38-
namespace Tools{
39-
namespace Base{
37+
namespace Mysql {
38+
namespace Tools {
39+
namespace Base {
4040

4141
/**
4242
Base class for all programs that use connection to MySQL database server.
4343
*/
44-
class Abstract_connection_program
45-
: public Abstract_program, public I_connection_factory
46-
{
47-
public:
44+
class Abstract_connection_program : public Abstract_program,
45+
public I_connection_factory {
46+
public:
4847
/**
4948
Provides new connection to MySQL database server based on option values.
5049
Implementation of I_connection_factory interface.
5150
*/
52-
virtual MYSQL* create_connection();
51+
virtual MYSQL *create_connection();
5352

5453
/**
5554
Retrieves charset that will be used in new MySQL connections. Can be NULL
5655
if none was set explicitly.
5756
*/
58-
CHARSET_INFO* get_current_charset() const;
57+
CHARSET_INFO *get_current_charset() const;
5958

6059
/**
6160
Sets charset that will be used in new MySQL connections.
6261
*/
63-
void set_current_charset(CHARSET_INFO* charset);
62+
void set_current_charset(CHARSET_INFO *charset);
6463

65-
protected:
64+
protected:
6665
Abstract_connection_program();
6766

68-
private:
67+
private:
6968
Options::Mysql_connection_options m_connection_options;
7069
};
7170

72-
}
73-
}
74-
}
71+
} // namespace Base
72+
} // namespace Tools
73+
} // namespace Mysql
7574

7675
#endif

client/base/abstract_enum_option.h

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,17 @@
2929

3030
#include "client/base/abstract_option.h"
3131

32-
namespace Mysql{
33-
namespace Tools{
34-
namespace Base{
35-
namespace Options{
32+
namespace Mysql {
33+
namespace Tools {
34+
namespace Base {
35+
namespace Options {
3636

3737
/**
3838
Abstract option to handle enum option values.
3939
*/
40-
template<typename T_type, typename T_typelib> class Abstract_enum_option
41-
: public Abstract_option<T_type>
42-
{
43-
protected:
40+
template <typename T_type, typename T_typelib>
41+
class Abstract_enum_option : public Abstract_option<T_type> {
42+
protected:
4443
/**
4544
Constructs new enum option.
4645
@param value Pointer to object to receive option value.
@@ -52,24 +51,23 @@ template<typename T_type, typename T_typelib> class Abstract_enum_option
5251
@param default_value default value to be supplied to internal option
5352
data structure.
5453
*/
55-
Abstract_enum_option(T_type* value, const T_typelib* type, ulong var_type,
56-
std::string name, std::string description, longlong default_value);
54+
Abstract_enum_option(T_type *value, const T_typelib *type, ulong var_type,
55+
std::string name, std::string description,
56+
longlong default_value);
5757
};
5858

59-
60-
template<typename T_type, typename T_typelib>Abstract_enum_option<T_type, T_typelib>
61-
::Abstract_enum_option(
62-
T_type* value, const T_typelib* type, ulong var_type, std::string name,
63-
std::string description, longlong default_value)
64-
: Abstract_option<T_type>(
65-
value, var_type, name, description, default_value)
66-
{
67-
this->m_option_structure.typelib= const_cast<T_typelib*>(type);
59+
template <typename T_type, typename T_typelib>
60+
Abstract_enum_option<T_type, T_typelib>::Abstract_enum_option(
61+
T_type *value, const T_typelib *type, ulong var_type, std::string name,
62+
std::string description, longlong default_value)
63+
: Abstract_option<T_type>(value, var_type, name, description,
64+
default_value) {
65+
this->m_option_structure.typelib = const_cast<T_typelib *>(type);
6866
}
6967

70-
}
71-
}
72-
}
73-
}
68+
} // namespace Options
69+
} // namespace Base
70+
} // namespace Tools
71+
} // namespace Mysql
7472

7573
#endif

client/base/abstract_integer_number_option.h

Lines changed: 46 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -29,42 +29,42 @@
2929

3030
#include "client/base/abstract_number_option.h"
3131

32-
namespace Mysql{
33-
namespace Tools{
34-
namespace Base{
35-
namespace Options{
32+
namespace Mysql {
33+
namespace Tools {
34+
namespace Base {
35+
namespace Options {
3636

3737
/**
3838
Abstract option to handle integer number option values.
3939
*/
40-
template<typename T_type, typename T_value> class Abstract_integer_number_option
41-
: public Abstract_number_option<T_type, T_value>
42-
{
43-
public:
40+
template <typename T_type, typename T_value>
41+
class Abstract_integer_number_option
42+
: public Abstract_number_option<T_type, T_value> {
43+
public:
4444
/**
4545
Sets value for this option. If it is specified before handling commandline
4646
options then supplied value is used as default value of this option.
4747
*/
48-
T_type* set_value(T_value value);
48+
T_type *set_value(T_value value);
4949

5050
/**
5151
Sets required divisor of input value.
5252
*/
53-
T_type* set_value_step(T_value step);
53+
T_type *set_value_step(T_value step);
5454
/**
5555
Sets minimum value boundary for option value. Smaller values passed as
5656
option value will be changed to this minimum value.
5757
Part of implementation of Abstract_number_option virtual method.
5858
*/
59-
virtual T_type* set_minimum_value(T_value minimum);
59+
virtual T_type *set_minimum_value(T_value minimum);
6060
/**
6161
Sets maximum value boundary for option value. Greater values passed as
6262
option value will be changed to this maximum value.
6363
Part of implementation of Abstract_number_option virtual method.
6464
*/
65-
virtual T_type* set_maximum_value(T_value maximum);
65+
virtual T_type *set_maximum_value(T_value maximum);
6666

67-
protected:
67+
protected:
6868
/**
6969
Constructs new number option.
7070
@param value Pointer to object to receive option value.
@@ -73,58 +73,50 @@ template<typename T_type, typename T_value> class Abstract_integer_number_option
7373
--name.
7474
@param description Description of option to be printed in --help.
7575
*/
76-
Abstract_integer_number_option(
77-
T_value* value, ulong var_type, std::string name, std::string description);
76+
Abstract_integer_number_option(T_value *value, ulong var_type,
77+
std::string name, std::string description);
7878
};
7979

80-
template<typename T_type, typename T_value>
81-
Abstract_integer_number_option<T_type, T_value>::
82-
Abstract_integer_number_option(
83-
T_value* value, ulong var_type, std::string name,
84-
std::string description)
85-
: Abstract_number_option<T_type, T_value>(
86-
value, var_type, name, description, 0)
87-
{
88-
*value= 0;
80+
template <typename T_type, typename T_value>
81+
Abstract_integer_number_option<T_type, T_value>::Abstract_integer_number_option(
82+
T_value *value, ulong var_type, std::string name, std::string description)
83+
: Abstract_number_option<T_type, T_value>(value, var_type, name,
84+
description, 0) {
85+
*value = 0;
8986
}
9087

91-
template<typename T_type, typename T_value>
92-
T_type* Abstract_integer_number_option<T_type, T_value>::
93-
set_value(T_value value)
94-
{
95-
*(T_value*)this->m_option_structure.value= value;
96-
this->m_option_structure.def_value= (longlong)value;
97-
return (T_type*)this;
88+
template <typename T_type, typename T_value>
89+
T_type *Abstract_integer_number_option<T_type, T_value>::set_value(
90+
T_value value) {
91+
*(T_value *)this->m_option_structure.value = value;
92+
this->m_option_structure.def_value = (longlong)value;
93+
return (T_type *)this;
9894
}
9995

100-
template<typename T_type, typename T_value>
101-
T_type* Abstract_integer_number_option<T_type, T_value>::
102-
set_value_step(T_value step)
103-
{
104-
this->m_option_structure.block_size= (long)step;
105-
return (T_type*)this;
96+
template <typename T_type, typename T_value>
97+
T_type *Abstract_integer_number_option<T_type, T_value>::set_value_step(
98+
T_value step) {
99+
this->m_option_structure.block_size = (long)step;
100+
return (T_type *)this;
106101
}
107102

108-
template<typename T_type, typename T_value>
109-
T_type* Abstract_integer_number_option<T_type, T_value>::
110-
set_minimum_value(T_value minimum)
111-
{
112-
this->m_option_structure.min_value= (longlong)minimum;
113-
return (T_type*)this;
103+
template <typename T_type, typename T_value>
104+
T_type *Abstract_integer_number_option<T_type, T_value>::set_minimum_value(
105+
T_value minimum) {
106+
this->m_option_structure.min_value = (longlong)minimum;
107+
return (T_type *)this;
114108
}
115109

116-
template<typename T_type, typename T_value>
117-
T_type* Abstract_integer_number_option<T_type, T_value>::
118-
set_maximum_value(T_value maximum)
119-
{
120-
this->m_option_structure.max_value= (ulonglong)maximum;
121-
return (T_type*)this;
110+
template <typename T_type, typename T_value>
111+
T_type *Abstract_integer_number_option<T_type, T_value>::set_maximum_value(
112+
T_value maximum) {
113+
this->m_option_structure.max_value = (ulonglong)maximum;
114+
return (T_type *)this;
122115
}
123116

124-
125-
}
126-
}
127-
}
128-
}
117+
} // namespace Options
118+
} // namespace Base
119+
} // namespace Tools
120+
} // namespace Mysql
129121

130122
#endif

0 commit comments

Comments
 (0)